public static void PlayerPosition(Player _player) { using (ServerPacket _packet = new ServerPacket((int)ServerPackets.playerPosition)) { _packet.Write(_player.id); _packet.Write(_player.position); SendUDPDataToAll(_packet); } }
public static void Welcome(int _toClient, string _msg) { using (ServerPacket _packet = new ServerPacket((int)ServerPackets.welcome)) { _packet.Write(_msg); _packet.Write(_toClient); SendTCPData(_toClient, _packet); } }
public static void SpawnPlayer(int _toClient, Player _player) { using (ServerPacket _packet = new ServerPacket((int)ServerPackets.spawnPlayer)) { _packet.Write(_player.id); _packet.Write(_player.username); Console.WriteLine(_player.selectedCharacter); _packet.Write(_player.selectedCharacter); _packet.Write(_player.position); _packet.Write(_player.rotation); SendTCPData(_toClient, _packet); } }