Fix global event scripts

This commit is contained in:
Jordan Dominion
2024-11-08 17:49:05 -05:00
parent 2e93ddb0db
commit 7f06abcd8e
2 changed files with 11 additions and 3 deletions
@@ -794,13 +794,20 @@ namespace Tgstation.Server.Host.Components.StaticFiles
var tasks = directories.Select<string, ValueTask>(
async scriptDirectory =>
{
var files = await ioManager.GetFilesWithExtension(scriptDirectory, platformIdentifier.ScriptFileExtension, false, cancellationToken);
var resolvedScriptsDir = ioManager.ResolvePath(scriptDirectory);
logger.LogTrace("Checking for scripts in {directory}...", scriptDirectory);
var files = await ioManager.GetFilesWithExtension(scriptDirectory, platformIdentifier.ScriptFileExtension, false, cancellationToken);
var scriptFiles = files
.Select(x => ioManager.ConcatPath(resolvedScriptsDir, ioManager.GetFileName(x)))
.Select(ioManager.GetFileName)
.Where(x => scriptNames.Any(
scriptName => x.StartsWith(scriptName, StringComparison.Ordinal)));
scriptName => x.StartsWith(scriptName, StringComparison.Ordinal)))
.Select(x =>
{
var fullScriptPath = ioManager.ConcatPath(resolvedScriptsDir, x);
logger.LogTrace("Found matching script: {scriptPath}", fullScriptPath);
return fullScriptPath;
});
lock (allScripts)
allScripts.AddRange(scriptFiles);
@@ -19,6 +19,7 @@ General:
OpenDreamGitUrl: https://github.com/OpenDreamProject/OpenDream # The repository to retrieve OpenDream from
OpenDreamGitTagPrefix: v # The prefix to the OpenDream semver as tags appear in the git repository
OpenDreamSuppressInstallOutput: false # Suppress the dotnet output of creating an OpenDream installation. Known to cause hangs in CI.
AdditionalEventScriptsDirectories: # An array of directories that are considered to contain EventScripts alongside instance directories. Working directory will remain the instance EventScripts directory.
Session:
HighPriorityLiveDreamDaemon: false # If DreamDaemon instances should run as higher priority processes
LowPriorityDeploymentProcesses: true # If TGS Deployments should run as lower priority processes