Exemplo n.º 1
0
    void InitNetwork()
    {
        WSServerState.Reset();

        if (DebugStandalone)
        {
            WSServer.Stop();
            WSServerState.Reset();
            WSClient.Disconnect();
            WSClientState.Reset();
            WSServer.StartFake();
            WSClient.ConnectFake();
        }
        else if (IsClient)
        {
            WSServer.Stop();
            WSServerState.Reset();
            WSClient.Connect();
        }
        else
        {
            WSClient.Disconnect();
            WSClientState.Reset();
            if (!WSServer.IsRunning)
            {
                WSServer.Start();
            }
        }
    }
Exemplo n.º 2
0
 void OnApplicationQuit()
 {
     WSServer.Stop();
     WSClient.Disconnect();
 }
Exemplo n.º 3
0
		private void OnDestroy()
		{
			if (TCPClientState.Connected) tcpClient.Disconnect();
			if (UDPClientState.Connected) udpClient.Disconnect();
			if (WSClientState.Connected) wsClient.Disconnect();
		}