diff --git a/src/ARKServerManager/App.config b/src/ARKServerManager/App.config
index ddb12a82..0780b246 100644
--- a/src/ARKServerManager/App.config
+++ b/src/ARKServerManager/App.config
@@ -900,6 +900,18 @@
{ipaddress}:{port}
+
+ Normal
+
+
+ Normal
+
+
+ Normal
+
+
+ Normal
+
diff --git a/src/ARKServerManager/Config.Designer.cs b/src/ARKServerManager/Config.Designer.cs
index 01ad2382..76004616 100644
--- a/src/ARKServerManager/Config.Designer.cs
+++ b/src/ARKServerManager/Config.Designer.cs
@@ -12,7 +12,7 @@ namespace ServerManagerTool {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")]
public sealed partial class Config : global::System.Configuration.ApplicationSettingsBase {
private static Config defaultInstance = ((Config)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Config())));
@@ -3195,5 +3195,53 @@ namespace ServerManagerTool {
this["Alert_ServerStartedMessageIPandPort"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Normal")]
+ public global::System.Diagnostics.ProcessPriorityClass AutoBackup_TaskPriority {
+ get {
+ return ((global::System.Diagnostics.ProcessPriorityClass)(this["AutoBackup_TaskPriority"]));
+ }
+ set {
+ this["AutoBackup_TaskPriority"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Normal")]
+ public global::System.Diagnostics.ProcessPriorityClass AutoUpdate_TaskPriority {
+ get {
+ return ((global::System.Diagnostics.ProcessPriorityClass)(this["AutoUpdate_TaskPriority"]));
+ }
+ set {
+ this["AutoUpdate_TaskPriority"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Normal")]
+ public global::System.Diagnostics.ProcessPriorityClass AutoShutdown_TaskPriority {
+ get {
+ return ((global::System.Diagnostics.ProcessPriorityClass)(this["AutoShutdown_TaskPriority"]));
+ }
+ set {
+ this["AutoShutdown_TaskPriority"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Normal")]
+ public global::System.Diagnostics.ProcessPriorityClass AutoStart_TaskPriority {
+ get {
+ return ((global::System.Diagnostics.ProcessPriorityClass)(this["AutoStart_TaskPriority"]));
+ }
+ set {
+ this["AutoStart_TaskPriority"] = value;
+ }
+ }
}
}
diff --git a/src/ARKServerManager/Config.settings b/src/ARKServerManager/Config.settings
index f721b0b6..52077e44 100644
--- a/src/ARKServerManager/Config.settings
+++ b/src/ARKServerManager/Config.settings
@@ -878,5 +878,17 @@
{ipaddress}:{port}
+
+ Normal
+
+
+ Normal
+
+
+ Normal
+
+
+ Normal
+
\ No newline at end of file
diff --git a/src/ARKServerManager/Globalization/en-US/en-US.xaml b/src/ARKServerManager/Globalization/en-US/en-US.xaml
index 52a3edc3..dc7d809c 100644
--- a/src/ARKServerManager/Globalization/en-US/en-US.xaml
+++ b/src/ARKServerManager/Globalization/en-US/en-US.xaml
@@ -83,6 +83,15 @@
All
+
+ Idle
+ Below Normal
+ Normal
+ Above Normal
+ High
+ RealTime
+
+
NormalMinimized
@@ -741,6 +750,13 @@
RCON Broadcast Mode:Select the method used by the server manager to send auto process messages to the game clients via RCON.
+ Any changes to these priorities will take effect after the task has been created or saved.
+ Select the priority used by the windows task manager when running this task.
+ Auto Backup Task Priority:
+ Auto Update Task Priority:
+ Auto Shutdown/Restart Task Priority:
+ Auto Start Task Priority:
+
Confirm Settings Reset ActionClick 'Yes' to confirm you want to perform the settings reset.Failed to Reset Settings
diff --git a/src/ARKServerManager/Lib/ServerProfile.cs b/src/ARKServerManager/Lib/ServerProfile.cs
index 91343ce2..6e696b10 100644
--- a/src/ARKServerManager/Lib/ServerProfile.cs
+++ b/src/ARKServerManager/Lib/ServerProfile.cs
@@ -4482,18 +4482,18 @@ namespace ServerManagerTool.Lib
var taskKey = GetProfileKey();
- if(!TaskSchedulerUtils.ScheduleAutoStart(taskKey, null, this.EnableAutoStart, GetLauncherFile(), ProfileName, true))
+ if(!TaskSchedulerUtils.ScheduleAutoStart(taskKey, null, this.EnableAutoStart, GetLauncherFile(), ProfileName, true, Config.Default.AutoStart_TaskPriority))
{
return false;
}
var command = Assembly.GetEntryAssembly().Location;
- if (!TaskSchedulerUtils.ScheduleAutoShutdown(taskKey, "#1", command, this.EnableAutoShutdown1 ? (TimeSpan.TryParseExact(this.AutoShutdownTime1, "g", null, out TimeSpan shutdownTime) ? shutdownTime : (TimeSpan?)null) : null, ShutdownDaysOfTheWeek1, ProfileName, TaskSchedulerUtils.ShutdownType.Shutdown1))
+ if (!TaskSchedulerUtils.ScheduleAutoShutdown(taskKey, "#1", command, this.EnableAutoShutdown1 ? (TimeSpan.TryParseExact(this.AutoShutdownTime1, "g", null, out TimeSpan shutdownTime) ? shutdownTime : (TimeSpan?)null) : null, ShutdownDaysOfTheWeek1, ProfileName, TaskSchedulerUtils.ShutdownType.Shutdown1, Config.Default.AutoShutdown_TaskPriority))
{
return false;
}
- if (!TaskSchedulerUtils.ScheduleAutoShutdown(taskKey, "#2", command, this.EnableAutoShutdown2 ? (TimeSpan.TryParseExact(this.AutoShutdownTime2, "g", null, out shutdownTime) ? shutdownTime : (TimeSpan?)null) : null, ShutdownDaysOfTheWeek2, ProfileName, TaskSchedulerUtils.ShutdownType.Shutdown2))
+ if (!TaskSchedulerUtils.ScheduleAutoShutdown(taskKey, "#2", command, this.EnableAutoShutdown2 ? (TimeSpan.TryParseExact(this.AutoShutdownTime2, "g", null, out shutdownTime) ? shutdownTime : (TimeSpan?)null) : null, ShutdownDaysOfTheWeek2, ProfileName, TaskSchedulerUtils.ShutdownType.Shutdown2, Config.Default.AutoShutdown_TaskPriority))
{
return false;
}
diff --git a/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml b/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml
index 52228b78..cb1e1b2e 100644
--- a/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml
+++ b/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml
@@ -808,36 +808,52 @@
+
+
+
-
-
+
+
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs b/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs
index e1e504c1..4e2f474f 100644
--- a/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs
+++ b/src/ARKServerManager/UserControls/GlobalSettingsControl.xaml.cs
@@ -38,6 +38,7 @@ namespace ServerManagerTool
public static readonly DependencyProperty DiscordBotLogLevelsProperty = DependencyProperty.Register(nameof(DiscordBotLogLevels), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty DiscordBotWhitelistProperty = DependencyProperty.Register(nameof(DiscordBotWhitelist), typeof(List), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty RconMessageModesProperty = DependencyProperty.Register(nameof(RconMessageModes), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
+ public static readonly DependencyProperty TaskPrioritiesProperty = DependencyProperty.Register(nameof(TaskPriorities), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public GlobalSettingsControl()
{
@@ -54,6 +55,7 @@ namespace ServerManagerTool
PopulateWindowsStatesServerMonitorWindowComboBox();
PopulateDiscordBotLogLevelsComboBox();
PopulateRconMessageModesComboBox();
+ PopulateTaskPrioritiesComboBox();
DiscordBotWhitelist = new List();
if (Config.DiscordBotWhitelist != null)
@@ -124,6 +126,12 @@ namespace ServerManagerTool
set { SetValue(RconMessageModesProperty, value); }
}
+ public ComboBoxItemList TaskPriorities
+ {
+ get { return (ComboBoxItemList)GetValue(TaskPrioritiesProperty); }
+ set { SetValue(TaskPrioritiesProperty, value); }
+ }
+
public void ApplyChangesToConfig()
{
if (Config.DiscordBotWhitelist is null)
@@ -394,6 +402,7 @@ namespace ServerManagerTool
PopulateWindowsStatesMainWindowComboBox();
PopulateWindowsStatesServerMonitorWindowComboBox();
PopulateRconMessageModesComboBox();
+ PopulateTaskPrioritiesComboBox();
App.Instance.OnResourceDictionaryChanged(Config.CultureName);
}
@@ -555,6 +564,39 @@ namespace ServerManagerTool
}
}
+ private void PopulateTaskPrioritiesComboBox()
+ {
+ var selectedValueAutoBackup = this.TaskPriorityAutoBackupComboBox?.SelectedValue ?? Config.AutoBackup_TaskPriority;
+ var selectedValueAutoUpdate = this.TaskPriorityAutoUpdateComboBox?.SelectedValue ?? Config.AutoUpdate_TaskPriority;
+ var selectedValueAutoShutdown = this.TaskPriorityAutoShutdownComboBox?.SelectedValue ?? Config.AutoShutdown_TaskPriority;
+ var selectedValueAutoStart = this.TaskPriorityAutoStartComboBox?.SelectedValue ?? Config.AutoStart_TaskPriority;
+ var list = new ComboBoxItemList();
+
+ foreach (ProcessPriorityClass priority in Enum.GetValues(typeof(ProcessPriorityClass)))
+ {
+ var displayMember = _globalizer.GetResourceString($"TaskPriority_{priority}") ?? priority.ToString();
+ list.Add(new Common.Model.ComboBoxItem(priority.ToString(), displayMember));
+ }
+
+ this.TaskPriorities = list;
+ if (this.TaskPriorityAutoBackupComboBox != null)
+ {
+ this.TaskPriorityAutoBackupComboBox.SelectedValue = selectedValueAutoBackup;
+ }
+ if (this.TaskPriorityAutoUpdateComboBox != null)
+ {
+ this.TaskPriorityAutoUpdateComboBox.SelectedValue = selectedValueAutoUpdate;
+ }
+ if (this.TaskPriorityAutoShutdownComboBox != null)
+ {
+ this.TaskPriorityAutoShutdownComboBox.SelectedValue = selectedValueAutoShutdown;
+ }
+ if (this.TaskPriorityAutoStartComboBox != null)
+ {
+ this.TaskPriorityAutoStartComboBox.SelectedValue = selectedValueAutoStart;
+ }
+ }
+
#region Discord Bot Whitelist
private void AddDiscordBotWhitelist_Click(object sender, RoutedEventArgs e)
{
diff --git a/src/ARKServerManager/VersionFeed.xml b/src/ARKServerManager/VersionFeed.xml
index fdb48cef..331dbfc6 100644
--- a/src/ARKServerManager/VersionFeed.xml
+++ b/src/ARKServerManager/VersionFeed.xml
@@ -9,8 +9,8 @@
urn:uuid:2E2A14AE-EE5B-4384-8143-BF5D1C8A487D
- 1.1.428 (1.1.428.1)
- 1.1.428.1
+ 1.1.428 (1.1.428.2)
+ 1.1.428.22022-05-15T00:00:00Z
@@ -21,6 +21,11 @@
Server Shutdown/Restart - rewritten the code that sends the RCON commands to prevent the hangs after the RCON command fails.
+ CHANGE
+
+
+
Auto Process Task Priorities - Have added task priority droplists to the global settings, allowing the priority for each auto process task to be changed.
Auto Process Task Priorities - Have added task priority droplists to the global settings, allowing the priority for each auto process task to be changed.
+
+
+
+
+
+ bletch
+ bletch1971@hotmail.com
+
+
+
urn:uuid:2E2A14AE-EE5B-4384-8143-BF5D1C8A487D1.1.428 (1.1.428.1)
diff --git a/src/ARKServerManager/Windows/SettingsWindow.xaml.cs b/src/ARKServerManager/Windows/SettingsWindow.xaml.cs
index c1981589..a5d07092 100644
--- a/src/ARKServerManager/Windows/SettingsWindow.xaml.cs
+++ b/src/ARKServerManager/Windows/SettingsWindow.xaml.cs
@@ -46,7 +46,7 @@ namespace ServerManagerTool
var taskKey = TaskSchedulerUtils.ComputeKey(Config.Default.DataDir);
var command = Assembly.GetEntryAssembly().Location;
- if (!TaskSchedulerUtils.ScheduleAutoUpdate(taskKey, null, command, Config.Default.AutoUpdate_EnableUpdate ? Config.Default.AutoUpdate_UpdatePeriod : 0))
+ if (!TaskSchedulerUtils.ScheduleAutoUpdate(taskKey, null, command, Config.Default.AutoUpdate_EnableUpdate ? Config.Default.AutoUpdate_UpdatePeriod : 0, Config.Default.AutoUpdate_TaskPriority))
{
MessageBox.Show(_globalizer.GetResourceString("GlobalSettings_CacheTaskUpdate_ErrorLabel"), _globalizer.GetResourceString("GlobalSettings_CacheTaskUpdate_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
}
@@ -62,7 +62,7 @@ namespace ServerManagerTool
}
}
- if (!TaskSchedulerUtils.ScheduleAutoBackup(taskKey, null, command, Config.Default.AutoBackup_EnableBackup ? Config.Default.AutoBackup_BackupPeriod : 0))
+ if (!TaskSchedulerUtils.ScheduleAutoBackup(taskKey, null, command, Config.Default.AutoBackup_EnableBackup ? Config.Default.AutoBackup_BackupPeriod : 0, Config.Default.AutoBackup_TaskPriority))
{
MessageBox.Show(_globalizer.GetResourceString("GlobalSettings_BackupTaskUpdate_ErrorLabel"), _globalizer.GetResourceString("GlobalSettings_BackupTaskUpdate_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
}
diff --git a/src/ConanServerManager/App.config b/src/ConanServerManager/App.config
index a3185dbe..df62b7b8 100644
--- a/src/ConanServerManager/App.config
+++ b/src/ConanServerManager/App.config
@@ -675,6 +675,18 @@
{ipaddress}:{port}
+
+ Normal
+
+
+ Normal
+
+
+ Normal
+
+
+ Normal
+
\ No newline at end of file
diff --git a/src/ConanServerManager/Config.Designer.cs b/src/ConanServerManager/Config.Designer.cs
index 4ac7e1aa..c83ed115 100644
--- a/src/ConanServerManager/Config.Designer.cs
+++ b/src/ConanServerManager/Config.Designer.cs
@@ -12,7 +12,7 @@ namespace ServerManagerTool {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.1.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")]
public sealed partial class Config : global::System.Configuration.ApplicationSettingsBase {
private static Config defaultInstance = ((Config)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Config())));
@@ -2378,5 +2378,53 @@ namespace ServerManagerTool {
this["Alert_ServerStartedMessageIPandPort"] = value;
}
}
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Normal")]
+ public global::System.Diagnostics.ProcessPriorityClass AutoBackup_TaskPriority {
+ get {
+ return ((global::System.Diagnostics.ProcessPriorityClass)(this["AutoBackup_TaskPriority"]));
+ }
+ set {
+ this["AutoBackup_TaskPriority"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Normal")]
+ public global::System.Diagnostics.ProcessPriorityClass AutoUpdate_TaskPriority {
+ get {
+ return ((global::System.Diagnostics.ProcessPriorityClass)(this["AutoUpdate_TaskPriority"]));
+ }
+ set {
+ this["AutoUpdate_TaskPriority"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Normal")]
+ public global::System.Diagnostics.ProcessPriorityClass AutoShutdown_TaskPriority {
+ get {
+ return ((global::System.Diagnostics.ProcessPriorityClass)(this["AutoShutdown_TaskPriority"]));
+ }
+ set {
+ this["AutoShutdown_TaskPriority"] = value;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("Normal")]
+ public global::System.Diagnostics.ProcessPriorityClass AutoStart_TaskPriority {
+ get {
+ return ((global::System.Diagnostics.ProcessPriorityClass)(this["AutoStart_TaskPriority"]));
+ }
+ set {
+ this["AutoStart_TaskPriority"] = value;
+ }
+ }
}
}
diff --git a/src/ConanServerManager/Config.settings b/src/ConanServerManager/Config.settings
index cfe66fd1..2eed0a9d 100644
--- a/src/ConanServerManager/Config.settings
+++ b/src/ConanServerManager/Config.settings
@@ -653,5 +653,17 @@
{ipaddress}:{port}
+
+ Normal
+
+
+ Normal
+
+
+ Normal
+
+
+ Normal
+
\ No newline at end of file
diff --git a/src/ConanServerManager/Globalization/en-US/en-US.xaml b/src/ConanServerManager/Globalization/en-US/en-US.xaml
index 6d807dc2..0bde3dfa 100644
--- a/src/ConanServerManager/Globalization/en-US/en-US.xaml
+++ b/src/ConanServerManager/Globalization/en-US/en-US.xaml
@@ -57,6 +57,15 @@
All
+
+ Idle
+ Below Normal
+ Normal
+ Above Normal
+ High
+ RealTime
+
+
NormalMinimized
@@ -903,6 +912,13 @@
RCON Broadcast Mode:Select the method used by the server manager to send auto process messages to the game clients via RCON.
+ Any changes to these priorities will take effect after the task has been created or saved.
+ Select the priority used by the windows task manager when running this task.
+ Auto Backup Task Priority:
+ Auto Update Task Priority:
+ Auto Shutdown/Restart Task Priority:
+ Auto Start Task Priority:
+
Confirm Settings Reset ActionClick 'Yes' to confirm you want to perform the settings reset.Failed to Reset Settings
diff --git a/src/ConanServerManager/Lib/ServerProfile.cs b/src/ConanServerManager/Lib/ServerProfile.cs
index b5b3f71d..185b2256 100644
--- a/src/ConanServerManager/Lib/ServerProfile.cs
+++ b/src/ConanServerManager/Lib/ServerProfile.cs
@@ -1177,19 +1177,19 @@ namespace ServerManagerTool.Lib
var taskKey = GetProfileKey();
- if(!TaskSchedulerUtils.ScheduleAutoStart(taskKey, null, this.EnableAutoStart, GetLauncherFile(), ProfileName, true))
+ if(!TaskSchedulerUtils.ScheduleAutoStart(taskKey, null, this.EnableAutoStart, GetLauncherFile(), ProfileName, true, Config.Default.AutoStart_TaskPriority))
{
return false;
}
TimeSpan shutdownTime;
var command = Assembly.GetEntryAssembly().Location;
- if (!TaskSchedulerUtils.ScheduleAutoShutdown(taskKey, "#1", command, this.EnableAutoShutdown1 ? (TimeSpan.TryParseExact(this.AutoShutdownTime1, "g", null, out shutdownTime) ? shutdownTime : (TimeSpan?)null) : null, ShutdownDaysOfTheWeek1, ProfileName, TaskSchedulerUtils.ShutdownType.Shutdown1))
+ if (!TaskSchedulerUtils.ScheduleAutoShutdown(taskKey, "#1", command, this.EnableAutoShutdown1 ? (TimeSpan.TryParseExact(this.AutoShutdownTime1, "g", null, out shutdownTime) ? shutdownTime : (TimeSpan?)null) : null, ShutdownDaysOfTheWeek1, ProfileName, TaskSchedulerUtils.ShutdownType.Shutdown1, Config.Default.AutoShutdown_TaskPriority))
{
return false;
}
- if (!TaskSchedulerUtils.ScheduleAutoShutdown(taskKey, "#2", command, this.EnableAutoShutdown2 ? (TimeSpan.TryParseExact(this.AutoShutdownTime2, "g", null, out shutdownTime) ? shutdownTime : (TimeSpan?)null) : null, ShutdownDaysOfTheWeek2, ProfileName, TaskSchedulerUtils.ShutdownType.Shutdown2))
+ if (!TaskSchedulerUtils.ScheduleAutoShutdown(taskKey, "#2", command, this.EnableAutoShutdown2 ? (TimeSpan.TryParseExact(this.AutoShutdownTime2, "g", null, out shutdownTime) ? shutdownTime : (TimeSpan?)null) : null, ShutdownDaysOfTheWeek2, ProfileName, TaskSchedulerUtils.ShutdownType.Shutdown2, Config.Default.AutoShutdown_TaskPriority))
{
return false;
}
diff --git a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml
index 54f01327..1a5cad86 100644
--- a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml
+++ b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml
@@ -753,36 +753,52 @@
+
+
+
-
-
+
+
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
-
-
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs
index 582404dd..dc43aa07 100644
--- a/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs
+++ b/src/ConanServerManager/UserControls/GlobalSettingsControl.xaml.cs
@@ -36,6 +36,7 @@ namespace ServerManagerTool
public static readonly DependencyProperty DiscordBotLogLevelsProperty = DependencyProperty.Register(nameof(DiscordBotLogLevels), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty DiscordBotWhitelistProperty = DependencyProperty.Register(nameof(DiscordBotWhitelist), typeof(List), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public static readonly DependencyProperty RconMessageModesProperty = DependencyProperty.Register(nameof(RconMessageModes), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
+ public static readonly DependencyProperty TaskPrioritiesProperty = DependencyProperty.Register(nameof(TaskPriorities), typeof(ComboBoxItemList), typeof(GlobalSettingsControl), new PropertyMetadata(null));
public GlobalSettingsControl()
{
@@ -52,6 +53,7 @@ namespace ServerManagerTool
PopulateWindowsStatesServerMonitorWindowComboBox();
PopulateDiscordBotLogLevelsComboBox();
PopulateRconMessageModesComboBox();
+ PopulateTaskPrioritiesComboBox();
DiscordBotWhitelist = new List();
if (Config.DiscordBotWhitelist != null)
@@ -122,6 +124,12 @@ namespace ServerManagerTool
set { SetValue(RconMessageModesProperty, value); }
}
+ public ComboBoxItemList TaskPriorities
+ {
+ get { return (ComboBoxItemList)GetValue(TaskPrioritiesProperty); }
+ set { SetValue(TaskPrioritiesProperty, value); }
+ }
+
public void ApplyChangesToConfig()
{
if (Config.DiscordBotWhitelist is null)
@@ -396,6 +404,7 @@ namespace ServerManagerTool
PopulateWindowsStatesMainWindowComboBox();
PopulateWindowsStatesServerMonitorWindowComboBox();
PopulateRconMessageModesComboBox();
+ PopulateTaskPrioritiesComboBox();
App.Instance.OnResourceDictionaryChanged(Config.CultureName);
}
@@ -557,6 +566,39 @@ namespace ServerManagerTool
}
}
+ private void PopulateTaskPrioritiesComboBox()
+ {
+ var selectedValueAutoBackup = this.TaskPriorityAutoBackupComboBox?.SelectedValue ?? Config.AutoBackup_TaskPriority;
+ var selectedValueAutoUpdate = this.TaskPriorityAutoUpdateComboBox?.SelectedValue ?? Config.AutoUpdate_TaskPriority;
+ var selectedValueAutoShutdown = this.TaskPriorityAutoShutdownComboBox?.SelectedValue ?? Config.AutoShutdown_TaskPriority;
+ var selectedValueAutoStart = this.TaskPriorityAutoStartComboBox?.SelectedValue ?? Config.AutoStart_TaskPriority;
+ var list = new ComboBoxItemList();
+
+ foreach (ProcessPriorityClass priority in Enum.GetValues(typeof(ProcessPriorityClass)))
+ {
+ var displayMember = _globalizer.GetResourceString($"TaskPriority_{priority}") ?? priority.ToString();
+ list.Add(new Common.Model.ComboBoxItem(priority.ToString(), displayMember));
+ }
+
+ this.TaskPriorities = list;
+ if (this.TaskPriorityAutoBackupComboBox != null)
+ {
+ this.TaskPriorityAutoBackupComboBox.SelectedValue = selectedValueAutoBackup;
+ }
+ if (this.TaskPriorityAutoUpdateComboBox != null)
+ {
+ this.TaskPriorityAutoUpdateComboBox.SelectedValue = selectedValueAutoUpdate;
+ }
+ if (this.TaskPriorityAutoShutdownComboBox != null)
+ {
+ this.TaskPriorityAutoShutdownComboBox.SelectedValue = selectedValueAutoShutdown;
+ }
+ if (this.TaskPriorityAutoStartComboBox != null)
+ {
+ this.TaskPriorityAutoStartComboBox.SelectedValue = selectedValueAutoStart;
+ }
+ }
+
#region Discord Bot Whitelist
private void AddDiscordBotWhitelist_Click(object sender, RoutedEventArgs e)
{
diff --git a/src/ConanServerManager/VersionFeed.xml b/src/ConanServerManager/VersionFeed.xml
index aa2bf20c..ae5d4b72 100644
--- a/src/ConanServerManager/VersionFeed.xml
+++ b/src/ConanServerManager/VersionFeed.xml
@@ -9,8 +9,8 @@
urn:uuid:E367ACB5-E38A-4B3A-A089-E43D011A97E4
- 1.1.72 (1.1.72.1)
- 1.1.72.1
+ 1.1.72 (1.1.72.2)
+ 1.1.72.22022-05-15T00:00:00Z
@@ -21,6 +21,11 @@
Server Shutdown/Restart - have rewritten the code that sends the RCON commands to prevent the hangs after the RCON command fails.
+ CHANGE
+
+
+
Auto Process Task Priorities - Have added task priority droplists to the global settings, allowing the priority for each auto process task to be changed.
Auto Process Task Priorities - Have added task priority droplists to the global settings, allowing the priority for each auto process task to be changed.
+
+
+
+
+
+ bletch
+ bletch1971@hotmail.com
+
+
+
urn:uuid:E367ACB5-E38A-4B3A-A089-E43D011A97E41.1.72 (1.1.72.1)
diff --git a/src/ConanServerManager/Windows/SettingsWindow.xaml.cs b/src/ConanServerManager/Windows/SettingsWindow.xaml.cs
index 99005204..95eef649 100644
--- a/src/ConanServerManager/Windows/SettingsWindow.xaml.cs
+++ b/src/ConanServerManager/Windows/SettingsWindow.xaml.cs
@@ -63,7 +63,7 @@ namespace ServerManagerTool
var taskKey = TaskSchedulerUtils.ComputeKey(Config.Default.DataPath);
var command = Assembly.GetEntryAssembly().Location;
- if (!TaskSchedulerUtils.ScheduleAutoUpdate(taskKey, null, command, Config.Default.AutoUpdate_EnableUpdate ? Config.Default.AutoUpdate_UpdatePeriod : 0))
+ if (!TaskSchedulerUtils.ScheduleAutoUpdate(taskKey, null, command, Config.Default.AutoUpdate_EnableUpdate ? Config.Default.AutoUpdate_UpdatePeriod : 0, Config.Default.AutoUpdate_TaskPriority))
{
MessageBox.Show(_globalizer.GetResourceString("GlobalSettings_CacheTaskUpdate_ErrorLabel"), _globalizer.GetResourceString("GlobalSettings_CacheTaskUpdate_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
}
@@ -79,7 +79,7 @@ namespace ServerManagerTool
}
}
- if (!TaskSchedulerUtils.ScheduleAutoBackup(taskKey, null, command, Config.Default.AutoBackup_EnableBackup ? Config.Default.AutoBackup_BackupPeriod : 0))
+ if (!TaskSchedulerUtils.ScheduleAutoBackup(taskKey, null, command, Config.Default.AutoBackup_EnableBackup ? Config.Default.AutoBackup_BackupPeriod : 0, Config.Default.AutoBackup_TaskPriority))
{
MessageBox.Show(_globalizer.GetResourceString("GlobalSettings_BackupTaskUpdate_ErrorLabel"), _globalizer.GetResourceString("GlobalSettings_BackupTaskUpdate_ErrorTitle"), MessageBoxButton.OK, MessageBoxImage.Error);
}
diff --git a/src/ServerManager.Common/Utils/TaskSchedulerUtils.cs b/src/ServerManager.Common/Utils/TaskSchedulerUtils.cs
index 087d8e2b..9463e811 100644
--- a/src/ServerManager.Common/Utils/TaskSchedulerUtils.cs
+++ b/src/ServerManager.Common/Utils/TaskSchedulerUtils.cs
@@ -159,7 +159,7 @@ namespace ServerManagerTool.Common.Utils
task.Run();
}
- public static bool ScheduleAutoBackup(string taskKey, string taskSuffix, string command, int autoBackupPeriod)
+ public static bool ScheduleAutoBackup(string taskKey, string taskSuffix, string command, int autoBackupPeriod, ProcessPriorityClass priority)
{
var taskName = GetScheduledTaskName(TaskType.AutoBackup, taskKey, taskSuffix);
var taskFolder = TaskService.Instance.RootFolder.SubFolders.Exists(TaskFolder) ? TaskService.Instance.RootFolder.SubFolders[TaskFolder] : null;
@@ -212,7 +212,7 @@ namespace ServerManagerTool.Common.Utils
taskDefinition.RegistrationInfo.Version = appVersion;
taskDefinition.Settings.ExecutionTimeLimit = TimeSpan.FromHours(EXECUTION_TIME_LIMIT);
- taskDefinition.Settings.Priority = ProcessPriorityClass.Normal;
+ taskDefinition.Settings.Priority = priority;
// Add/Edit the trigger that will fire every x minutes
var triggers = taskDefinition.Triggers.OfType();
@@ -278,12 +278,12 @@ namespace ServerManagerTool.Common.Utils
return false;
}
- public static bool ScheduleAutoShutdown(string taskKey, string taskSuffix, string command, TimeSpan? restartTime, string profileName, ShutdownType type)
+ public static bool ScheduleAutoShutdown(string taskKey, string taskSuffix, string command, TimeSpan? restartTime, string profileName, ShutdownType type, ProcessPriorityClass priority)
{
- return ScheduleAutoShutdown(taskKey, taskSuffix, command, restartTime, DaysOfTheWeek.AllDays, profileName, type);
+ return ScheduleAutoShutdown(taskKey, taskSuffix, command, restartTime, DaysOfTheWeek.AllDays, profileName, type, priority);
}
- public static bool ScheduleAutoShutdown(string taskKey, string taskSuffix, string command, TimeSpan? restartTime, DaysOfTheWeek daysOfTheWeek, string profileName, ShutdownType type)
+ public static bool ScheduleAutoShutdown(string taskKey, string taskSuffix, string command, TimeSpan? restartTime, DaysOfTheWeek daysOfTheWeek, string profileName, ShutdownType type, ProcessPriorityClass priority)
{
var taskName = GetScheduledTaskName(TaskType.AutoShutdown, taskKey, taskSuffix);
var taskFolder = TaskService.Instance.RootFolder.SubFolders.Exists(TaskFolder) ? TaskService.Instance.RootFolder.SubFolders[TaskFolder] : null;
@@ -336,7 +336,7 @@ namespace ServerManagerTool.Common.Utils
taskDefinition.RegistrationInfo.Version = appVersion;
taskDefinition.Settings.ExecutionTimeLimit = TimeSpan.FromHours(EXECUTION_TIME_LIMIT);
- taskDefinition.Settings.Priority = ProcessPriorityClass.Normal;
+ taskDefinition.Settings.Priority = priority;
// Add/Edit the trigger that will fire every day at the specified restart time
var triggers = taskDefinition.Triggers.OfType().ToList();
@@ -426,7 +426,7 @@ namespace ServerManagerTool.Common.Utils
return false;
}
- public static bool ScheduleAutoStart(string taskKey, string taskSuffix, bool enableAutoStart, string command, string profileName, bool onBoot)
+ public static bool ScheduleAutoStart(string taskKey, string taskSuffix, bool enableAutoStart, string command, string profileName, bool onBoot, ProcessPriorityClass priority)
{
var taskName = GetScheduledTaskName(TaskType.AutoStart, taskKey, taskSuffix);
var taskFolder = TaskService.Instance.RootFolder.SubFolders.Exists(TaskFolder) ? TaskService.Instance.RootFolder.SubFolders[TaskFolder] : null;
@@ -479,7 +479,7 @@ namespace ServerManagerTool.Common.Utils
taskDefinition.RegistrationInfo.Version = appVersion;
taskDefinition.Settings.ExecutionTimeLimit = TimeSpan.FromHours(EXECUTION_TIME_LIMIT);
- taskDefinition.Settings.Priority = ProcessPriorityClass.Normal;
+ taskDefinition.Settings.Priority = priority;
// Add a trigger that will fire after the machine has started
if (onBoot)
@@ -567,7 +567,7 @@ namespace ServerManagerTool.Common.Utils
return false;
}
- public static bool ScheduleAutoUpdate(string taskKey, string taskSuffix, string command, int autoUpdatePeriod)
+ public static bool ScheduleAutoUpdate(string taskKey, string taskSuffix, string command, int autoUpdatePeriod, ProcessPriorityClass priority)
{
var taskName = GetScheduledTaskName(TaskType.AutoUpdate, taskKey, taskSuffix);
var taskFolder = TaskService.Instance.RootFolder.SubFolders.Exists(TaskFolder) ? TaskService.Instance.RootFolder.SubFolders[TaskFolder] : null;
@@ -621,7 +621,7 @@ namespace ServerManagerTool.Common.Utils
taskDefinition.RegistrationInfo.Version = appVersion;
taskDefinition.Settings.ExecutionTimeLimit = TimeSpan.FromHours(EXECUTION_TIME_LIMIT);
- taskDefinition.Settings.Priority = ProcessPriorityClass.Normal;
+ taskDefinition.Settings.Priority = priority;
// Add/Edit the trigger that will fire every x minutes
var triggers = taskDefinition.Triggers.OfType();