Ejemplo n.º 1
0
    IEnumerator CheckForConnectionsOrClose()
    {
        yield return(new WaitForSeconds(UnityNetworkingData.MaxWaitForConnectSeconds));

        if (UnityNetworkingData.ConnectedClients == 0)
        {
            Logger.Dispatch(LoggerTypes.Info, "No Connections were made, shutting down.");
            ShutDownSignal.Dispatch();
        }
    }
Ejemplo n.º 2
0
 // called when a network error occurs
 public void OnServerError(NetworkMessage netMsg)
 {
     try
     {
         var error = netMsg.ReadMessage <ErrorMessage>();
         if (error != null)
         {
             Logger.Dispatch(LoggerTypes.Info,
                             string.Format("Unity Network Connection Status: code - {0}", error.errorCode));
         }
     }
     catch (Exception)
     {
         Logger.Dispatch(LoggerTypes.Info, "Unity Network Connection Status, but we could not get the reason, check the Unity Logs for more info.");
     }
     ShutDownSignal.Dispatch();
 }