From d6ead4fddec9bf85c8940ba33cb8fa0553137979 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Tue, 25 Sep 2018 13:46:50 -0400 Subject: [PATCH] SessionControllers now manage chatJsonTrackingContext.Active --- .../Components/Watchdog/ISessionController.cs | 5 +++++ .../Components/Watchdog/SessionController.cs | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/Tgstation.Server.Host/Components/Watchdog/ISessionController.cs b/src/Tgstation.Server.Host/Components/Watchdog/ISessionController.cs index 97e19b271d..6b21bbd6ca 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/ISessionController.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/ISessionController.cs @@ -88,5 +88,10 @@ namespace Tgstation.Server.Host.Components.Watchdog /// Changes to without telling the DMAPI /// void ResetRebootState(); + + /// + /// Enables the reading of custom chat commands from the + /// + void EnableCustomChatCommands(); } } diff --git a/src/Tgstation.Server.Host/Components/Watchdog/SessionController.cs b/src/Tgstation.Server.Host/Components/Watchdog/SessionController.cs index eeacaa941a..bd46ebea5c 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/SessionController.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/SessionController.cs @@ -200,6 +200,8 @@ namespace Tgstation.Server.Host.Components.Watchdog rebootTcs = new TaskCompletionSource(); + process.Lifetime.ContinueWith(x => chatJsonTrackingContext.Active = false, TaskScheduler.Current); + async Task GetLaunchResult() { var startTime = DateTimeOffset.Now; @@ -353,6 +355,7 @@ namespace Tgstation.Server.Host.Components.Watchdog case Constants.DMCommandWorldReboot: if (ClosePortOnReboot) { + chatJsonTrackingContext.Active = false; content = new Dictionary { { Constants.DMParameterData, 0 } }; portClosedForReboot = true; } @@ -386,6 +389,9 @@ namespace Tgstation.Server.Host.Components.Watchdog throw new ObjectDisposedException(nameof(SessionController)); } + /// + public void EnableCustomChatCommands() => chatJsonTrackingContext.Active = true; + /// public ReattachInformation Release() {