public void Remove(EiNetworkPlayerInternal player) { for (int i = playerList.Count - 1; i >= 0; i--) { if (playerList [i].Id == player.Id) { playerList.RemoveAt(i); Log("Removed player with id: " + player.Id); } } }
public void Add(EiNetworkPlayerInternal player) { bool hasPlayer = false; for (int i = playerList.Count - 1; i >= 0; i--) { if (playerList [i].Id == player.Id) { hasPlayer = true; break; } } if (hasPlayer) { LogError("Already has a player with given id: " + player.Id); } else { playerList.Add(player); } }
public void AssignLocalPlayer(EiNetworkPlayerInternal player) { localPlayer = player; Add(player); }
public void OnPlayerJoined(EiNetworkPlayerInternal player) { //Fix player joined setup }