From 422b1268ca05cbff5cf60215c7f9298f77afdfcb Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 1 Jun 2022 16:45:31 -0400 Subject: [PATCH] Dont store the room list in RoomHelper --- ProjectLighthouse/Configuration/ServerStatics.cs | 4 ++-- ProjectLighthouse/Match/Rooms/RoomHelper.cs | 2 +- ProjectLighthouse/StartupTasks.cs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ProjectLighthouse/Configuration/ServerStatics.cs b/ProjectLighthouse/Configuration/ServerStatics.cs index f432b5ce..8e87417d 100644 --- a/ProjectLighthouse/Configuration/ServerStatics.cs +++ b/ProjectLighthouse/Configuration/ServerStatics.cs @@ -28,9 +28,9 @@ public static class ServerStatics public static bool IsUnitTesting => AppDomain.CurrentDomain.GetAssemblies().Any(assembly => assembly.FullName!.StartsWith("xunit")); #if DEBUG - public static readonly bool IsDebug = true; + public const bool IsDebug = true; #else - public static readonly bool IsDebug = false; + public const bool IsDebug = false; #endif /// diff --git a/ProjectLighthouse/Match/Rooms/RoomHelper.cs b/ProjectLighthouse/Match/Rooms/RoomHelper.cs index 9d4f18e4..4e09d5ea 100644 --- a/ProjectLighthouse/Match/Rooms/RoomHelper.cs +++ b/ProjectLighthouse/Match/Rooms/RoomHelper.cs @@ -16,7 +16,7 @@ namespace LBPUnion.ProjectLighthouse.Match.Rooms; public class RoomHelper { - public static readonly StorableList Rooms = RoomStore.GetRooms(); + public static StorableList Rooms => RoomStore.GetRooms(); public static void StartCleanupThread() { diff --git a/ProjectLighthouse/StartupTasks.cs b/ProjectLighthouse/StartupTasks.cs index 51656fd1..4e439aa6 100644 --- a/ProjectLighthouse/StartupTasks.cs +++ b/ProjectLighthouse/StartupTasks.cs @@ -33,7 +33,7 @@ public static class StartupTasks Logger.Info($"Welcome to the Project Lighthouse {serverType.ToString()}!", LogArea.Startup); Logger.Info($"You are running version {VersionHelper.FullVersion}", LogArea.Startup); - // Referencing ServerSettings.Instance here loads the config, see ServerSettings.cs for more information + // Referencing ServerConfiguration.Instance here loads the config, see ServerConfiguration.cs for more information Logger.Success("Loaded config file version " + ServerConfiguration.Instance.ConfigVersion, LogArea.Startup); Logger.Info("Connecting to the database...", LogArea.Startup); @@ -44,7 +44,7 @@ public static class StartupTasks } else { - Logger.Success("Connected!", LogArea.Startup); + Logger.Success("Connected to the database!", LogArea.Startup); } if (!dbConnected) Environment.Exit(1); @@ -95,7 +95,7 @@ public static class StartupTasks Logger.Success($"Ready! Startup took {stopwatch.ElapsedMilliseconds}ms. Passing off control to ASP.NET...", LogArea.Startup); } - private static void migrateDatabase(Database database) + private static void migrateDatabase(DbContext database) { Stopwatch stopwatch = new(); stopwatch.Start();