예제 #1
0
 internal void VerifyPlayerConnecting(Player player, Guid token)
 {
     if (_waitingTokens.TryGetValue(token, out var wait))
     {
         wait.Player = player;
     }
     else
     {
         _waitingTokens[token] = new WaitingToken {
             Player = player
         };
     }
 }
예제 #2
0
        private void VerifyPlayerConnecting(Player player, Guid token)
        {
            WaitingToken wait;

            if (_waitingTokens.TryGetValue(token, out wait))
            {
                wait.Player = player;
            }
            else
            {
                _waitingTokens[token] = new WaitingToken {
                    Player = player
                };
            }
        }
예제 #3
0
        internal void PlayerWillConnect(NetMessage msg)
        {
            if (!msg.ReadGuid(out var guid))
            {
                Debug.LogError("Got a message for expecting a player, but no token was sent");
                return;
            }
            var id = msg.ReadUInt16();

            if (_waitingTokens.TryGetValue(guid, out var wait))
            {
                wait.Id = id;
            }
            else
            {
                _waitingTokens[guid] = new WaitingToken {
                    Id = id
                };
            }
        }