예제 #1
0
파일: Client.cs 프로젝트: TheSwerik/Swerver
        public void Disconnect()
        {
            Console.WriteLine($"{Tcp.Socket.Client.RemoteEndPoint} has disconnected.");

            Tcp.Disconnect();
            Udp.Disconnect();
        }
예제 #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");
    }
예제 #3
0
파일: Client.cs 프로젝트: OmerCD/WitchCraft
    private void Disconnect()
    {
        Debug.Log($"{Tcp.Socket.Client.RemoteEndPoint} has disconnected");
        ThreadManager.ExecuteOnMainThread(DestroyPlayer);
        Tcp.Disconnect();
        Udp.Disconnect();

        ServerSend.PlayerDisconnected(Id);
    }
예제 #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;
            }
예제 #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;
    }