Fixes for 2017-11-17 major
This commit is contained in:
@@ -45,7 +45,9 @@ quit";
|
||||
if (_init)
|
||||
return false;
|
||||
|
||||
#if !DEBUG
|
||||
AppDomain.CurrentDomain.UnhandledException += HandleException;
|
||||
#endif
|
||||
|
||||
if (!args.Contains("-noupdate"))
|
||||
RunSteamCmd();
|
||||
@@ -61,11 +63,11 @@ quit";
|
||||
var pid = int.Parse(_config.WaitForPID);
|
||||
var waitProc = Process.GetProcessById(pid);
|
||||
Log.Info("Continuing in 5 seconds.");
|
||||
Thread.Sleep(5000);
|
||||
if (!waitProc.HasExited)
|
||||
Log.Warn($"Waiting for process {pid} to close");
|
||||
while (!waitProc.HasExited)
|
||||
{
|
||||
Log.Warn($"Killing old process {pid}.");
|
||||
waitProc.Kill();
|
||||
Console.Write(".");
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -163,6 +163,7 @@ namespace Torch.Server
|
||||
Log.Info("Starting server.");
|
||||
|
||||
MySandboxGame.IsDedicated = true;
|
||||
MySandboxGame.ConfigDedicated = DedicatedInstance.DedicatedConfig.Model;
|
||||
Environment.SetEnvironmentVariable("SteamAppId", MyPerServerSettings.AppId.ToString());
|
||||
|
||||
VRage.Service.ExitListenerSTA.OnExit += delegate { MySandboxGame.Static?.Exit(); };
|
||||
@@ -309,6 +310,7 @@ namespace Torch.Server
|
||||
var exe = Assembly.GetExecutingAssembly().Location;
|
||||
((TorchConfig)Config).WaitForPID = Process.GetCurrentProcess().Id.ToString();
|
||||
Process.Start(exe, Config.ToString());
|
||||
Stop();
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
|
@@ -193,7 +193,7 @@ namespace Torch
|
||||
/// <param name="action"></param>
|
||||
public void Invoke(Action action)
|
||||
{
|
||||
MySandboxGame.Static.Invoke(action);
|
||||
MySandboxGame.Static.Invoke(action, "Torch");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -240,7 +240,7 @@ namespace Torch
|
||||
{
|
||||
e.Set();
|
||||
}
|
||||
});
|
||||
}, "Torch");
|
||||
|
||||
if (!e.WaitOne(60000))
|
||||
throw new TimeoutException("The game action timed out.");
|
||||
|
Reference in New Issue
Block a user