public void RemovePlayer(GamePeer peer) { lock (playerLock) { PlayerKey pKey = PlayerKey.MakeFromPeer(peer); playersDic.Remove(pKey); } }
public Player GetPlayer(GamePeer peer) { PlayerKey key = PlayerKey.MakeFromPeer(peer); if (playersDic.ContainsKey(key)) { return(playersDic[key]); } return(null); }
public Player(GamePeer peer, PlayerInfo info) { this.peer = peer; this.key = PlayerKey.MakeFromPeer(peer); this.name = info.username; }