Пример #1
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            if (validatePassword())
            {
                ServerData sData = new ServerData();

                try
                {
                    string commandString = "setpass " + accountComboBox1.SelectedItem + " " + textPassword.Text + " " + textValidatePassword.Text;
                    ManguiMain.mangosProcess.StandardInput.WriteLine(commandString);

                    ConfigAccess.updateLog(commandString);

                    MessageBox.Show(string.Format(Resources.hcStringResources.Global_CommandSuccesful, commandString));
                    this.Close();
                }
                catch
                {
                    MessageBox.Show(Resources.hcStringResources.Global_CommandError);
                }
            }
            else
            {
                MessageBox.Show("Passwords do not match or have not been entered.");
            }
        }
Пример #2
0
        private void buttonTeleport_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(textCharacterName.Text))
            {
                try
                {
                    ServerData sData = new ServerData();

                    if (sData.checkCharacterExists(textCharacterName.Text))
                    {
                        string commandString = "tele " + textCharacterName.Text + " " + comboLocations.Text;
                        ManguiMain.mangosProcess.StandardInput.WriteLine(commandString);

                        ConfigAccess.updateLog(commandString);

                        MessageBox.Show(string.Format(Resources.hcStringResources.Global_CommandSuccesful, commandString));
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show(string.Format(Resources.hcStringResources.teleChar_BadCharacterName, textCharacterName.Text));
                    }
                }
                catch
                {
                    MessageBox.Show(Resources.hcStringResources.Global_CommandError);
                }
            }
            else
            {
                MessageBox.Show(Resources.hcStringResources.teleChar_PleaseEnterCharacterToTeleport );
            }
        }
Пример #3
0
        private void buttonSendMessage_Click(object sender, EventArgs e)
        {
            try
            {
                if (!String.IsNullOrEmpty(textCharacterName.Text))
                {
                    ServerData sData = new ServerData();

                    if (sData.checkCharacterExists(textCharacterName.Text))
                    {
                        string commandString = "send message " + textCharacterName.Text + " " + textMessage.Text;
                        ManguiMain.mangosProcess.StandardInput.WriteLine(commandString);

                        ConfigAccess.updateLog(commandString);

                        MessageBox.Show(string.Format(hcStringResources.Global_CommandSuccesful, commandString));
                        this.Close();
                    }
                    else
                    {
                        MessageBox.Show(hcStringResources.sendMessage_CharacterDoesntExist);
                    }
                }
                else
                {
                    MessageBox.Show(hcStringResources.sendMeassage_EnterCharacter);
                }
            }
            catch
            {
                MessageBox.Show(hcStringResources.Global_CommandError);
            }
        }
Пример #4
0
        public listGM()
        {
            InitializeComponent();

            ServerData sData = new ServerData();
            DataTable gmList = sData.getGM();

            dataGMList.ReadOnly = true;
            dataGMList.AllowUserToAddRows = false;
            dataGMList.AllowUserToDeleteRows = false;
            dataGMList.DataSource = gmList;
        }
Пример #5
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                string bcLevel = null;

                if (comboBC.Text == Resources.hcStringResources.setexp_wotlk)
                    bcLevel = "2";

                if (comboBC.Text == Resources.hcStringResources.setexp_bc)
                    bcLevel = "1"
                        ;
                if (comboBC.Text == Resources.hcStringResources.setexp_classic)
                    bcLevel = "0";

                if (!String.IsNullOrEmpty(accountComboBox1.Text))
                {
                    if (!String.IsNullOrEmpty(bcLevel))
                    {
                        ServerData sData = new ServerData();

                        if (sData.checkAccountExists(accountComboBox1.Text))
                        {
                            string commandString = "account set addon " + accountComboBox1.Text + " " + bcLevel;
                            ManguiMain.mangosProcess.StandardInput.WriteLine(commandString);

                            ConfigAccess.updateLog(commandString);

                            MessageBox.Show(string.Format(Resources.hcStringResources.Global_CommandSuccesful, commandString));
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show(Resources.hcStringResources.setBC_AccountUnknown);
                        }
                    }
                    else
                    {
                        MessageBox.Show(Resources.hcStringResources.setBC_ChooseAction);
                    }
                }
                else
                {
                    MessageBox.Show(Resources.hcStringResources.setBC_EnterAccount);
                }
            }
            catch
            {
                MessageBox.Show(Resources.hcStringResources.Global_CommandError);
            }
        }
Пример #6
0
        public listBans()
        {
            InitializeComponent();

            ServerData sData = new ServerData();
            DataTable bans = sData.getBans();

            dataBanList.ReadOnly = true;
            dataBanList.AllowUserToAddRows = false;
            dataBanList.AllowUserToDeleteRows = false;
            dataBanList.DataSource = bans;

            setColumnWidth();
        }
Пример #7
0
        private void buttonCreate_Click(object sender, EventArgs e)
        {
            ServerData sData = new ServerData();

            if (sData.checkAccountExists(textAccountName.Text) == false)
            {
                try
                {
                    if (!String.IsNullOrEmpty(textAccountName.Text))
                    {
                        if (!String.IsNullOrEmpty(textPassword.Text))
                        {
                            string commandString = "account create " + textAccountName.Text + " " + textPassword.Text;
                            ManguiMain.mangosProcess.StandardInput.WriteLine(commandString);

                            ConfigAccess.updateLog(commandString);

                            MessageBox.Show(string.Format(Resources.hcStringResources.Global_CommandSuccesful, commandString));
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show(Resources.hcStringResources.createAccount_EnterPassword);
                        }
                    }
                    else
                    {
                        MessageBox.Show(Resources.hcStringResources.createAccount_EnterAccountName);
                    }
                }
                catch
                {
                    MessageBox.Show(Resources.hcStringResources.Global_CommandError);
                }
            }
            else
            {
                MessageBox.Show(Resources.hcStringResources.createAccount_AccountExists);

                ConfigAccess.updateLog("Account creation failed");
            }
        }
Пример #8
0
        private void buttonUpdate_Click(object sender, EventArgs e)
        {
            try
            {
                if (!String.IsNullOrEmpty(accountComboBox1.Text ))
                {
                    if (!String.IsNullOrEmpty(comboGMLevel.Text))
                    {
                        ServerData sData = new ServerData();

                        if (sData.checkAccountExists(accountComboBox1.Text))
                        {
                            string commandString = "setgm " + accountComboBox1.Text + " " + comboGMLevel.Text;
                            ManguiMain.mangosProcess.StandardInput.WriteLine(commandString);

                            ConfigAccess.updateLog(commandString);

                            MessageBox.Show(string.Format(Resources.hcStringResources.Global_CommandSuccesful, commandString));
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show(Resources.hcStringResources.setGM_AccountUnknown );
                        }
                    }
                    else
                    {
                        MessageBox.Show(Resources.hcStringResources.setGM_ChooseGMLevel );
                    }
                }
                else
                {
                    MessageBox.Show(Resources.hcStringResources.setGM_EnterAccount );
                }
            }
            catch
            {
                MessageBox.Show(Resources.hcStringResources.Global_CommandError );
            }
        }
Пример #9
0
        private void buttonLoad_Click(object sender, EventArgs e)
        {
            try
            {
                if (!String.IsNullOrEmpty(textFileName.Text))
                {
                    if (!String.IsNullOrEmpty(textAccountName.Text))
                    {
                        ServerData sData = new ServerData();

                        if (sData.checkAccountExists(textAccountName.Text))
                        {
                            string commandString = "loadpdump " + textFileName.Text + " " + textAccountName.Text;
                            ManguiMain.mangosProcess.StandardInput.WriteLine(commandString);

                            ConfigAccess.updateLog(commandString);

                            MessageBox.Show(string.Format(Resources.hcStringResources.Global_CommandSuccesful, commandString));
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show(hcStringResources.loadDump_AccountDoesntExist);
                        }
                    }
                    else
                    {
                        MessageBox.Show(hcStringResources.loadDump_EnterNameOrGuid);
                    }
                }
                else
                {
                    MessageBox.Show(hcStringResources.loadDump_EnterFileName);
                }
            }
            catch
            {
                MessageBox.Show(hcStringResources.Global_CommandError);
            }
        }
Пример #10
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(textAccountName.Text))
            {
                if (MessageBox.Show(hcStringResources.deleteAccount_ConfirmDelete, hcStringResources.deleteAccount_ConfirmDeleteCaption, MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    try
                    {
                        ServerData sData = new ServerData();

                        if (sData.checkAccountExists(textAccountName.Text))
                        {
                            string commandString = "account delete " + textAccountName.Text;
                            ManguiMain.mangosProcess.StandardInput.WriteLine(commandString);

                            ConfigAccess.updateLog(commandString);

                            MessageBox.Show(string.Format(Resources.hcStringResources.Global_CommandSuccesful, commandString));
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show(hcStringResources.deleteAccount_AccountDoesntExist);
                        }
                    }
                    catch
                    {
                        MessageBox.Show(hcStringResources.Global_CommandError);
                    }
                }
            }
            else
            {
                MessageBox.Show(hcStringResources.deleteAccount_EnterAccount);
            }
        }
Пример #11
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(textCharacterName.Text))
            {
                if (MessageBox.Show("Are you sure you want to proceed?.", "Confirm Delete", MessageBoxButtons.OKCancel) == DialogResult.OK)
                {
                    try
                    {
                        ServerData sData = new ServerData();

                        if (sData.checkCharacterExists(textCharacterName.Text))
                        {
                            string commandString = "chardelete " + textCharacterName.Text;
                            ManguiMain.mangosProcess.StandardInput.WriteLine(commandString);

                            ConfigAccess.updateLog(commandString);

                            MessageBox.Show(string.Format(Resources.hcStringResources.Global_CommandSuccesful, commandString));
                            this.Close();
                        }
                        else
                        {
                            MessageBox.Show("There is no character by that name in the database.");
                        }
                    }
                    catch
                    {
                        MessageBox.Show("An error occured while trying to complete this action.");
                    }
                }
            }
            else
            {
                MessageBox.Show("Please enter a character to delete.");
            }
        }
Пример #12
0
        private void checkPopulation()
        {
            ServerData popCheck = new ServerData();

            population = popCheck.checkCurrentPopulation();

            if (population > maxPopulation)
                maxPopulation = population;

            toolStripLabelOnline.Text = hcStringResources.ManguiMain_Online + population.ToString() + " (" + maxPopulation.ToString() + ")";
            timeCheckPop = 0;
        }
Пример #13
0
        private void buttonGetTickets_Click(object sender, EventArgs e)
        {
            ServerData sData = new ServerData();

            dataTickets.DataSource = sData.getTickets();
        }
Пример #14
0
        private void button2_Click(object sender, EventArgs e)
        {
            ServerData sData = new ServerData();

            dataCharacters.DataSource = sData.getCharacterList();
        }
Пример #15
0
        private void button1_Click(object sender, EventArgs e)
        {
            ServerData sData = new ServerData();

            dataAccounts.DataSource = sData.getAccountList();
        }
Пример #16
0
        private void btnRefresh_Click(object sender, EventArgs e)
        {
            ServerData sData = new ServerData();

            dataOnlineInfo.DataSource = sData.getOnlineData();
        }
Пример #17
0
 private void fillLocations()
 {
     ServerData sData = new ServerData();
     locations = sData.getTeleportLocations();
     comboLocations.DataSource = locations;
 }