Esempio n. 1
0
 private IEnumerator processMessagesCoroutine()
 {
     while (true)
     {
         if (mt.TriggerForceTeardownAfterDelay)
         {
             CoroutineRunner.Start(forceTeardownAfterDelay(mt.smartFoxRef, 5), this, "forceTeardownAfterDelay");
             mt.TriggerForceTeardownAfterDelay = false;
         }
         if (mt.TriggerInitCrypto)
         {
             CoroutineRunner.Start(mt.InitCrypto(), this, "InitCrypto");
             mt.TriggerInitCrypto = false;
         }
         if (mt.TryGetServerTimeUpdate(out var serverTime))
         {
             lastServerTime = serverTime;
             clientTimer.Reset();
             clientTimer.Start();
         }
         try
         {
             processEvents();
         }
         catch (Exception ex)
         {
             Log.LogError(this, "Catching error in the smartfox event processing loop, so networking doesn't stop: " + ex.Message);
             Log.LogException(this, ex);
         }
         yield return(null);
     }
 }