From 0efb64cb369b9e28e07a4e06b750a143b83465fe Mon Sep 17 00:00:00 2001 From: jvyden Date: Sun, 15 May 2022 21:08:06 -0400 Subject: [PATCH] Only convert assets on website startup, rename GameApi -> GameServer --- ProjectLighthouse.Servers.GameServer/Program.cs | 2 +- ProjectLighthouse/Startup/DebugWarmupLifetime.cs | 2 +- ProjectLighthouse/StartupTasks.cs | 6 +++++- ProjectLighthouse/Types/ServerType.cs | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Servers.GameServer/Program.cs b/ProjectLighthouse.Servers.GameServer/Program.cs index 4917b122..35acb397 100644 --- a/ProjectLighthouse.Servers.GameServer/Program.cs +++ b/ProjectLighthouse.Servers.GameServer/Program.cs @@ -10,7 +10,7 @@ public static class Program { public static void Main(string[] args) { - StartupTasks.Run(args, ServerType.GameApi); + StartupTasks.Run(args, ServerType.GameServer); CreateHostBuilder(args).Build().Run(); } diff --git a/ProjectLighthouse/Startup/DebugWarmupLifetime.cs b/ProjectLighthouse/Startup/DebugWarmupLifetime.cs index 2cbef0fd..0af030c3 100644 --- a/ProjectLighthouse/Startup/DebugWarmupLifetime.cs +++ b/ProjectLighthouse/Startup/DebugWarmupLifetime.cs @@ -41,7 +41,7 @@ public class DebugWarmupLifetime : IHostLifetime string url = ServerType switch { - ServerType.GameApi => ServerConfiguration.Instance.GameApiListenUrl, + ServerType.GameServer => ServerConfiguration.Instance.GameApiListenUrl, ServerType.Website => ServerConfiguration.Instance.WebsiteListenUrl, ServerType.Api => ServerConfiguration.Instance.ApiListenUrl, _ => throw new ArgumentOutOfRangeException(), diff --git a/ProjectLighthouse/StartupTasks.cs b/ProjectLighthouse/StartupTasks.cs index a9ba4ab5..100c3fc1 100644 --- a/ProjectLighthouse/StartupTasks.cs +++ b/ProjectLighthouse/StartupTasks.cs @@ -78,7 +78,11 @@ public static class StartupTasks return; } - if (ServerConfiguration.Instance.WebsiteConfiguration.ConvertAssetsOnStartup) FileHelper.ConvertAllTexturesToPng(); + if (ServerConfiguration.Instance.WebsiteConfiguration.ConvertAssetsOnStartup + && serverType == ServerType.Website) + { + FileHelper.ConvertAllTexturesToPng(); + } Logger.Info("Starting room cleanup thread...", LogArea.Startup); RoomHelper.StartCleanupThread(); diff --git a/ProjectLighthouse/Types/ServerType.cs b/ProjectLighthouse/Types/ServerType.cs index c23e38c4..4d677fe3 100644 --- a/ProjectLighthouse/Types/ServerType.cs +++ b/ProjectLighthouse/Types/ServerType.cs @@ -2,7 +2,7 @@ namespace LBPUnion.ProjectLighthouse.Types; public enum ServerType { - GameApi = 0, + GameServer = 0, Website = 1, Api = 2, } \ No newline at end of file