Fix some watchdog issues

This commit is contained in:
Jordan Brown
2018-09-22 19:24:59 -04:00
parent c828c5f637
commit fed4b92675
2 changed files with 5 additions and 4 deletions
+2 -3
View File
@@ -222,14 +222,13 @@
export_lock = FALSE
/datum/tgs_api/v4/OnReboot()
var/json = Export(TGS4_COMM_WORLD_REBOOT)
var/list/result = json_decode(json)
var/list/result = Export(TGS4_COMM_WORLD_REBOOT)
if(!result)
return
//okay so the standard TGS4 proceedure is: right before rebooting change the port to whatever was sent to us in the above json's data parameter
var/port = json[TGS4_PARAMETER_DATA]
var/port = result[TGS4_PARAMETER_DATA]
if(!isnum(port))
return //this is valid, server may just want use to reboot
@@ -713,9 +713,11 @@ namespace Tgstation.Server.Host.Components.Watchdog
await Task.WhenAny(allTask, cancelTcs.Task).ConfigureAwait(false);
cancellationToken.ThrowIfCancellationRequested();
//both servers are now running, alpha is the active server, huzzah
//both servers are now running, alpha is the active server(unless reattach), huzzah
AlphaIsActive = doReattach ? reattachInfo?.AlphaIsActive ?? true : true;
LastLaunchResult = alphaLrt.Result;
(AlphaIsActive ? alphaServer : bravoServer).ClosePortOnReboot = true;
logger.LogInformation("Launched servers successfully");
Running = true;