diff --git a/src/Tgstation.Server.Host/Components/Session/ISessionController.cs b/src/Tgstation.Server.Host/Components/Session/ISessionController.cs index ccdaa448c4..a178e7c3c1 100644 --- a/src/Tgstation.Server.Host/Components/Session/ISessionController.cs +++ b/src/Tgstation.Server.Host/Components/Session/ISessionController.cs @@ -22,7 +22,7 @@ namespace Tgstation.Server.Host.Components.Session /// /// If the DreamDaemon instance sent a. /// - bool TerminationWasRequested { get; } + bool TerminationWasIntentional { get; } /// /// The DMAPI . diff --git a/src/Tgstation.Server.Host/Components/Session/SessionController.cs b/src/Tgstation.Server.Host/Components/Session/SessionController.cs index ad9bdf1728..2b0ec82db2 100644 --- a/src/Tgstation.Server.Host/Components/Session/SessionController.cs +++ b/src/Tgstation.Server.Host/Components/Session/SessionController.cs @@ -63,7 +63,7 @@ namespace Tgstation.Server.Host.Components.Session public Version? DMApiVersion { get; private set; } /// - public bool TerminationWasRequested { get; private set; } + public bool TerminationWasIntentional => terminationWasIntentional || (Lifetime.IsCompleted && Lifetime.Result == 0); /// public Task LaunchResult { get; } @@ -219,6 +219,11 @@ namespace Tgstation.Server.Host.Components.Session /// bool released; + /// + /// Backing field for overriding . + /// + bool terminationWasIntentional; + /// /// Initializes a new instance of the class. /// @@ -622,7 +627,7 @@ namespace Tgstation.Server.Host.Components.Session case BridgeCommandType.Kill: Logger.LogInformation("Bridge requested process termination!"); chatTrackingContext.Active = false; - TerminationWasRequested = true; + terminationWasIntentional = true; process.Terminate(); break; case BridgeCommandType.DeprecatedPortUpdate: diff --git a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs index 8494cc9aeb..8dfb10e412 100644 --- a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs +++ b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs @@ -113,12 +113,12 @@ namespace Tgstation.Server.Host.Components.Watchdog switch (reason) { case MonitorActivationReason.ActiveServerCrashed: - var eventType = controller.TerminationWasRequested || (await controller.Lifetime) == 0 + var eventType = controller.TerminationWasIntentional ? EventType.WorldEndProcess : EventType.WatchdogCrash; await HandleEventImpl(eventType, Enumerable.Empty(), false, cancellationToken); - var exitWord = controller.TerminationWasRequested ? "exited" : "crashed"; + var exitWord = controller.TerminationWasIntentional ? "exited" : "crashed"; if (controller.RebootState == Session.RebootState.Shutdown) { // the time for graceful shutdown is now