Example #1
0
        public void Disconnect()
        {
            Console.WriteLine($"{Tcp.Socket.Client.RemoteEndPoint} has disconnected.");

            Tcp.Disconnect();
            Udp.Disconnect();
        }
Example #2
0
    /// <summary>Disconnects the client and stops all network traffic.</summary>
    private void Disconnect()
    {
        TcpInstance.Disconnect();
        UdpInstance.Disconnect();

        ServerSend.PlayerDisconnected(id);
        ServerConsoleWriter.WriteLine($"Player {id} has successfully disconnected from the server");
    }
Example #3
0
    private void Disconnect()
    {
        Debug.Log($"{Tcp.Socket.Client.RemoteEndPoint} has disconnected");
        ThreadManager.ExecuteOnMainThread(DestroyPlayer);
        Tcp.Disconnect();
        Udp.Disconnect();

        ServerSend.PlayerDisconnected(Id);
    }
Example #4
0
            /// <summary>
            ///     Disconnects the client with the server.
            /// </summary>
            public void Disconnect()
            {
                if (!IsConnected())
                {
                    return;
                }

                _tcp.Disconnect();
                _udp.Disconnect();
            }
            /// <summary>
            ///     Disconnects the server from the network.
            /// </summary>
            internal void Disconnect()
            {
                if (!IsConnected)
                {
                    return;
                }

                _tcp.Disconnect();
                _udp.Disconnect();
                IsConnected = false;
            }
Example #6
0
    /// <summary>Disconnects the client and stops all network traffic.</summary>
    public void Disconnect()
    {
        Debug.Log($"{tcp.socket.Client.RemoteEndPoint} has disconnected.");

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

        if (playerManager == null)
        {
            return;
        }

        GameManager.instance.currentGameMode.OnPlayerLeave(playerManager);

        GameManager.instance.players.Remove(playerManager);

        playerManager.Disconnect();

        ServerDatabase.UpdateServer();

        playerManager = null;
    }