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(); } } }); }
private IEnumerator delayLogoutLastSession(AsynchOnFinishedManifold asynchOnFinishedManifold) { yield return(null); PlayerPrefs.DeleteKey("ol.lastLoginUserName"); asynchOnFinishedManifold?.AsynchFinished(); }
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(); }
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(); } }); }