private void onSoftLoginFailed(IRestoreLastSessionResult result)
 {
     if (active)
     {
         rootStateMachine.SendEvent(SoftLoginFailEvent);
     }
 }
Пример #2
0
 private void onSoftLoginFailed(IRestoreLastSessionResult result)
 {
     if (base.IsInHandledState)
     {
         removeListeners();
         if (!Service.Get <GameSettings>().FirstSession)
         {
             Service.Get <ICPSwrveService>().StartTimer("GetInTheGame", "home_to_world.login");
             gameStateController.ShowAccountSystemLogin();
         }
         else
         {
             Service.Get <ICPSwrveService>().StartTimer("GetInTheGame", "home_to_world.create");
             gameStateController.ShowAccountSystemCreate();
         }
     }
 }
Пример #3
0
 private void HandleRefreshSuccess(Action <IRestoreLastSessionResult> callback, GuestControllerResult <RefreshResponse> result, SessionDocument lastSessionDoc)
 {
     try
     {
         GuestApiErrorCollection   error2 = result.Response.error;
         RefreshData               data   = result.Response.data;
         IRestoreLastSessionResult error  = GuestControllerErrorParser.GetRestoreLastSessionResult(error2);
         if (data == null && error != null)
         {
             if (error is IRestoreLastSessionFailedInvalidOrExpiredTokenResult && lastSessionDoc.AccountStatus == "AWAIT_PARENT_CONSENT")
             {
                 callback(new RestoreLastSessionFailedParentalConsentResult());
             }
             else
             {
                 callback(error);
             }
             return;
         }
         if (data == null)
         {
             if (error2 != null)
             {
                 logger.Critical("Received unhandled error exception:\n" + JsonParser.ToJson(error2) + "\nResponse headers:\n" + string.Join("\n", result.ResponseHeaders.Select((KeyValuePair <string, string> h) => h.Key + ": " + h.Value).ToArray()));
             }
             callback(new RestoreLastSessionResult(success: false, null));
             return;
         }
         if (!ValidateRefreshData(data))
         {
             logger.Critical("Error parsing the refresh data: " + JsonParser.ToJson(data));
             callback(new RestoreLastSessionResult(success: false, null));
             return;
         }
         Token token = data.token;
         lastSessionDoc.GuestControllerAccessToken = token.access_token;
         lastSessionDoc.GuestControllerEtag        = data.etag;
         database.UpdateGuestControllerToken(token, data.etag);
         try
         {
             IInternalSession session = sessionFactory.Create(lastSessionDoc.Swid);
             session.Resume(delegate(IResumeSessionResult r)
             {
                 HandleOfflineSessionResumed(r, session, error, callback);
             });
         }
         catch (Exception ex)
         {
             logger.Critical("Error creating session: " + ex);
             callback(new RestoreLastSessionResult(success: false, null));
         }
     }
     catch (CorruptionException ex2)
     {
         logger.Fatal("Corruption detected during session restoration: " + ex2);
         callback(new RestoreLastSessionCorruptionDetectedResult());
     }
     catch (Exception ex)
     {
         logger.Critical("Unhandled exception: " + ex);
         callback(new RestoreLastSessionResult(success: false, null));
     }
 }
Пример #4
0
 private static void HandleOfflineSessionResumed(IResumeSessionResult result, ISession session, IRestoreLastSessionResult error, Action <IRestoreLastSessionResult> callback)
 {
     if (!result.Success)
     {
         callback(new RestoreLastSessionResult(success: false, null));
     }
     else if (error is IRestoreLastSessionSuccessMissingInfoResult)
     {
         callback(new RestoreLastSessionSuccessMissingInfoResult(success: true, session));
     }
     else if (error is IRestoreLastSessionSuccessRequiresLegalMarketingUpdateResult)
     {
         callback(new RestoreLastSessionSuccessRequiresLegalMarketingUpdateResult(success: true, session));
     }
     else
     {
         callback(new RestoreLastSessionResult(success: true, session));
     }
 }
Пример #5
0
 private void onSoftLoginFailed(IRestoreLastSessionResult obj)
 {
     Service.Get <ICPSwrveService>().EndTimer("softlogintimer", null, null, "fail");
 }
Пример #6
0
 private void onSoftLoginFailed(IRestoreLastSessionResult result)
 {
     CurrentUsername = string.Empty;
 }
Пример #7
0
 protected void onSoftLoginFailed(IRestoreLastSessionResult value)
 {
     this.OnSoftLoginFailed.InvokeSafe(value);
 }