Add DreamDaemonPreLaunch event

This commit is contained in:
Jordan Dominion
2025-02-07 18:01:58 -05:00
parent e0eb59c5b5
commit 3f350aa6db
2 changed files with 15 additions and 1 deletions
@@ -173,5 +173,11 @@
/// </summary>
[EventScript("EngineInstallComplete")]
EngineInstallComplete,
/// <summary>
/// Before game server process is created. No parameters.
/// </summary>
[EventScript("DreamDaemonPreLaunch")]
DreamDaemonPreLaunch,
}
}
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading;
@@ -516,6 +517,14 @@ namespace Tgstation.Server.Host.Components.Session
? logFilePath
: null);
// If this isnt a staging DD (From a Deployment), fire off events
if (!apiValidate)
await eventConsumer.HandleEvent(
EventType.DreamDaemonPreLaunch,
Enumerable.Empty<string?>(),
false,
cancellationToken);
var process = await processExecutor.LaunchProcess(
engineLock.ServerExePath,
dmbProvider.Directory,
@@ -539,7 +548,6 @@ namespace Tgstation.Server.Host.Components.Session
if (!engineLock.HasStandardOutput)
networkPromptReaper.RegisterProcess(process);
// If this isnt a staging DD (From a Deployment), fire off an event
if (!apiValidate)
await eventConsumer.HandleEvent(
EventType.DreamDaemonLaunch,