From fed4b92675a7e53efa0dab2e674545f0178f1ae0 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 22 Sep 2018 19:24:59 -0400 Subject: [PATCH] Fix some watchdog issues --- src/DMAPI/tgs/v4/api.dm | 5 ++--- src/Tgstation.Server.Host/Components/Watchdog/Watchdog.cs | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/DMAPI/tgs/v4/api.dm b/src/DMAPI/tgs/v4/api.dm index b5bc692f11..9edc4970e9 100644 --- a/src/DMAPI/tgs/v4/api.dm +++ b/src/DMAPI/tgs/v4/api.dm @@ -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 diff --git a/src/Tgstation.Server.Host/Components/Watchdog/Watchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/Watchdog.cs index 1baed19018..f2c1f12673 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/Watchdog.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/Watchdog.cs @@ -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;