Ejemplo n.º 1
0
 private void RconKickPlayers_Load(object sender, EventArgs e)
 {
     try {
         List <SourceRconTools.Player> players = SourceRconTools.GetAllPlayers();
         if (players.Count == 0)
         {
             MessageBox.Show(this, mLangMan.GetString("Rcon_NoPlayers"), mLangMan.GetString("Text_Info"), MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
             this.Close();
         }
         foreach (SourceRconTools.Player player in players)
         {
             checkedListBoxPlayers.Items.Add(player);
         }
     } catch (Exception ex) {
         ErrorLogger.Log(ex);
         ExceptionEvent(mLangMan.GetString("Rcon_WrongAnswer"));
         this.Close();
     }
 }
Ejemplo n.º 2
0
 private void RconPlugin(bool AllServers, bool Load)
 {
     if (AllServers || ServerList.FocusedItem != null)
     {
         ArkServerListViewItem ASLVI = AllServers ? null : (ArkServerListViewItem)ServerList.FocusedItem;
         inputDialog.Text            = (Load ? "Load" : "Unload") + " Plugin to " + (AllServers ? "All" : ASLVI.GetServerData().AltSaveDirectory);
         inputDialog.SendButton.Text = (Load ? "Load" : "Unload") + " Plugin";
         if (inputDialog.ShowDialog() == DialogResult.OK)
         {
             if (AllServers)
             {
                 SourceRconTools.SendCommandToAll("plugins." + (Load ? "load " : "unload ") + inputDialog.InputText.Text);
             }
             else
             {
                 SourceRconTools.SendCommand("plugins." + (Load ? "load " : "unload ") + inputDialog.InputText.Text, ASLVI);
             }
             Log("Plugin " + (Load ? "Loaded" : "Unloaded") + ": " + inputDialog.InputText.Text);
         }
     }
 }
Ejemplo n.º 3
0
 private void RconCustomCommand(bool AllServers)
 {
     if (AllServers || ServerList.FocusedItem != null)
     {
         ArkServerListViewItem ASLVI = AllServers ? null : (ArkServerListViewItem)ServerList.FocusedItem;
         inputDialog.Text            = "Send Custom Command to " + (AllServers ? "All" : ASLVI.GetServerData().AltSaveDirectory);
         inputDialog.SendButton.Text = "Send Command";
         if (inputDialog.ShowDialog() == DialogResult.OK)
         {
             if (AllServers)
             {
                 SourceRconTools.SendCommandToAll(inputDialog.InputText.Text);
             }
             else
             {
                 SourceRconTools.SendCommand(inputDialog.InputText.Text, ASLVI);
             }
             Log("Custom Command Executed: " + inputDialog.InputText.Text);
         }
     }
 }
Ejemplo n.º 4
0
 private void frmRconKick_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.DialogResult == DialogResult.OK)
     {
         for (int i = 0; i < checkedListBoxPlayers.Items.Count; i++)
         {
             if (checkedListBoxPlayers.GetItemChecked(i))
             {
                 SourceRconTools.Player player = (SourceRconTools.Player)checkedListBoxPlayers.Items[i];
                 if (checkBoxKcikWithMsg.Checked)
                 {
                     SourceRconTools.KickPlayer(player, textBoxMsg.Text);
                 }
                 else
                 {
                     SourceRconTools.KickPlayer(player);
                 }
             }
         }
     }
 }