diff --git a/src/ARKServerManager/Globalization/en-US/en-US.xaml b/src/ARKServerManager/Globalization/en-US/en-US.xaml index 7a3e8c46..c6a9f118 100644 --- a/src/ARKServerManager/Globalization/en-US/en-US.xaml +++ b/src/ARKServerManager/Globalization/en-US/en-US.xaml @@ -1213,6 +1213,8 @@ Additional command-line args for the server launcher. Use this with caution! For more information search 'Microsoft Start Command' on the internet. Override Launcher If enabled, the RunServer.cmd file will only contain what is included in the Launcher Args field. + Prefix Launcher + If enabled, the RunServer.cmd file will include the Launcher Args field before the server start (will allow other files to be executed before the server is started). Server Args: Additional command-line args for the server. If you specify this, add the args which start with ?'s first, followed by any other args. For example: ?MaxPlayers=5?QueryPort=9999 -nosteamclient Show Command... diff --git a/src/ARKServerManager/Lib/ServerProfile.cs b/src/ARKServerManager/Lib/ServerProfile.cs index 45196802..be4f86f9 100644 --- a/src/ARKServerManager/Lib/ServerProfile.cs +++ b/src/ARKServerManager/Lib/ServerProfile.cs @@ -828,6 +828,14 @@ namespace ServerManagerTool.Lib set { SetValue(AdditionalArgsProperty, value); } } + public static readonly DependencyProperty LauncherArgsProperty = DependencyProperty.Register(nameof(LauncherArgs), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty)); + [DataMember] + public string LauncherArgs + { + get { return (string)GetValue(LauncherArgsProperty); } + set { SetValue(LauncherArgsProperty, value); } + } + public static readonly DependencyProperty LauncherArgsOverrideProperty = DependencyProperty.Register(nameof(LauncherArgsOverride), typeof(bool), typeof(ServerProfile), new PropertyMetadata(false)); [DataMember] public bool LauncherArgsOverride @@ -836,12 +844,12 @@ namespace ServerManagerTool.Lib set { SetValue(LauncherArgsOverrideProperty, value); } } - public static readonly DependencyProperty LauncherArgsProperty = DependencyProperty.Register(nameof(LauncherArgs), typeof(string), typeof(ServerProfile), new PropertyMetadata(String.Empty)); + public static readonly DependencyProperty LauncherArgsPrefixProperty = DependencyProperty.Register(nameof(LauncherArgsPrefix), typeof(bool), typeof(ServerProfile), new PropertyMetadata(false)); [DataMember] - public string LauncherArgs + public bool LauncherArgsPrefix { - get { return (string)GetValue(LauncherArgsProperty); } - set { SetValue(LauncherArgsProperty, value); } + get { return (bool)GetValue(LauncherArgsPrefixProperty); } + set { SetValue(LauncherArgsPrefixProperty, value); } } #endregion @@ -3488,7 +3496,7 @@ namespace ServerManagerTool.Lib private void CheckLauncherArgs() { // do not process if overriding the launcher args - if (this.LauncherArgsOverride) + if (this.LauncherArgsOverride || this.LauncherArgsPrefix) return; var launcherArgs = LauncherArgs?.ToLower() ?? string.Empty; @@ -4357,6 +4365,11 @@ namespace ServerManagerTool.Lib } else { + if (this.LauncherArgsPrefix && !string.IsNullOrWhiteSpace(this.LauncherArgs)) + { + commandArgs.AppendLine(this.LauncherArgs); + } + commandArgs.Append("start"); commandArgs.Append($" \"{this.ProfileName}\""); diff --git a/src/ARKServerManager/UserControls/ServerSettingsControl.xaml b/src/ARKServerManager/UserControls/ServerSettingsControl.xaml index 434953fb..52f2f030 100644 --- a/src/ARKServerManager/UserControls/ServerSettingsControl.xaml +++ b/src/ARKServerManager/UserControls/ServerSettingsControl.xaml @@ -1366,6 +1366,7 @@ + @@ -1384,11 +1385,13 @@