diff --git a/src/Tgstation.Server.Host/Configuration/InternalConfiguration.cs b/src/Tgstation.Server.Host/Configuration/InternalConfiguration.cs index 315cdad35c..832041deba 100644 --- a/src/Tgstation.Server.Host/Configuration/InternalConfiguration.cs +++ b/src/Tgstation.Server.Host/Configuration/InternalConfiguration.cs @@ -1,6 +1,4 @@ -#nullable disable - -namespace Tgstation.Server.Host.Configuration +namespace Tgstation.Server.Host.Configuration { /// /// Unstable configuration options used internally by TGS. @@ -15,12 +13,12 @@ namespace Tgstation.Server.Host.Configuration /// /// The name of the pipe opened by the host watchdog for sending commands, if any. /// - public string CommandPipe { get; set; } + public string? CommandPipe { get; set; } /// /// The name of the pipe opened by the host watchdog for receiving commands, if any. /// - public string ReadyPipe { get; set; } + public string? ReadyPipe { get; set; } /// /// If the server is running under SystemD. @@ -30,7 +28,7 @@ namespace Tgstation.Server.Host.Configuration /// /// The base path for the app settings configuration files. /// - public string AppSettingsBasePath { get; set; } + public string? AppSettingsBasePath { get; set; } /// /// Coerce the to select . @@ -40,6 +38,6 @@ namespace Tgstation.Server.Host.Configuration /// /// Generate default configuration using the given default password. /// - public string MariaDBDefaultRootPassword { get; set; } + public string? MariaDBDefaultRootPassword { get; set; } } } diff --git a/src/Tgstation.Server.Host/Core/CommandPipeManager.cs b/src/Tgstation.Server.Host/Core/CommandPipeManager.cs index fce8fa9ccd..298e6c28ca 100644 --- a/src/Tgstation.Server.Host/Core/CommandPipeManager.cs +++ b/src/Tgstation.Server.Host/Core/CommandPipeManager.cs @@ -65,22 +65,24 @@ namespace Tgstation.Server.Host.Core logger.LogTrace("Starting..."); // grab both pipes asap so we can close them on error - var supportsPipeCommands = !String.IsNullOrWhiteSpace(internalConfiguration.CommandPipe); + var commandPipe = internalConfiguration.CommandPipe; + var supportsPipeCommands = !String.IsNullOrWhiteSpace(commandPipe); await using var commandPipeClient = supportsPipeCommands ? new AnonymousPipeClientStream( PipeDirection.In, - internalConfiguration.CommandPipe) + commandPipe!) : null; if (!supportsPipeCommands) logger.LogDebug("No command pipe name specified in configuration"); - var supportsReadyNotification = !String.IsNullOrWhiteSpace(internalConfiguration.ReadyPipe); + var readyPipe = internalConfiguration.ReadyPipe; + var supportsReadyNotification = !String.IsNullOrWhiteSpace(readyPipe); if (supportsReadyNotification) { await using var readyPipeClient = new AnonymousPipeClientStream( PipeDirection.Out, - internalConfiguration.ReadyPipe); + readyPipe!); logger.LogTrace("Waiting to send ready notification..."); await instanceManager.Ready.WaitAsync(cancellationToken);