示例#1
0
 private void PopulateUser(uint authGeneration, GooglePlayGames.Native.PInvoke.PlayerManager.FetchSelfResponse response)
 {
     Logger.d("Populating User");
     if (authGeneration != mAuthGeneration)
     {
         Logger.d("Received user callback after signout occurred, ignoring");
     }
     else
     {
         lock (AuthStateLock)
         {
             if (response.Status() != CommonErrorStatus.ResponseStatus.VALID && response.Status() != CommonErrorStatus.ResponseStatus.VALID_BUT_STALE)
             {
                 Logger.e("Error retrieving user, signing out");
                 Action <bool, string> action = mPendingAuthCallbacks;
                 mPendingAuthCallbacks = null;
                 if (action != null)
                 {
                     InvokeCallbackOnGameThread(action, false, "Cannot load user profile");
                 }
                 SignOut();
                 return;
             }
             mUser    = response.Self().AsPlayer();
             mFriends = null;
         }
         Logger.d("Found User: "******"Maybe finish for User");
         MaybeFinishAuthentication();
     }
 }
示例#2
0
 private void PopulateUser(uint authGeneration, GooglePlayGames.Native.PInvoke.PlayerManager.FetchSelfResponse response)
 {
     Logger.d("Populating User");
     if ((int)authGeneration != (int)this.mAuthGeneration)
     {
         Logger.d("Received user callback after signout occurred, ignoring");
     }
     else
     {
         lock (this.AuthStateLock)
         {
             if (response.Status() != CommonErrorStatus.ResponseStatus.VALID && response.Status() != CommonErrorStatus.ResponseStatus.VALID_BUT_STALE)
             {
                 Logger.e("Error retrieving user, signing out");
                 Action <bool> pendingAuthCallbacks = this.mPendingAuthCallbacks;
                 this.mPendingAuthCallbacks = (Action <bool>)null;
                 if (pendingAuthCallbacks != null)
                 {
                     NativeClient.InvokeCallbackOnGameThread <bool>(pendingAuthCallbacks, false);
                 }
                 this.SignOut();
                 return;
             }
             this.mUser    = response.Self().AsPlayer();
             this.mFriends = (List <GooglePlayGames.BasicApi.Multiplayer.Player>)null;
         }
         Logger.d("Found User: "******"Maybe finish for User");
         this.MaybeFinishAuthentication();
     }
 }