async def handle(self, p: Player) -> None: # this runs very frequently during spectation, # so it's written to run pretty quick. # read the entire data of the packet, and ignore it internally data = packets.spectateFrames(self.play_data) # enqueue the data # to all spectators. for t in p.spectators: t.enqueue(data)
def spectateFrames(p: Player, pr: PacketReader) -> None: data = packets.spectateFrames(pr.data[:pr.length]) pr.ignore_packet() for t in p.spectators: t.enqueue(data)