From 1e70e2d053a48d6154078374c48fac2f07edf7b6 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 15 Oct 2023 15:41:02 -0400 Subject: [PATCH] Handle OpenDream tripping over `PortBindTest` --- .../Components/Session/SessionControllerFactory.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs index 1168a37e8a..997e8b4e71 100644 --- a/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs +++ b/src/Tgstation.Server.Host/Components/Session/SessionControllerFactory.cs @@ -216,6 +216,8 @@ namespace Tgstation.Server.Host.Components.Session logger.LogTrace("Begin session launch..."); if (!launchParameters.Port.HasValue) throw new InvalidOperationException("Given port is null!"); + + PortBindTest(launchParameters.Port.Value); switch (dmbProvider.CompileJob.MinimumSecurityLevel) { case DreamDaemonSecurity.Ultrasafe: @@ -249,11 +251,11 @@ namespace Tgstation.Server.Host.Components.Session "Launching session with CompileJob {compileJobId}...", dmbProvider.CompileJob.Id); - PortBindTest(launchParameters.Port.Value); - // mad this isn't abstracted but whatever if (dmbProvider.EngineVersion.Engine.Value == EngineType.Byond) await CheckPagerIsNotRunning(); + else if (dmbProvider.EngineVersion.Engine.Value == EngineType.OpenDream) + await asyncDelayer.Delay(TimeSpan.FromMilliseconds(1), cancellationToken); // OpenDream is 2fuckingfast and can trip after we bind tested the port string outputFilePath = null; var preserveLogFile = true;