From cb287cafbf66986b790194aaa8dc6416e5ab2916 Mon Sep 17 00:00:00 2001 From: Vasilis Date: Wed, 26 Jun 2024 03:28:53 +0300 Subject: [PATCH] Launch arguments feature (#30) * Launch arguments feature I wanted to delay round start only for the first server start but i found another bug in content... may as well commit this for anyone who needs it and when i fix it * Review --- .../Components/ServerManagement/ServerInstance.Actor.cs | 7 +++++++ SS14.Watchdog/Configuration/InstanceConfiguration.cs | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/SS14.Watchdog/Components/ServerManagement/ServerInstance.Actor.cs b/SS14.Watchdog/Components/ServerManagement/ServerInstance.Actor.cs index b6a2a4b..884ecbf 100644 --- a/SS14.Watchdog/Components/ServerManagement/ServerInstance.Actor.cs +++ b/SS14.Watchdog/Components/ServerManagement/ServerInstance.Actor.cs @@ -336,6 +336,13 @@ private async Task StartServer(CancellationToken cancel) "--config-file", Path.Combine(InstanceDir, "config.toml"), "--data-dir", Path.Combine(InstanceDir, "data"), }; + + // Prepare the user provided arguments + foreach (var arg in _instanceConfig.Arguments) + { + args.Add(arg); + } + var env = new List<(string, string)>(); foreach (var (envVar, value) in _instanceConfig.EnvironmentVariables) diff --git a/SS14.Watchdog/Configuration/InstanceConfiguration.cs b/SS14.Watchdog/Configuration/InstanceConfiguration.cs index d836d17..f5518e0 100644 --- a/SS14.Watchdog/Configuration/InstanceConfiguration.cs +++ b/SS14.Watchdog/Configuration/InstanceConfiguration.cs @@ -22,6 +22,11 @@ public sealed class InstanceConfiguration ? "bin/Robust.Server.exe" : "bin/Robust.Server"; + /// + /// User arguments to pass to the server process. + /// + public List Arguments { get; set; } = []; + /// /// Make a heap dump if the server is killed due to timeout. Only supported on Linux. ///