public void Disconnect() { Console.WriteLine($"{Tcp.Socket.Client.RemoteEndPoint} has disconnected."); Tcp.Disconnect(); Udp.Disconnect(); }
/// <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"); }
private void Disconnect() { Debug.Log($"{Tcp.Socket.Client.RemoteEndPoint} has disconnected"); ThreadManager.ExecuteOnMainThread(DestroyPlayer); Tcp.Disconnect(); Udp.Disconnect(); ServerSend.PlayerDisconnected(Id); }
/// <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; }
/// <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; }