示例#1
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);
            }
        }
示例#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 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.");
            }
        }