class MatchLoadComplete(BanchoPacket, type=Packets.OSU_MATCH_LOAD_COMPLETE): async def handle(self, p: Player) -> None: if not (m := p.match): return # ready up our player. m.get_slot(p).loaded = True # check if all players are ready. if not any(s.status == SlotStatus.playing and not s.loaded for s in m.slots): m.enqueue(packets.matchAllPlayerLoaded(), lobby=False)
class MatchLoadComplete(BanchoPacket, type=Packets.OSU_MATCH_LOAD_COMPLETE): async def handle(self, p: Player) -> None: if not (m := p.match): return # our player has loaded in and is ready to play. m.get_slot(p).loaded = True is_playing = lambda s: (s.status == SlotStatus.playing and not s.loaded ) # check if all players are loaded, # if so, tell all players to begin. if not any(map(is_playing, m.slots)): m.enqueue(packets.matchAllPlayerLoaded(), lobby=False)
# PacketID: 52 @bancho_packet(Packet.c_matchLoadComplete) def matchLoadComplete(p: Player, pr: PacketReader) -> None: if not (m := p.match): printlog(f'{p} sent a scoreframe outside of a match?') return # Ready up our player. m.get_slot(p).loaded = True # Check if all players are ready. if not any(s.status & SlotStatus.playing and not s.loaded for s in m.slots): m.enqueue(packets.matchAllPlayerLoaded(), lobby=False) # PacketID: 54 @bancho_packet(Packet.c_matchNoBeatmap) def matchNoBeatmap(p: Player, pr: PacketReader) -> None: if not (m := p.match): return m.get_slot(p).status = SlotStatus.no_map m.enqueue(packets.updateMatch(m)) # PacketID: 55 @bancho_packet(Packet.c_matchNotReady) def matchNotReady(p: Player, pr: PacketReader) -> None: