コード例 #1
0
 public void RemovePlayer(GamePeer peer)
 {
     lock (playerLock)
     {
         PlayerKey pKey = PlayerKey.MakeFromPeer(peer);
         playersDic.Remove(pKey);
     }
 }
コード例 #2
0
        public Player GetPlayer(GamePeer peer)
        {
            PlayerKey key = PlayerKey.MakeFromPeer(peer);

            if (playersDic.ContainsKey(key))
            {
                return(playersDic[key]);
            }

            return(null);
        }
コード例 #3
0
 public Player(GamePeer peer, PlayerInfo info)
 {
     this.peer = peer;
     this.key  = PlayerKey.MakeFromPeer(peer);
     this.name = info.username;
 }