예제 #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();
        }
예제 #2
0
 private void Disconnect()
 {
     Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} 关闭连接");
     player = null;
     tcp.Disconnect();
     udp.Disconnect();
 }
예제 #3
0
        public void Disconnect()
        {
            Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

            //TODO
            Player = null;
            tcp.Disconnect();
        }
예제 #4
0
 private void Disconnect()
 {
     Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");
     ServerSend.PlayerDisconnect(player);
     player = null;
     tcp.Disconnect();
     udp.Disconnect();
 }
예제 #5
0
 public void Disconnect()
 {
     ServerSend.RemovePlayer(id);
     Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");
     player = null;
     tcp.Disconnect();
     udp.Disconnect();
 }
예제 #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();
 }
예제 #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();
        }
예제 #8
0
        private void Disconnect()
        {
            Console.WriteLine($"{Tcp.Socket.Client.RemoteEndPoint} has disconnected.");

            Player = null;

            Tcp.Disconnect();
            Udp.Disconnect();
        }
예제 #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();
        }
예제 #10
0
        private void Disconnect()
        {
            Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

            Server.room.LeaveTheRoom(this);


            //  player = null;

            tcp.Disconnect();
            udp.Disconnect();
        }
예제 #11
0
파일: Client.cs 프로젝트: Austin-Tan/Soar
        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);
        }
예제 #12
0
파일: Client.cs 프로젝트: Audiofizz/AfitzMP
        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();
        }
예제 #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();
		}
예제 #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();
        }