Пример #1
0
        private void PlayerPacketReceived(PlayerPacket playerPacket, NetPeer peer)
        {
            Player playerSending = _playersManager.GetConnectedPlayer(peer);

            if (playerSending == null)
            {
                return;
            }

            switch (playerPacket.PlayerCommand)
            {
            case PlayerCommand.CHANGE_PLAYER_NAME:
                _playersManager.ChangePlayerConfig(playerPacket.PlayerName, playerSending);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }