Пример #1
0
        private void Update()
        {
            if (IsServer)
            {
                _networkServer.TryAcceptClient(out _, out _);
                _messageServer.ReadAllMessages();
                _networkServer.DropDisconnectedClients();
            }

            else if (IsClient)
            {
                _messageClient.ReadAllMessages();
                if (!_networkClient.CheckServer())
                {
                    Stop();
                }
            }
        }