コード例 #1
0
ファイル: Client.cs プロジェクト: goldor8/HostServerBasic
 /// <summary>Disconnect the client (tcp and udp).</summary>
 private void Disconnect()
 {
     Tcp.Disconnect();
     Udp.Disconnect();
     _server.GetClients().Remove(ID); //Remove the client frome the server client list.
     _server.GetNetworkServerAction().RemovePlayer(ID);
 }
コード例 #2
0
        // Disconnect a single client from the server
        private void Disconnect()
        {
            Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

            tcp.Disconnect();
            udp.Disconnect();
        }
コード例 #3
0
    //Disconnessione Client
    public void Disconnect()
    {
        if (tcp.socket != null)
        {
            try{
                Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");
            }
            catch {
            }
            try{
                ThreadManager.ExecuteOnMainThread(() => {
                    GameManager.instance.players.Remove(player.id);
                    DestroyPlayer();
                    player = null;
                });
            }
            catch {
            }
            try{
                tcp.Disconnect();
                udp.Disconnect();

                ServerSend.PlayerDisconnected(id);
            }
            catch (Exception _ex)
            {
                Debug.Log($"Disconnessione Improvvisa Errore:{_ex}");
            }
        }
    }
コード例 #4
0
 private void Disconnect()
 {
     Console.WriteLine($"{Tcp.Socket.Client.RemoteEndPoint} has disconnected.");
     Player = null;
     Tcp.Disconnect();
     Udp.Disconnect();
 }
コード例 #5
0
    public void Disconnect()
    {
        if (isConnected)
        {
            GameManager.HandleClientDisconnect();

            isConnected = false;

            tcp.Disconnect();
            tcp = null;
            udp.Disconnect();
            udp = null;
            ServerManagerTCP.Disconnect();
            ServerManagerTCP = null;

            UnityEngine.Debug.Log("Disconnected from server.");

            OnConnectionChanged(new ClientConnectionEventArgs()
            {
                Success = !isConnected,
                Type    = ClientConnectionEvent.Disconnect
            });
            PlayerDisconnected?.Invoke(this, EventArgs.Empty);
        }
    }
コード例 #6
0
        /// <inheritdoc/>
        public void Disconnect()
        {
            Tcp.Disconnect();
            Udp.Disconnect();

            OnClientDisconnected?.Invoke(this, new ClientEventArgs(this, Protocol.TCP & Protocol.UDP));
        }
コード例 #7
0
        private void Disconnect()
        {
            AccountHandler.SignOut(id);

            player = null;
            tcp.Disconnect();
            udp.Disconnect();
        }
コード例 #8
0
 private void Disconnect()
 {
     LeaveCurrentRoom();
     Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected");
     player = null;
     tcp.Disconnect();
     udp.Disconnect();
 }
コード例 #9
0
ファイル: Client.cs プロジェクト: laroccrj/PirateGameServer
    /// <summary>Disconnects the client and stops all network traffic.</summary>
    private void Disconnect()
    {
        Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

        // TODO: destroy pirate

        tcp.Disconnect();
        udp.Disconnect();
    }
コード例 #10
0
ファイル: Client.cs プロジェクト: ErickGuimaraes/Tcc
    private void Disconnect()
    {
        Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");
        UnityEngine.Object.Destroy(player.gameObject);
        player = null;

        tcp.Disconnect();
        udp.Disconnect();
    }
コード例 #11
0
ファイル: Client.cs プロジェクト: ToreRisinger/Ship
        public void Disconnect()
        {
            Log.info($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

            connectionManager.OnClientDisconnected(id);

            tcp.Disconnect();
            udp.Disconnect();
        }
コード例 #12
0
        public void Dicsonnect()
        {
            Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

            player = null;

            tcp.Disconnect();
            udp.Disconnect();
        }
コード例 #13
0
        public void Disconnect()
        {
            tcp.Disconnect();
            udp.Disconnect();

            ThreadManager.ExecuteOnMainThread((GameLogic game) =>
            {
                game.Disconnect(id);
            });
        }
コード例 #14
0
ファイル: Client.cs プロジェクト: goldor8/ClientCommunication
    public void Disconnect()
    {
        if (IsConnected)
        {
            IsConnected = false;

            Tcp.DisConnect();
            Udp.Disconnect();
        }
    }
コード例 #15
0
    public void Disconnect()
    {
        Debug.Log($"{tcp.socket.Client.RemoteEndPoint} se ha desconectado");

        UnityEngine.Object.Destroy(player.gameObject);
        player = null;

        tcp.Disconnect();
        udp.Disconnect();
    }
コード例 #16
0
ファイル: Client.cs プロジェクト: IsGabriellaCurious/Moniteer
        private void Disconnect()
        {
            Console.WriteLine($"DEBUG: {tcp.socket.Client.RemoteEndPoint} has disconnected.");

            ServerService.clients.Remove(internalId);
            ServerService.clientIds.Remove(internalId);

            tcp.Disconnect();
            udp.Disconnect();
        }
コード例 #17
0
ファイル: Client.cs プロジェクト: Gohan500/c-Hazel
        private void Disconnect()
        {
            Debug.DLog($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");
            //StreamWriter sw = new StreamWriter(ServerHandle.path, true);
            //sw.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has disconnected at {DateTime.Now}");
            //sw.Close();

            tcp.Disconnect();
            udp.Disconnect();
        }
コード例 #18
0
    private void Disconnect()
    {
        Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");
        ServerStart.instance.DebugServer($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

        player = null;

        tcp.Disconnect();
        udp.Disconnect();
    }
コード例 #19
0
        /// <summary>Disconnects the client and stops all network traffic.</summary>
        private void Disconnect()
        {
            Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

            ThreadManager.ExecuteOnMainThread(() => {
                UnityEngine.Object.Destroy(player.gameObject);
                player = null;
            });
            tcp.Disconnect();
            udp.Disconnect();
        }
コード例 #20
0
ファイル: Client.cs プロジェクト: gazdimi/DKS-Server
 private void Disconnect()                                   //disconnect client and stop traffic inside the network
 {
     Debug.Log($"{tcp.socket.Client.RemoteEndPoint} with username {player.username} has disconnected from the game...");
     ThreadManager.ExecuteOnMainThread(() => {
         UnityEngine.Object.Destroy(player.gameObject);
         player = null;                                      //destroy Player object from main thread
     });
     tcp.Disconnect();
     udp.Disconnect();
     Send.DisconnectPlayer(client_id);                       //when client (local player's disconnects, inform all other connected players)
 }
コード例 #21
0
 public void Disconnect()
 {
     if (tcp.socket != null)
     {
         ThreadManager.ExecuteOnMainThread(() => {
             NetworkManager.instance.ServerDestroyPlayer(this);
         });
     }
     tcp.Disconnect();
     udp.Disconnect();
     ServerSend.DespawnPlayer(id);
 }
コード例 #22
0
    /// <summary>Disconnects the client and stops all network traffic.</summary>
    private void Disconnect()
    {
        Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

        ThreadManager.ExecuteOnMainThread(() =>
        {
            //player = null;
        });

        connected = false;
        tcp.Disconnect();
        udp.Disconnect();
    }
コード例 #23
0
        public void Disconnect()
        {
            if (isConnected)
            {
                isConnected = false;
                udp.Disconnect();
                tcp.Disconnect();

                match.Disconnect();

                Debug.Log("Disconnected from server.");
            }
        }
コード例 #24
0
    void Disconnect()
    {
        Console.WriteLine($"{tcp.socket.Client.RemoteEndPoint} has diconnected.");

        player = null;

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

        ServerSend.KickPlayer(id, "You were kicked");

        GameLogic.CheckGameState();
    }
コード例 #25
0
    /// <summary>Disconnects the client and stops all network traffic.</summary>
    private void Disconnect()
    {
        Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

        ThreadManager.ExecuteOnMainThread(() =>
        {
            GameManager.Get.RemovePlayer(id);
        });

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

        PacketSender.PlayerDisconnected(id);
    }
コード例 #26
0
    private void Disconnect()
    {
        Console.WriteLine($"{Tcp.Socket.Client.RemoteEndPoint} has disconnected.");
        ThreadManager.ExecuteOnMainThread(() =>
        {
            UnityEngine.Object.Destroy(Player.gameObject);
            Player = null;
        });

        Tcp.Disconnect();
        Udp.Disconnect();

        ServerSend.PlayerDisconnected(Id);
    }
コード例 #27
0
    private void Disconnect()
    {
        Debug.Log(tcp.socket.Client.RemoteEndPoint + " has disconnected");

        ThreadManager.ExecuteOnMainThread(() =>
        {
            NetworkManager.instance.InventoryControl.RemovePlayer(player);
            player.Disconnect();
            player = null;
        });

        tcp.Disconnect();
        udp.Disconnect();
        ServerSend.PlayerDisconnected(id);
    }
コード例 #28
0
    public void Disconnect()
    {
        Debug.Log($"{tcp.socket.Client.RemoteEndPoint} se ha desconectado");

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

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

        ServerSend.PlayerDisconnected(id);
    }
コード例 #29
0
    /// <summary>Disconnects the client and stops all network traffic.</summary>
    private void Disconnect()
    {
        Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");
        //Debug.Log(Environment.StackTrace);
        ServerSend.PlayerDisconnect(id, cursor);
        NetworkManager.instance.Disconnect(id);
        ThreadManager.ExecuteOnMainThread(() =>
        {
            UnityEngine.Object.Destroy(cursor.gameObject);
            cursor = null;
        });

        tcp.Disconnect();
        udp.Disconnect();
    }
コード例 #30
0
ファイル: Client.cs プロジェクト: RGSMTHLS/UnityScripts
    private void Disconnect()
    {
        Debug.Log($"{tcp.socket.Client.RemoteEndPoint}, also known as {player.username} has disconnected.");

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

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

        ServerSend.PlayerDisconnected(id);
    }