mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 04:57:17 +01:00
Fix chat message for exit code 0 sessions
This commit is contained in:
@@ -22,7 +22,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
/// <summary>
|
||||
/// If the DreamDaemon instance sent a.
|
||||
/// </summary>
|
||||
bool TerminationWasRequested { get; }
|
||||
bool TerminationWasIntentional { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The DMAPI <see cref="Session.ApiValidationStatus"/>.
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
public Version? DMApiVersion { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool TerminationWasRequested { get; private set; }
|
||||
public bool TerminationWasIntentional => terminationWasIntentional || (Lifetime.IsCompleted && Lifetime.Result == 0);
|
||||
|
||||
/// <inheritdoc />
|
||||
public Task<LaunchResult> LaunchResult { get; }
|
||||
@@ -219,6 +219,11 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
/// </summary>
|
||||
bool released;
|
||||
|
||||
/// <summary>
|
||||
/// Backing field for overriding <see cref="TerminationWasIntentional"/>.
|
||||
/// </summary>
|
||||
bool terminationWasIntentional;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SessionController"/> class.
|
||||
/// </summary>
|
||||
@@ -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:
|
||||
|
||||
@@ -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<string>(), 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
|
||||
|
||||
Reference in New Issue
Block a user