async def handle(self, p: Player) -> None: c = glob.channels[self.name] if not c: log(f'{p} failed to leave {self.name}.', Ansi.LYELLOW) return if p not in c: # user not in chan return # leave the chan server-side. p.leave_channel(c)
m.enqueue(packets.updateMatch(m), lobby=False) # PacketID: 78 @bancho_packet(Packet.c_channelPart) def channelPart(p: Player, pr: PacketReader) -> None: if not (chan := pr.read(osuTypes.string)[0]): return if not (c := glob.channels.get(chan)): printlog(f'Failed to find channel {chan} that {p} attempted to leave.') return # Leave the channel server-side. p.leave_channel(c) # Enqueue new channelinfo (playercount) to all players. glob.players.enqueue(packets.channelInfo(*c.basic_info)) # PacketID: 79 @bancho_packet(Packet.c_ReceiveUpdates) def receiveUpdates(p: Player, pr: PacketReader) -> None: if (f := pr.read(osuTypes.i32)[0]) not in range(3): printlog(f'{p} tried to set his presence filter to {f}?') return p.pres_filter = PresenceFilter(f)