import random import asyncio import struct class Greetings: def __init__(self, server): self.server = server self.messages = ["Welcome %s!", "Beware! %s has arrived!", "A wild %s appears", "%s has come and is ready to pwn."] async def on_player_join(self, player): await self.server.broadcast_message(random.choice(self.messages) % player.name) #await Greetings.send_ping(player) @staticmethod async def send_ping(player): while 1: for ping in range(0, 999): await player.session.send_gamedata(b"\x2f\x02\x00\x00" + struct.pack("