コード例 #1
0
        private static void OnRegisterClicked()
        {
            if (_userPass != _userPass2)
            {
                Debug.LogError("PlayFab developer account passwords must match.");
                return;
            }

            PlayFabEditorApi.RegisterAccouint(new RegisterAccountRequest()
            {
                DeveloperToolProductName    = PlayFabEditorHelper.EDEX_NAME,
                DeveloperToolProductVersion = PlayFabEditorHelper.EDEX_VERSION,
                Email      = _userEmail,
                Password   = _userPass,
                StudioName = _studio
            }, (result) =>
            {
                PlayFabEditorDataService.AccountDetails.devToken = result.DeveloperClientToken;
                PlayFabEditorDataService.AccountDetails.email    = _userEmail;

                PlayFabEditorDataService.RefreshStudiosList();

                PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogin);
                PlayFabEditorDataService.SaveAccountDetails();
                PlayFabEditorMenu._menuState = PlayFabEditorMenu.MenuStates.Sdks;
            }, PlayFabEditorHelper.SharedErrorCallback);
        }
コード例 #2
0
 private static void OnLoginButtonClicked()
 {
     PlayFabEditorApi.Login(new LoginRequest()
     {
         DeveloperToolProductName    = PlayFabEditorHelper.EDEX_NAME,
         DeveloperToolProductVersion = PlayFabEditorHelper.EDEX_VERSION,
         Email    = _userEmail,
         Password = _userPass
     }, (result) =>
     {
         PlayFabEditorDataService.AccountDetails.devToken = result.DeveloperClientToken;
         PlayFabEditorDataService.AccountDetails.email    = _userEmail;
         PlayFabEditorDataService.RefreshStudiosList();
         PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogin);
         PlayFabEditorDataService.SaveAccountDetails();
         PlayFabEditorMenu._menuState = PlayFabEditorMenu.MenuStates.Sdks;
     }, (error) =>
     {
         if ((int)error.Error == 1246 || error.ErrorMessage.Contains("TwoFactor"))
         {
             // pop 2FA dialog
             PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnWarning, "This account requires 2-Factor Authentication.");
             activeState = PanelDisplayStates.TwoFactorPrompt;
         }
         else
         {
             PlayFabEditorHelper.SharedErrorCallback(error);
         }
     });
 }
コード例 #3
0
 private static void OnContinueButtonClicked()
 {
     PlayFabEditorApi.Login(new LoginRequest()
     {
         DeveloperToolProductName    = PlayFabEditorHelper.EDEX_NAME,
         DeveloperToolProductVersion = PlayFabEditorHelper.EDEX_VERSION,
         TwoFactorAuth = _2FaCode,
         Email         = _userEmail,
         Password      = _userPass
     }, (result) =>
     {
         PlayFabEditorDataService.AccountDetails.devToken = result.DeveloperClientToken;
         PlayFabEditorDataService.AccountDetails.email    = _userEmail;
         PlayFabEditorDataService.RefreshStudiosList();
         PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogin);
         PlayFabEditorDataService.SaveAccountDetails();
         PlayFabEditorMenu._menuState = PlayFabEditorMenu.MenuStates.Sdks;
     }, PlayFabEditorHelper.SharedErrorCallback);
 }
コード例 #4
0
        public static void Logout()
        {
            PlayFabEditor.RaiseStateUpdate(PlayFabEditor.EdExStates.OnLogout);

            PlayFabEditorApi.Logout(new LogoutRequest
            {
                DeveloperClientToken = PlayFabEditorDataService.AccountDetails.devToken
            }, null, PlayFabEditorHelper.SharedErrorCallback);

            _userPass  = string.Empty;
            _userPass2 = string.Empty;

            activeState = PanelDisplayStates.Login;

            PlayFabEditorDataService.AccountDetails.studios  = null;
            PlayFabEditorDataService.AccountDetails.devToken = string.Empty;
            PlayFabEditorDataService.SaveAccountDetails();

            PlayFabEditorDataService.EnvDetails.titleData.Clear();
            PlayFabEditorDataService.SaveEnvDetails();
        }