mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-29 08:00:19 +01:00
V2
This commit is contained in:
@@ -111,6 +111,12 @@ namespace Tgstation.Server.Host.Components.Events
|
||||
/// Before the watchdog launches. No parameters.
|
||||
/// </summary>
|
||||
[EventScript("WatchdogLaunch")]
|
||||
WatchdogLaunch
|
||||
WatchdogLaunch,
|
||||
|
||||
/// <summary>
|
||||
/// Inbetween DD restarts if the process has been force-ended by the DMAPI (TgsEndProcess())
|
||||
/// </summary>
|
||||
[EventScript("WorldEndProcess")]
|
||||
WorldEndProcess,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<string>(), cancellationToken).ConfigureAwait(false);
|
||||
|
||||
string exitWord = Server.TerminationWasRequested ? "exited" : "crashed";
|
||||
if (Server.RebootState == Session.RebootState.Shutdown)
|
||||
{
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
|
||||
/// <summary>
|
||||
/// The <see cref="IEventConsumer"/> that is not the <see cref="WatchdogBase"/>
|
||||
/// </summary>
|
||||
readonly IEventConsumer eventConsumer;
|
||||
public IEventConsumer eventConsumer;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IRemoteDeploymentManagerFactory"/> for the <see cref="WatchdogBase"/>.
|
||||
|
||||
Reference in New Issue
Block a user