Example #1
0
        private async void sendMessageButton_Click(object sender, EventArgs e)
        {
            if (serverAnnouncementCheckBox.Checked)
            {
                if (!string.IsNullOrEmpty(communicationsTextBox.Text))
                {
                    AddMessage(String.Format("Server Announcement: {0}", communicationsTextBox.Text + Environment.NewLine), Color.DodgerBlue);
                }

                await TCAction.AnnounceToServer(communicationsTextBox.Text);
            }
            else if (serverNotificationCheckBox.Checked)
            {
                if (!string.IsNullOrEmpty(communicationsTextBox.Text))
                {
                    AddMessage(String.Format("Notification: {0}", communicationsTextBox.Text + Environment.NewLine), Color.DodgerBlue);
                }

                await TCAction.NotifiyServer(communicationsTextBox.Text);
            }
            else if (gmAnnouncementCheckBox.Checked)
            {
                if (!string.IsNullOrEmpty(communicationsTextBox.Text))
                {
                    AddMessage(String.Format("GM Notification: {0}", communicationsTextBox.Text + Environment.NewLine), Color.DodgerBlue);
                }

                await TCAction.NotifyGMs(communicationsTextBox.Text);
            }

            communicationsTextBox.Text = String.Empty;
        }
Example #2
0
        private async void okButton_Click(object sender, EventArgs e)
        {
            if (usernameComboBox.SelectedIndex == -1 || accLevelComboBox.SelectedIndex == -1 || accAddonComboBox.SelectedIndex == -1)
            {
                return;
            }

            Account selectedAccount = accounts.SingleOrDefault(p => p.Username == usernameComboBox.Items[usernameComboBox.SelectedIndex].ToString());

            if (selectedAccount == null)
            {
                return;
            }

            StartLoading();

            await TCManager.Instance.AuthDatabase.SetAccountLock(selectedAccount.Id, switchButton.Value);

            await TCAction.SetPlayerPassword(selectedAccount.Username, passTextBox.Text);

            await TCAction.SetPlayerExpansion(selectedAccount.Username, (Expansion)accAddonComboBox.SelectedIndex);

            await TCAction.SetGMLevel(selectedAccount.Username, (GMLevel)accLevelComboBox.SelectedIndex + 1, -1);

            StopLoading();

            this.Close();
        }
Example #3
0
        private async void banButton_Click(object sender, EventArgs e)
        {
            string   ipa       = ipAddressBanInput.Value;
            string   reason    = banReasonTextBox.Text;
            DateTime banTime   = DateTime.Now;
            DateTime unbanTime = banTimeDateTimeInput.Value;

            if (string.IsNullOrEmpty(ipa) || string.IsNullOrEmpty(reason) || banTimeDateTimeInput.IsEmpty)
            {
                MessageBoxEx.Show(this, "Everything must be filled out!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            StartLoading();

            if (permanentBanCheckBox.Checked)
            {
                await TCAction.BanIPAddress(ipAddressBanInput.Value, Convert.ToInt32(banTime.ToUnixTimestamp()), -1, "Admin", reason);
            }
            else
            {
                await TCAction.BanIPAddress(ipAddressBanInput.Value, Convert.ToInt32(banTime.ToUnixTimestamp()), Convert.ToInt32(unbanTime.ToUnixTimestamp()), "Admin", reason);
            }

            StopLoading();

            this.Close();
        }
Example #4
0
        private async void ExecConsoleCommand()
        {
            if (TCManager.Instance.Online)
            {
                await TCAction.ExecuteCommand(ConsoleCommand);
            }

            ConsoleCommand = String.Empty;
        }
Example #5
0
        private async void banCharacterButton_Click(object sender, EventArgs e)
        {
            if (characterListComboBox.SelectedIndex == -1)
            {
                MessageBoxEx.Show(this, "No character selected!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            await TCAction.BanCharacter(characterListComboBox.Items[characterListComboBox.SelectedIndex].ToString());
        }
Example #6
0
        private async void removeBanButton_Click(object sender, EventArgs e)
        {
            if (ipAddressComboBox.SelectedIndex == -1)
            {
                MessageBoxEx.Show(this, "You must select an ip address to unban!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            await TCAction.UnbanIPAddress(ipAddressComboBox.Items[ipAddressComboBox.SelectedIndex].ToString());
        }
Example #7
0
        private async void CharChangeLevel()
        {
            if (string.IsNullOrEmpty(SelectedCharacter))
            {
                _messageService.ShowError("No character selected!");

                return;
            }

            await TCAction.ModifyAccountLevel(SelectedCharacter, CharLevel);
        }
        private async void okButton_Click(object sender, EventArgs e)
        {
            if (serverLimitIntegerInput.Value > 0)
            {
                await TCAction.SetPlayerLimit(serverLimitIntegerInput.Value);
            }

            if (!string.IsNullOrEmpty(motdTextBox.Text))
            {
                await TCAction.SetServerMotd(Regex.Replace(motdTextBox.Text, "\r\n", "\\r\\n"));
            }
        }
Example #9
0
 public void ClearControllers()
 {
     TCID_TB.Clear();
     TCObj.Clear();
     TCPrecon.Clear();
     TCAction.Clear();
     TCExpecRes.Clear();
     foreach (Keyword oKeyword in KeywordLB.Items)
     {
         if (oKeyword.IsChecked)
         {
             oKeyword.IsChecked = false;
         }
     }
     KeywordLB.Items.Refresh();
 }
Example #10
0
        private async void kickPlayerButton_Click(object sender, EventArgs e)
        {
            if (playerManagementComboBox.SelectedIndex == -1)
            {
                MessageBoxEx.Show(this, "You must first select a character to kick!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            try
            {
                await TCAction.KickPlayer(playerManagementComboBox.Items[playerManagementComboBox.SelectedIndex].ToString(), String.Empty);
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #11
0
        private async void ReviveChar()
        {
            if (string.IsNullOrEmpty(SelectedCharacter))
            {
                _messageService.ShowError("No character selected!");

                return;
            }

            try
            {
                await TCAction.RevivePlayer(SelectedCharacter);
            }
            catch (ServerOfflineException ex)
            {
                _messageService.ShowError(ex.Message);
            }
        }
        private async void banButton_Click(object sender, EventArgs e)
        {
            if (accListComboBox.SelectedIndex == -1)
            {
                MessageBoxEx.Show(this, "No user selected!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            string username = accListComboBox.Items[accListComboBox.SelectedIndex].ToString();
            int    unix     = (int)banTimeDateTimeInput.Value.ToUnixTimestamp();
            string reason   = banReasonTextBox.Text;

            StartLoading();

            await TCAction.BanAccount(username, unix, "Admin", reason);

            StopLoading();

            this.Close();
        }
Example #13
0
        private async void executeCommandButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(executeCommandTextBox.Text))
            {
                MessageBoxEx.Show(this, "You must enter a command to execute!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            try
            {
                AddMessage(String.Format("Console: {0}: ", executeCommandTextBox.Text + Environment.NewLine), Color.Chartreuse);

                await TCAction.ExecuteCommand(executeCommandTextBox.Text);

                executeCommandTextBox.Text = String.Empty;
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #14
0
        private async void SendMessage()
        {
            if (!string.IsNullOrEmpty(MessageText))
            {
                if (TCManager.Instance.Online)
                {
                    if (AnnouncementSelected)
                    {
                        await TCAction.AnnounceToServer(MessageText);
                    }
                    else if (ServerNotificationSelected)
                    {
                        await TCAction.NotifiyServer(MessageText);
                    }
                    else if (GMAnnouncementSelected)
                    {
                        await TCAction.NotifyGMs(MessageText);
                    }
                }

                MessageText = String.Empty;
            }
        }