예제 #1
0
        private void LoginTile_Click(object sender, EventArgs e)
        {
            if (UsernameTextBox.Text.Length < 4 || PasswordTextBox.Text.Length < 4)
            {
                return;
            }

            LoginTile.Enabled       = false;
            UsernameTextBox.Enabled = false;
            PasswordTextBox.Enabled = false;

            string authenticationToken = NetworkUtil.GetAuthenticationToken(UsernameTextBox.Text, PasswordTextBox.Text);

            if (authenticationToken == null)
            {
                LoginTile.Enabled       = true;
                UsernameTextBox.Enabled = true;
                PasswordTextBox.Enabled = true;

                Notify("The username or password is incorrect.");
                return;
            }

            MapleConnection.Instance.Send(LoginPacket.Login(PasswordTextBox.Text, authenticationToken));
        }