mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-26 14:37:44 +01:00
Add a seperate event for unexpected DreamDaemon exits
This commit is contained in:
+4
-3
@@ -97,10 +97,11 @@
|
||||
#define TGS_EVENT_WATCHDOG_DETACH 16
|
||||
// We don't actually implement these 3 events as the DMAPI can never receive them.
|
||||
// #define TGS_EVENT_WATCHDOG_LAUNCH 17
|
||||
// #define TGS_EVENT_WORLD_END_PROCESS 18
|
||||
// #define TGS_EVENT_WORLD_DEL 19
|
||||
// #define TGS_EVENT_WATCHDOG_CRASH 18
|
||||
// #define TGS_EVENT_WORLD_END_PROCESS 19
|
||||
// #define TGS_EVENT_WORLD_DEL 20
|
||||
/// Watchdog event when TgsInitializationComplete() is called. No parameters.
|
||||
#define TGS_EVENT_WORLD_PRIME 20
|
||||
#define TGS_EVENT_WORLD_PRIME 21
|
||||
|
||||
// OTHER ENUMS
|
||||
|
||||
|
||||
@@ -113,6 +113,12 @@ namespace Tgstation.Server.Host.Components.Events
|
||||
[EventScript("WatchdogLaunch")]
|
||||
WatchdogLaunch,
|
||||
|
||||
/// <summary>
|
||||
/// Watchdog event when DreamDaemon exits unexpectedly. No parameters.
|
||||
/// </summary>
|
||||
[EventScript("WatchdogLaunch")]
|
||||
WatchdogCrash,
|
||||
|
||||
/// <summary>
|
||||
/// In between watchdog DreamDaemon restarts if the process has been force-ended by the DMAPI (TgsEndProcess()). No parameters.
|
||||
/// </summary>
|
||||
|
||||
@@ -92,10 +92,12 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
switch (reason)
|
||||
{
|
||||
case MonitorActivationReason.ActiveServerCrashed:
|
||||
if (Server.TerminationWasRequested)
|
||||
await EventConsumer.HandleEvent(EventType.WorldEndProcess, Enumerable.Empty<string>(), cancellationToken).ConfigureAwait(false);
|
||||
var eventType = Server.TerminationWasRequested
|
||||
? EventType.WorldEndProcess
|
||||
: EventType.WatchdogCrash;
|
||||
await EventConsumer.HandleEvent(eventType, Enumerable.Empty<string>(), cancellationToken).ConfigureAwait(false);
|
||||
|
||||
string exitWord = Server.TerminationWasRequested ? "exited" : "crashed";
|
||||
var exitWord = Server.TerminationWasRequested ? "exited" : "crashed";
|
||||
if (Server.RebootState == Session.RebootState.Shutdown)
|
||||
{
|
||||
// the time for graceful shutdown is now
|
||||
|
||||
Reference in New Issue
Block a user