Esempio n. 1
0
 // Token: 0x06005723 RID: 22307 RVA: 0x001E0504 File Offset: 0x001DE904
 public new static void Register(string username, string email, string password, string birthday, Action <APIUser> successCallback = null, Action <string> errorCallback = null)
 {
     APIUser.Register(username, email, password, birthday, delegate(APIUser apiUser)
     {
         ApiCredentials.SetUser(username, password);
         User.SetNetworkProperties();
         if (successCallback != null)
         {
             successCallback(apiUser);
         }
     }, errorCallback);
 }
Esempio n. 2
0
        private static void SignIn(bool explicitAttempt)
        {
            lock (syncObject)
            {
                if (signingIn ||
                    APIUser.IsLoggedInWithCredentials ||
                    (!explicitAttempt && string.IsNullOrEmpty(storedUsername)) ||
                    (!explicitAttempt && string.IsNullOrEmpty(storedPassword)))
                {
                    return;
                }

                signingIn = true;
            }

            Init();

            ApiCredentials.Clear();
            ApiCredentials.SetUser(username, password);
            APIUser.Login(
                delegate(APIUser user)
            {
                signingIn      = false;
                error          = null;
                storedUsername = username;
                storedPassword = password;
                AnalyticsSDK.LoggedInUserChanged(user);

                if (!APIUser.CurrentUser.canPublishAllContent)
                {
                    if (UnityEditor.SessionState.GetString("HasShownContentPublishPermissionsDialogForUser", "") != user.id)
                    {
                        UnityEditor.SessionState.SetString("HasShownContentPublishPermissionsDialogForUser", user.id);
                        VRC_SdkControlPanel.ShowContentPublishPermissionsDialog();
                    }
                }

                refreshWindow = true;
            },
                delegate(string message)
            {
                signingIn      = false;
                storedUsername = null;
                storedPassword = null;
                error          = message;
                VRC.Tools.ClearCookies();
                APIUser.Logout();
                refreshWindow = true;
                VRC.Core.Logger.Log("Error logging in: " + message);
            }
                );
        }
Esempio n. 3
0
 // Token: 0x06005725 RID: 22309 RVA: 0x001E0584 File Offset: 0x001DE984
 public static void Login(string usernameOrEmail, string password, Action <APIUser> successCallback = null, Action <string> errorCallback = null)
 {
     ApiCredentials.SetUser(usernameOrEmail, password);
     APIUser.Login(delegate(APIUser user)
     {
         User.mCurrentNonApiUser = new User();
         User.mCurrentNonApiUser.Init(user);
         User.SetNetworkProperties();
         if (successCallback != null)
         {
             successCallback(user);
         }
     }, errorCallback);
 }
Esempio n. 4
0
        private static void SignIn(bool explicitAttempt)
        {
            lock (syncObject)
            {
                if (signingIn ||
                    APIUser.IsLoggedInWithCredentials ||
                    (!explicitAttempt && string.IsNullOrEmpty(storedUsername)) ||
                    (!explicitAttempt && string.IsNullOrEmpty(storedPassword)))
                {
                    return;
                }

                signingIn = true;
            }

            Init();

            ApiCredentials.Clear();
            ApiCredentials.SetUser(username, password);
            APIUser.Login(
                delegate(APIUser user)
            {
                signingIn      = false;
                error          = null;
                storedUsername = username;
                storedPassword = password;
                AnalyticsSDK.LoggedInUserChanged(user);
            },
                delegate(string message)
            {
                signingIn      = false;
                storedUsername = null;
                storedPassword = null;
                error          = message;
                APIUser.Logout();
                VRC.Core.Logger.Log("Error logging in: " + message);
            }
                );
        }