Skip to content
This repository was archived by the owner on Sep 11, 2023. It is now read-only.

Commit 55a2891

Browse files
committed
finish fixing RCON commands for TF2
1 parent fd71b86 commit 55a2891

File tree

2 files changed

+10
-20
lines changed

2 files changed

+10
-20
lines changed

UI/MainWindow/MainWindowSPCompiler.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,14 @@ await this.ShowMessageAsync(Program.Translations.GetLanguage("Error"),
125125
{
126126
// Shows the 'Compiling...' window
127127
ErrorResultGrid.Items.Clear();
128+
128129
ProgressTask = await this.ShowProgressAsync(Program.Translations.GetLanguage("Compiling"), "",
129130
false, MetroDialogOptions);
130131
ProgressTask.SetProgress(0.0);
132+
131133
var stringOutput = new StringBuilder();
132-
var errorFilterRegex =
133-
new Regex(Constants.ErrorFilterRegex,
134-
RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Multiline);
134+
var regexOptions = RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Multiline;
135+
var errorFilterRegex = new Regex(Constants.ErrorFilterRegex, regexOptions);
135136

136137
var compiledSuccess = 0;
137138

UI/MainWindow/MainWindowServerQuery.cs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,8 @@ public partial class MainWindow
1717
/// Queries the server with the specified command in the command box of the config.
1818
/// </summary>
1919

20-
private ServerInfo ServerInfoGlobal;
21-
22-
private async void Server_Query()
20+
private void Server_Query()
2321
{
24-
if (ProgressTask == null)
25-
{
26-
ProgressTask = await this.ShowProgressAsync(Program.Translations.GetLanguage("RCONCommand") + "...", "", false, MetroDialogOptions);
27-
ProgressTask.SetIndeterminate();
28-
}
29-
3022
var output = new List<string>();
3123

3224
if (!ServerIsRunning)
@@ -53,8 +45,6 @@ private async void Server_Query()
5345
goto Dispatcher;
5446
}
5547

56-
ServerInfoGlobal = serverInfo;
57-
5848
server.GetControl(c.RConPassword, false);
5949

6050
output.Add($"Server: {serverInfo.Name}");
@@ -66,6 +56,11 @@ private async void Server_Query()
6656
{
6757
output.Add("No plugins available to replace placeholders commands with. Removing them...");
6858
cmds = cmds.Where(x => !x.Contains("{plugin")).ToArray();
59+
if (cmds.Length == 0)
60+
{
61+
output.Add("No commands sent.");
62+
goto Dispatcher;
63+
}
6964
}
7065

7166
foreach (var cmd in cmds)
@@ -118,12 +113,6 @@ private async void Server_Query()
118113
CompileOutputRow.Height = new GridLength(200.0);
119114
}
120115
});
121-
122-
if (ProgressTask.IsOpen)
123-
{
124-
await ProgressTask.CloseAsync();
125-
ProgressTask = null;
126-
}
127116
}
128117

129118
/// <summary>

0 commit comments

Comments
 (0)