Ejemplo n.º 1
0
        private bool Login()
        {
            if (Settings.RememberMe)
            {
                Settings.Username = txtUsername.Text;
                Settings.Password = txtPassword.Text;
            }
            else
            {
                Settings.Username = "";
                Settings.Password = "";
            }

            try
            {
                GlobalLoginSystemAuthenticationService authSvc = new GlobalLoginSystemAuthenticationService();
                UserProfile profile = authSvc.LoginAccount(txtUsername.Text, txtPassword.Text, null);
                subs             = profile.Subscriptions.Where(s => s.Game == Settings.Game).ToList();
                cbSub.DataSource = subs;
                ticket           = profile.Ticket;

                if (!string.IsNullOrEmpty(Settings.DefaultSubscription))
                {
                    cbSub.SelectedIndex = cbSub.FindStringExact(Settings.DefaultSubscription);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return(false);
            }

            btnPlay.Enabled = true;
            return(true);
        }
Ejemplo n.º 2
0
        public LoginResults(string username, string password, LauncherData launcherData)
        {
            this.launcherData = launcherData;
            GlobalLoginSystemAuthenticationService authSvc = new GlobalLoginSystemAuthenticationService();

            authSvc.Url = launcherData.DataCenter.AuthServer;
            UserProfile profile = authSvc.LoginAccount(username, password, null);

            subscriptions    = profile.Subscriptions.Where(s => s.Game == launcherData.GameName).ToList();
            this.loginTicket = profile.Ticket;
        }