Example #1
0
        private IEnumerator delayLogoutLastSession(AsynchOnFinishedManifold asynchOnFinishedManifold)
        {
            yield return(null);

            PlayerPrefs.DeleteKey("ol.lastLoginUserName");
            asynchOnFinishedManifold?.AsynchFinished();
        }
Example #2
0
    public virtual void LogoutLastSession(AsynchOnFinishedManifold asynchOnFinishedManifold = null)
    {
        if (NetworkConfigIsNotSet)
        {
            throw new NullReferenceException("NetworkServicesConfig not set");
        }
        string languageString = Service.Get <Localizer>().LanguageString;

        if (asynchOnFinishedManifold != null)
        {
            asynchOnFinishedManifold.AsynchStart();
        }
        sessionStarter.OfflineLastSession(config.GuestControllerHostUrl, SpoofedGeoIP, config.MixAPIHostUrl, config.DisneyIdClientId, config.MixClientToken, config.ClientVersion, coroutineManager, keychainData, logger, storageDir, languageString, delegate(IOfflineLastSessionResult result)
        {
            try
            {
                if (result.Success && result.Session != null)
                {
                    result.Session.LogOut(delegate
                    {
                        LogoutLastSession(asynchOnFinishedManifold);
                    });
                }
            }
            finally
            {
                if (asynchOnFinishedManifold != null)
                {
                    asynchOnFinishedManifold.AsynchFinished();
                }
            }
        });
    }
Example #3
0
 public override void Logout(AsynchOnFinishedManifold asynchOnFinishedManifold = null)
 {
     if (mixSession != null)
     {
         IsLoggingOut = true;
         mixSession.OnAuthenticationLost -= onAuthenticationLost;
         asynchOnFinishedManifold?.AsynchStart();
         CoroutineRunner.StartPersistent(finishLogout(asynchOnFinishedManifold), this, "Finish Logout");
     }
 }
Example #4
0
        public override void LogoutLastSession(AsynchOnFinishedManifold asynchOnFinishedManifold = null)
        {
            if (NetworkConfigIsNotSet)
            {
                throw new NullReferenceException("NetworkServicesConfig not set");
            }
            string languageString = Service.Get <Localizer>().LanguageString;

            asynchOnFinishedManifold?.AsynchStart();
            CoroutineRunner.StartPersistent(delayLogoutLastSession(asynchOnFinishedManifold), this, "delayLogoutLastSession");
        }
Example #5
0
    private IEnumerator finishLogout(AsynchOnFinishedManifold asynchOnFinishedManifold)
    {
        yield return(null);

        if (!mixSession.IsDisposed)
        {
            mixSession.Dispose();
        }
        clearSession();
        IsLoggingOut = false;
        eventDispatcher.DispatchEvent(default(SessionEvents.SessionEndedEvent));
        eventDispatcher.DispatchEvent(default(SessionEvents.SessionLogoutEvent));
        asynchOnFinishedManifold?.AsynchFinished();
    }
Example #6
0
 public virtual void Logout(AsynchOnFinishedManifold asynchOnFinishedManifold = null)
 {
     if (mixSession == null)
     {
         return;
     }
     Service.Get <ICPSwrveService>().StartTimer("mixsdktimer", "log_out");
     IsLoggingOut = true;
     mixSession.OnAuthenticationLost -= onAuthenticationLost;
     if (asynchOnFinishedManifold != null)
     {
         asynchOnFinishedManifold.AsynchStart();
     }
     mixSession.LogOut(delegate(ISessionLogOutResult result)
     {
         if (result.Success)
         {
             Service.Get <ICPSwrveService>().EndTimer("mixsdktimer", null, "success");
         }
         else
         {
             Service.Get <ICPSwrveService>().EndTimer("mixsdktimer", null, "fail");
             if (!mixSession.IsDisposed)
             {
                 mixSession.Dispose();
             }
         }
         clearSession();
         IsLoggingOut = false;
         eventDispatcher.DispatchEvent(default(SessionEvents.SessionEndedEvent));
         eventDispatcher.DispatchEvent(default(SessionEvents.SessionLogoutEvent));
         TechAnalytics.LogNetworkLatency(Service.Get <INetworkServicesManager>().GameServerLatency, Service.Get <INetworkServicesManager>().WebServiceLatency);
         Service.Get <ICPSwrveService>().Action("game.logout", "success");
         if (asynchOnFinishedManifold != null)
         {
             asynchOnFinishedManifold.AsynchFinished();
         }
     });
 }
 public void Shutdown()
 {
     Service.Get <ICPSwrveService>().Action("desktop", "exit_game");
     try
     {
         AsynchOnFinishedManifold asynchOnFinishedManifold = new AsynchOnFinishedManifold(quitWhenSafe);
         asynchOnFinishedManifold.MainStart();
         if (Service.Get <SessionManager>().HasSession)
         {
             Service.Get <SessionManager>().Logout(asynchOnFinishedManifold);
         }
         else
         {
             Service.Get <RememberMeService>().ResetCurrentUsername();
             Service.Get <MixLoginCreateService>().LogoutLastSession(asynchOnFinishedManifold);
         }
         asynchOnFinishedManifold.MainFinished();
     }
     catch (Exception ex)
     {
         Log.LogException(this, ex);
         quitWhenSafe();
     }
 }