From 2945713386c8559d123449912ae2bdcae4fe3294 Mon Sep 17 00:00:00 2001 From: Jordan Brown Date: Sat, 18 Aug 2018 01:31:09 -0400 Subject: [PATCH] DreamDaemonController fixes --- .../Controllers/DreamDaemonController.cs | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs b/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs index 5e81eab21b..323b60d631 100644 --- a/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs +++ b/src/Tgstation.Server.Host/Controllers/DreamDaemonController.cs @@ -104,14 +104,14 @@ namespace Tgstation.Server.Host.Controllers var llp = dd.LastLaunchParameters; var rstate = dd.RebootState; result.AutoStart = settings.AutoStart; - result.CurrentPort = alphaActive ? llp.PrimaryPort : llp.SecondaryPort; - result.CurrentSecurity = llp.SecurityLevel; - result.CurrentAllowWebclient = llp.AllowWebClient; - result.PrimaryPort = dd.ActiveLaunchParameters.PrimaryPort; - result.AllowWebClient = dd.ActiveLaunchParameters.AllowWebClient; + result.CurrentPort = alphaActive ? llp?.PrimaryPort : llp?.SecondaryPort; + result.CurrentSecurity = llp?.SecurityLevel; + result.CurrentAllowWebclient = llp?.AllowWebClient; + result.PrimaryPort = settings.PrimaryPort; + result.AllowWebClient = settings.AllowWebClient; result.Running = dd.Running; - result.SecondaryPort = llp.SecondaryPort; - result.SecurityLevel = llp.SecurityLevel; + result.SecondaryPort = settings.SecondaryPort; + result.SecurityLevel = settings.SecurityLevel; result.SoftRestart = rstate == RebootState.Restart; result.SoftShutdown = rstate == RebootState.Shutdown; }; @@ -167,14 +167,14 @@ namespace Tgstation.Server.Host.Controllers var oldSoftRestart = current.SoftRestart; var oldSoftShutdown = current.SoftShutdown; - if (!CheckModified(x => x.AllowWebClient, DreamDaemonRights.SetWebClient) - || !CheckModified(x => x.AutoStart, DreamDaemonRights.SetAutoStart) - || !CheckModified(x => x.PrimaryPort, DreamDaemonRights.SetPorts) - || !CheckModified(x => x.SecondaryPort, DreamDaemonRights.SetPorts) - || !CheckModified(x => x.SecurityLevel, DreamDaemonRights.SetSecurity) - || !CheckModified(x => x.SoftRestart, DreamDaemonRights.SoftRestart) - || !CheckModified(x => x.SoftShutdown, DreamDaemonRights.SoftShutdown) - || !CheckModified(x => x.StartupTimeout, DreamDaemonRights.SetStartupTimeout)) + if (CheckModified(x => x.AllowWebClient, DreamDaemonRights.SetWebClient) + || CheckModified(x => x.AutoStart, DreamDaemonRights.SetAutoStart) + || CheckModified(x => x.PrimaryPort, DreamDaemonRights.SetPorts) + || CheckModified(x => x.SecondaryPort, DreamDaemonRights.SetPorts) + || CheckModified(x => x.SecurityLevel, DreamDaemonRights.SetSecurity) + || CheckModified(x => x.SoftRestart, DreamDaemonRights.SoftRestart) + || CheckModified(x => x.SoftShutdown, DreamDaemonRights.SoftShutdown) + || CheckModified(x => x.StartupTimeout, DreamDaemonRights.SetStartupTimeout)) return Forbid(); if (current.SecurityLevel == DreamDaemonSecurity.Ultrasafe)