Ejemplo n.º 1
0
        public int ChangePassword(string password)
        {
            ChangeRequestData data = new ChangeRequestData(SelectedAccount.email, SelectedAccount.password, password);
            string            json = "FAILED";

            try
            {
                json = RequestHandler.RequestChangePassword(data);

                if (json != "OK")
                {
                    return(-1);
                }
            }
            catch
            {
                return(-2);
            }

            SelectedAccount.password = password;
            launcherConfig.Password  = password;
            JsonHandler.SaveLauncherConfig(launcherConfig);
            return(1);
        }
Ejemplo n.º 2
0
        public int ChangeEmail(string email)
        {
            ChangeRequestData data = new ChangeRequestData(SelectedAccount.email, SelectedAccount.password, email);
            string            json = "FAILED";

            try
            {
                json = RequestHandler.RequestChangeEmail(data);

                if (json != "OK")
                {
                    return(-1);
                }
            }
            catch
            {
                return(-2);
            }

            launcherConfig.Email  = email;
            SelectedAccount.email = email;
            JsonHandler.SaveLauncherConfig(launcherConfig);
            return(1);
        }