private Player ReadPlayer(NetIncomingMessage inc) { var player = new Player(); inc.ReadAllProperties(player); return player; }
private void UpdatePlayerList(NetIncomingMessage nim) { lock (mPlayerList) { mPlayerList.Clear(); int playerCount = 0; playerCount = nim.ReadInt32(); int npcCount = 0; npcCount = nim.ReadInt32(); for (int i = 0; i < playerCount; i++) { PlayerPrimitive player = new PlayerPrimitive(); nim.ReadAllProperties(player); if(player.UniqueId != ClientsUniqueId) Console.WriteLine("player: " + player.Name + " x: " + player.X + "; y: " + player.Y); mPlayerList.Add(player.UniqueId, player); } for (int i = 0; i < npcCount; i++) { PlayerPrimitive player = new PlayerPrimitive(); nim.ReadAllProperties(player); if (player.UniqueId != ClientsUniqueId) Console.WriteLine("player: " + player.Name + " x: " + player.X + "; y: " + player.Y); mPlayerList.Add(player.UniqueId, player); } } }