Пример #1
0
        public static MojangAuthentication getInstance()
        {
            if (instance == null)
            {
                instance = new MojangAuthentication();
            }

            return(instance);
        }
        private async void LogInConfirmButton_Click(object sender, EventArgs e)
        {
            ConsoleLog.WriteLine("Log in pressed");
            LogInConfirmButton.Enabled = false;
            LogInConfirmButton.Text    = "logging in";
            await MojangAuthentication.getInstance().GetAuthenticationResponse(new AuthenticationPayload(UsernameInput.Text, PasswordInput.Text));

            ConsoleLog.WriteLine("Response received");
            LogInConfirmButton.Enabled = true;
            LogInConfirmButton.Text    = "log in";
        }