Beispiel #1
0
        private void btn_Connect_Click(object sender, EventArgs e)
        {
            _Username = txt_Username.Text;
            if (_Username.Contains(" "))
            {
                _Username = _Username.Replace(' ', '_');
            }

            _Password = txt_IRCpass.Text;

            SaveSettings();

            if (txt_APIkey.Text != "" || txt_IRCpass.Text != "" || txt_Username.Text != "")
            {
                if (validate(txt_Username.Text, txt_APIkey.Text) == "correct")
                {

                   try{
                        banchochat = new Bancho();

                        banchochat.start();

                        btn_Connect.Enabled = false;

                        timer1.Enabled = true;

                        connected = true;

                    }
                    catch
                    {
                        btn_Connect.Enabled = true;
                        timer1.Enabled = false;
                        connected = false;
                    }
                }
                else if (validate(txt_Username.Text, txt_APIkey.Text) == "wrongU")
                {
                    MessageBox.Show("Please make sure you entered the right username!", "Notification!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else if (validate(txt_Username.Text, txt_APIkey.Text) == "wrongAPI")
                {
                    MessageBox.Show("Please make sure you entered the right API Key!", "Notification!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
            else
            {
                MessageBox.Show("Please enter your credentials!", "Notification!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }
Beispiel #2
0
        private void btn_Connect_Click(object sender, EventArgs e)
        {
            _Username = txt_Username.Text;
            if (_Username.Contains(" "))
            {
                _Username = _Username.Replace(' ', '_');
            }

            _Password = txt_IRCpass.Text;

            SaveSettings();

            if (txt_APIkey.Text != "" || txt_IRCpass.Text != "" || txt_Username.Text != "")
            {
                if (validate(txt_Username.Text, txt_APIkey.Text) == "correct")
                {
                    try{
                        banchochat = new Bancho();

                        banchochat.start();

                        btn_Connect.Enabled = false;

                        timer1.Enabled = true;

                        connected = true;
                    }
                    catch
                    {
                        btn_Connect.Enabled = true;
                        timer1.Enabled      = false;
                        connected           = false;
                    }
                }
                else if (validate(txt_Username.Text, txt_APIkey.Text) == "wrongU")
                {
                    MessageBox.Show("Please make sure you entered the right username!", "Notification!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
                else if (validate(txt_Username.Text, txt_APIkey.Text) == "wrongAPI")
                {
                    MessageBox.Show("Please make sure you entered the right API Key!", "Notification!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                }
            }
            else
            {
                MessageBox.Show("Please enter your credentials!", "Notification!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
        }