diff --git a/Torch.Server/Initializer.cs b/Torch.Server/Initializer.cs
index ab1a920..e13aaf0 100644
--- a/Torch.Server/Initializer.cs
+++ b/Torch.Server/Initializer.cs
@@ -144,9 +144,12 @@ quit";
var gameThread = new Thread(() =>
{
_server.Init();
-
- if (_config.Autostart)
+
+ if (_config.Autostart || _config.TempAutostart)
+ {
+ _config.TempAutostart = false;
_server.Start();
+ }
});
gameThread.Start();
diff --git a/Torch.Server/TorchConfig.cs b/Torch.Server/TorchConfig.cs
index 4223532..f1a6ab7 100644
--- a/Torch.Server/TorchConfig.cs
+++ b/Torch.Server/TorchConfig.cs
@@ -62,10 +62,17 @@ namespace Torch.Server
[XmlIgnore, Arg("forceupdate", "Manually check for and install updates.")]
public bool ForceUpdate { get; set; }
- ///
- [Arg("autostart", "Start the server immediately.")]
+ ///
+ /// Permanent flag to ALWAYS automatically start the server
+ ///
public bool Autostart { get; set; }
+ ///
+ /// Temporary flag to automatically start the server only on the next run
+ ///
+ [Arg("autostart", "Start the server immediately.")]
+ public bool TempAutostart { get; set; }
+
///
[Arg("restartoncrash", "Automatically restart the server if it crashes.")]
public bool RestartOnCrash { get; set; }
diff --git a/Torch.Server/TorchServer.cs b/Torch.Server/TorchServer.cs
index fdd8952..72235f9 100644
--- a/Torch.Server/TorchServer.cs
+++ b/Torch.Server/TorchServer.cs
@@ -212,7 +212,7 @@ namespace Torch.Server
string exe = Assembly.GetExecutingAssembly().Location;
Debug.Assert(exe != null);
config.WaitForPID = Process.GetCurrentProcess().Id.ToString();
- config.Autostart = true;
+ config.TempAutostart = true;
Process.Start(exe, config.ToString());
Process.GetCurrentProcess().Kill();