diff --git a/src/Tgstation.Server.Host/Components/Events/EventType.cs b/src/Tgstation.Server.Host/Components/Events/EventType.cs
index 9085c6e215..4e20113171 100644
--- a/src/Tgstation.Server.Host/Components/Events/EventType.cs
+++ b/src/Tgstation.Server.Host/Components/Events/EventType.cs
@@ -111,6 +111,12 @@ namespace Tgstation.Server.Host.Components.Events
/// Before the watchdog launches. No parameters.
///
[EventScript("WatchdogLaunch")]
- WatchdogLaunch
+ WatchdogLaunch,
+
+ ///
+ /// Inbetween DD restarts if the process has been force-ended by the DMAPI (TgsEndProcess())
+ ///
+ [EventScript("WorldEndProcess")]
+ WorldEndProcess,
}
}
diff --git a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs
index c364a8cf65..4a83eab388 100644
--- a/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs
+++ b/src/Tgstation.Server.Host/Components/Watchdog/BasicWatchdog.cs
@@ -1,6 +1,7 @@
using Microsoft.Extensions.Logging;
using System;
using System.Globalization;
+using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Tgstation.Server.Api.Models.Internal;
@@ -91,6 +92,9 @@ namespace Tgstation.Server.Host.Components.Watchdog
switch (reason)
{
case MonitorActivationReason.ActiveServerCrashed:
+ if (Server.TerminationWasRequested)
+ await eventConsumer.HandleEvent(EventType.WorldEndProcess, Enumerable.Empty(), cancellationToken).ConfigureAwait(false);
+
string exitWord = Server.TerminationWasRequested ? "exited" : "crashed";
if (Server.RebootState == Session.RebootState.Shutdown)
{
diff --git a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs
index 5a24b01076..e1c8336752 100644
--- a/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs
+++ b/src/Tgstation.Server.Host/Components/Watchdog/WatchdogBase.cs
@@ -121,7 +121,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
///
/// The that is not the
///
- readonly IEventConsumer eventConsumer;
+ public IEventConsumer eventConsumer;
///
/// The for the .