Esempio n. 1
0
        /// <summary>
        /// This is set as a XBL Sign in callback in Start()
        /// This will invoke every time a player tries to sign in
        /// </summary>
        /// <param name="user">The XboxLiveUser that is signing in</param>
        /// <param name="status">How did the sign in go? Should be Succeeded if complete.</param>
        /// <param name="errorMessage">What went wrong if not Succeeded</param>
        private void OnXBLSignIn(XboxLiveUser user, XboxLiveAuthStatus status, string errorMessage)
        {
            try {
                signinAnim = false;
                Debug.Log("Signed in: " + status);
                if (status == XboxLiveAuthStatus.Succeeded)
                {
                    PlayerPrefs.SetInt("TeamVulcan.Assets.XBL_UI.Singleplayer.SignedInBefore", 1);
                    XBL_User     = user;
                    XBL_SignedIn = true;

                    signinButton_Text.text = signedinAsText + user.Gamertag;
                }
                else if (!XBL_SignedIn)
                {
                    signinButton_Text.text = signinToXBLText;
                }
                if (initialPrompt.enabled)
                {
                    StartCoroutine("ClosePrompt");
                }
            } catch (Exception ex) {
                Debug.LogError(ex);
            }
        }
 private void OnPlayerSignOut(XboxLiveUser xboxLiveUser, XboxLiveAuthStatus authStatus, string errorMessage)
 {
     if (authStatus == XboxLiveAuthStatus.Succeeded)
     {
         this.xboxLiveUser = null;
         this.Clear();
     }
 }
 public void OnPlayerSignIn(XboxLiveUser xboxLiveUser, XboxLiveAuthStatus signinStatus, string errorMessage)
 {
     if (signinStatus == XboxLiveAuthStatus.Succeeded)
     {
         this.xboxLiveUser = xboxLiveUser;
         this.InitializeSaveSystem();
     }
 }
Esempio n. 4
0
        private void OnPlayerSignOut(XboxLiveUser xboxLiveUser, XboxLiveAuthStatus xboxAuthStatus, string errorMessage)
        {
            if (xboxAuthStatus == XboxLiveAuthStatus.Succeeded)
            {
                this.xboxLiveUser = null;
                this.presenceFilterDropdown.value = 0;
                this.presenceFilterDropdown.RefreshShownValue();

                this.RefreshSocialGroups();
            }
        }
 private void OnPlayerSignOut(XboxLiveUser xboxLiveUser, XboxLiveAuthStatus authStatus, string errorMessage)
 {
     if (authStatus == XboxLiveAuthStatus.Succeeded)
     {
         this.xboxLiveUser = null;
         this.initializing = false;
         lock (this.logText)
         {
             this.logLines.Clear();
             this.logText = string.Empty;
         }
     }
 }
Esempio n. 6
0
 /// <summary>
 /// This is set as a XBL Sign out callback in Start()
 /// This will invoke every time a player tries to sign out
 /// </summary>
 /// <param name="user">The XboxLiveUser that is signing out</param>
 /// <param name="status">How did the sign out go? Should be Succeeded if complete.</param>
 /// <param name="errorMessage">What went wrong if not Succeeded</param>
 private void OnXBLSignOut(XboxLiveUser user, XboxLiveAuthStatus status, string errorMessage)
 {
     try {
         Debug.Log("Signed out: " + status);
         if (status == XboxLiveAuthStatus.Succeeded)
         {
             XBL_User               = null;
             XBL_SignedIn           = false;
             signinButton_Text.text = signinToXBLText;
         }
     } catch (Exception ex) {
         Debug.LogError(ex);
     }
 }
 private void OnPlayerSignOut(XboxLiveUser xboxLiveUserParam, XboxLiveAuthStatus authStatus, string errorMessage)
 {
     if (authStatus == XboxLiveAuthStatus.Succeeded)
     {
         _xboxLiveUser = null;
         signedIn      = false;
     }
     else
     {
         if (XboxLiveServicesSettings.Instance.DebugLogsOn)
         {
             Debug.LogError(errorMessage);
         }
     }
 }
 private void OnPlayerSignIn(XboxLiveUser xboxLiveUserParam, XboxLiveAuthStatus authStatus, string errorMessage)
 {
     if (authStatus == XboxLiveAuthStatus.Succeeded)
     {
         _xboxLiveUser = xboxLiveUserParam; //store the xboxLiveUser SignedIn
         signedIn      = true;
     }
     else
     {
         if (XboxLiveServicesSettings.Instance.DebugLogsOn)
         {
             Debug.LogError(errorMessage); //Log the error message in case of unsuccessful call.
         }
     }
 }
 private void OnPlayerSignOut(XboxLiveUser xboxLiveUser, XboxLiveAuthStatus authStatus, string errorMessage)
 {
     if (authStatus == XboxLiveAuthStatus.Succeeded)
     {
         this.xboxLiveUser = null;
         this.Clear();
     }
     else
     {
         if (XboxLiveServicesSettings.Instance.DebugLogsOn)
         {
             Debug.LogError(errorMessage);
         }
     }
 }
Esempio n. 10
0
 private void OnPlayerSignIn(XboxLiveUser xboxLiveUser, XboxLiveAuthStatus authStatus, string errorMessage)
 {
     if (authStatus == XboxLiveAuthStatus.Succeeded && xboxLiveUser != null)
     {
         this.xboxLiveUser = xboxLiveUser;
     }
     else
     {
         if (XboxLiveServicesSettings.Instance.DebugLogsOn)
         {
             Debug.LogError(errorMessage);
         }
         this.signInPanel.GetComponentInChildren <Button>().interactable = true;
         this.AllowSignInAttempt = true;
     }
 }
Esempio n. 11
0
 private void OnPlayerSignIn(XboxLiveUser xboxLiveUser, XboxLiveAuthStatus authStatus, string errorMessage)
 {
     if (authStatus == XboxLiveAuthStatus.Succeeded && xboxLiveUser != null)
     {
         this.xboxLiveUser = xboxLiveUser;
     }
     else
     {
         ExceptionManager.Instance.ThrowException(
             ExceptionSource.PlayerAuthentication,
             ExceptionType.SignInFailed,
             new Exception(errorMessage));
         this.signInPanel.GetComponentInChildren <Button>().interactable = true;
         this.AllowSignInAttempt = true;
     }
 }
Esempio n. 12
0
 private void OnPlayerSignIn(XboxLiveUser xboxLiveUser, XboxLiveAuthStatus authStatus, string errorMessage)
 {
     if (authStatus == XboxLiveAuthStatus.Succeeded && xboxLiveUser != null)
     {
         this.xboxLiveUser = xboxLiveUser;
     }
     else
     {
         if (authStatus != XboxLiveAuthStatus.Canceled)
         {
             ExceptionManager.Instance.ThrowException(
                 ExceptionSource.PlayerAuthentication,
                 ExceptionType.SignInFailed,
                 new Exception(errorMessage));
         }
     }
     this.ExecuteOnMainThread.Enqueue(Refresh);
 }
Esempio n. 13
0
        private void OnPlayerSignOut(XboxLiveUser xboxLiveUser, XboxLiveAuthStatus xboxAuthStatus, string errorMessage)
        {
            if (xboxAuthStatus == XboxLiveAuthStatus.Succeeded)
            {
                this.xboxLiveUser = null;
                this.presenceFilterDropdown.value = 0;
                this.presenceFilterDropdown.RefreshShownValue();

                this.RefreshSocialGroups();
            }
            else
            {
                if (XboxLiveServicesSettings.Instance.DebugLogsOn)
                {
                    Debug.LogError(errorMessage);
                }
            }
        }
 /// <summary>
 /// Notifies all callbacks about changes in status
 /// </summary>
 /// <param name="callbackList">A list of the UnityAction callbacks</param>
 /// <param name="xboxLiveUser">The Xbox Live User</param>
 /// <param name="authStatus">The Xbox Live Authentication Status</param>
 /// <param name="errorMessage">the Error Message</param>
 private void NotifyAllCallbacks(
     int playerNumber,
     XboxLiveUser xboxLiveUser,
     XboxLiveAuthStatus authStatus,
     string errorMessage,
     bool signIn = true)
 {
     if (CurrentPlayers.ContainsKey(playerNumber))
     {
         List <UnityAction <XboxLiveUser, XboxLiveAuthStatus, string> > callbackList = null;
         if (signIn)
         {
             callbackList = CurrentPlayers[playerNumber].SignInCallbacks;
         }
         else
         {
             callbackList = CurrentPlayers[playerNumber].SignOutCallbacks;
         }
         foreach (var callback in callbackList)
         {
             callback(xboxLiveUser, authStatus, errorMessage);
         }
     }
 }