Esempio n. 1
0
        private void Disconnect()
        {
            Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

            //смена очереди на следующего, с условием того, что вышел тот, кто ходит в данный момент
            Server.queuePlayers.Remove(id);
            if (Server.queuePlayer >= Server.queuePlayers.Count)
            {
                if (Server.queuePlayers.Count > 0)
                {
                    Server.queuePlayer = 1;
                    ServerSend.QueuePlayer(Server.queuePlayers[Server.queuePlayer - 1]);
                }
                else
                {
                    Server.queuePlayer = 0;
                }
            }

            ServerSend.Disconnect(player);

            player = null;
            tcp.Disconnect();
            udp.Disconnect();
        }
Esempio n. 2
0
 private void Disconnect()
 {
     Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} 关闭连接");
     player = null;
     tcp.Disconnect();
     udp.Disconnect();
 }
Esempio n. 3
0
        public void Disconnect()
        {
            Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

            //TODO
            Player = null;
            tcp.Disconnect();
        }
Esempio n. 4
0
 private void Disconnect()
 {
     Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");
     ServerSend.PlayerDisconnect(player);
     player = null;
     tcp.Disconnect();
     udp.Disconnect();
 }
 public void Disconnect()
 {
     ServerSend.RemovePlayer(id);
     Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");
     player = null;
     tcp.Disconnect();
     udp.Disconnect();
 }
Esempio n. 6
0
 private void Disconnect()
 {
     Console.ForegroundColor = ConsoleColor.DarkYellow;
     Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} foi desconectado");
     Console.ForegroundColor = ConsoleColor.White;
     player = null;
     tcp.Disconnect();
     udp.Disconnect();
 }
Esempio n. 7
0
        /// <summary>Disconnects the client and stops all network traffic.</summary>
        public void Disconnect()
        {
            Console.WriteLine($"{tcp?.tcpClient.Client.RemoteEndPoint} has disconnected.");

            Server.RemoveClient(Id);

            tcp?.Disconnect();
            udp?.Disconnect();
        }
Esempio n. 8
0
        private void Disconnect()
        {
            Console.WriteLine($"{Tcp.Socket.Client.RemoteEndPoint} has disconnected.");

            Player = null;

            Tcp.Disconnect();
            Udp.Disconnect();
        }
Esempio n. 9
0
        /// <summary>Disconnects the client and stops all network traffic.</summary>
        private void Disconnect()
        {
            Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

            player             = null;
            myUser             = null;
            currentUserSession = null;

            tcp.Disconnect();
            udp.Disconnect();
        }
Esempio n. 10
0
        private void Disconnect()
        {
            Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

            Server.room.LeaveTheRoom(this);


            //  player = null;

            tcp.Disconnect();
            udp.Disconnect();
        }
Esempio n. 11
0
        private void Disconnect()
        {
            // sometimes this method will be called multiple times for one disconnection, in which case we can't access player anymore
            if (player != null)
            {
                Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} ({this.player.username}) has disconnected.");
            }

            player = null;

            tcp.Disconnect();
            udp.Disconnect();
            ServerSend.RemovePlayer(this.id);
        }
Esempio n. 12
0
        public void Disconnect()
        {
            Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected");

            ServerSend.DisconnectPlayer(id);

            ThreadManager.ExecuteOnMainThread(() =>
            {
                UnityEngine.Object.Destroy(player.gameObject);
                player = null;
            });

            tcp.Disconnect();
            udp.Disconnect();
        }
Esempio n. 13
0
		/// <summary>Disconnects the client and stops all network traffic.</summary>
		private void Disconnect()
		{
			Debug.Log("ID " + player.id + " disconnected");
			Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");
			
			ServerSend.RemoveClient(player);
			
			ThreadManager.ExecuteOnMainThread(() =>
			{
				UnityEngine.Object.Destroy(player.gameObject);
				player = null;
			});

			tcp.Disconnect();
			udp.Disconnect();
		}
Esempio n. 14
0
        public void Disconnect()
        {
            Console.WriteLine(tcp.socket.Client.RemoteEndPoint + " disconnected.");

            if (player.ready)
            {
                GameLogic.readyPlayers--;
            }

            Server.currentPlayers--;

            player = null;



            tcp.Disconnect();
            udp.Disconnect();
        }