diff --git a/Projects/Server/Configuration/ServerConfiguration.cs b/Projects/Server/Configuration/ServerConfiguration.cs index 15e44f823..3672438d5 100644 --- a/Projects/Server/Configuration/ServerConfiguration.cs +++ b/Projects/Server/Configuration/ServerConfiguration.cs @@ -44,7 +44,7 @@ public static class ServerConfiguration _settings.Settings.TryGetValue(key, out var value) ? new ClientVersion(value) : defaultValue; public static string GetSetting(string key, string defaultValue) => - _settings.Settings.TryGetValue(key, out var value) ? value : defaultValue; + _settings.Settings.GetValueOrDefault(key, defaultValue); public static int GetSetting(string key, int defaultValue) { diff --git a/Projects/Server/Main.cs b/Projects/Server/Main.cs index 863d9f9e8..2276a8b20 100644 --- a/Projects/Server/Main.cs +++ b/Projects/Server/Main.cs @@ -455,14 +455,16 @@ public static class Core public static void RunEventLoop() { - try - { #if DEBUG - const bool idleCPU = true; + const bool isDebugMode = true; #else - var idleCPU = ServerConfiguration.GetOrUpdateSetting("core.enableIdleCPU", false); + const bool isDebugMode = false; #endif + var idleCPU = ServerConfiguration.GetSetting("core.enableIdleCPU", isDebugMode); + + try + { var cycleCount = _cyclesPerSecond.Length; var last = _tickCount; const int interval = 100;