Example #1
0
File: cho.py Project: Mxnuuel/gulag
class MatchFailed(BanchoPacket, type=Packets.OSU_MATCH_FAILED):
    async def handle(self, p: Player) -> None:
        if not (m := p.match):
            return

        # find the player's slot id, and enqueue that
        # they've failed to all other players in the match.
        m.enqueue(packets.matchPlayerFailed(m.get_slot_id(p)), lobby=False)
Example #2
0
class MatchHasBeatmap(ClientPacket, type=ClientPacketType.MATCH_HAS_BEATMAP):
    async def handle(self, p: Player) -> None:
        if not (m := p.match):
            return

        # find the player's slot, and it into a playerFailed packet
        slot_id = m.get_slot_id(p)
        data = packets.matchPlayerFailed(slot_id)

        # enqueue data to all players in the match
        m.enqueue(data)
Example #3
0
def matchNotReady(p: Player, pr: PacketReader) -> None:
    if not (m := p.match):
        printlog(f'{p} tried unreadying outside of a match? (1)')
        return

    m.get_slot(p).status = SlotStatus.not_ready
    m.enqueue(packets.updateMatch(m), lobby=False)


# PacketID: 56
@bancho_packet(Packet.c_matchFailed)
def matchFailed(p: Player, pr: PacketReader) -> None:
    if not (m := p.match):
        return

    m.enqueue(packets.matchPlayerFailed(m.get_slot_id(p)))


# PacketID: 59
@bancho_packet(Packet.c_matchHasBeatmap)
def matchHasBeatmap(p: Player, pr: PacketReader) -> None:
    if not (m := p.match):
        return

    m.get_slot(p).status = SlotStatus.not_ready
    m.enqueue(packets.updateMatch(m))


# PacketID: 60
@bancho_packet(Packet.c_matchSkipRequest)
def matchSkipRequest(p: Player, pr: PacketReader) -> None: