Only convert assets on website startup, rename GameApi -> GameServer

This commit is contained in:
jvyden 2022-05-15 21:08:06 -04:00
parent a733eb21a4
commit 0efb64cb36
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278
4 changed files with 8 additions and 4 deletions

View file

@ -10,7 +10,7 @@ public static class Program
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
StartupTasks.Run(args, ServerType.GameApi); StartupTasks.Run(args, ServerType.GameServer);
CreateHostBuilder(args).Build().Run(); CreateHostBuilder(args).Build().Run();
} }

View file

@ -41,7 +41,7 @@ public class DebugWarmupLifetime : IHostLifetime
string url = ServerType switch string url = ServerType switch
{ {
ServerType.GameApi => ServerConfiguration.Instance.GameApiListenUrl, ServerType.GameServer => ServerConfiguration.Instance.GameApiListenUrl,
ServerType.Website => ServerConfiguration.Instance.WebsiteListenUrl, ServerType.Website => ServerConfiguration.Instance.WebsiteListenUrl,
ServerType.Api => ServerConfiguration.Instance.ApiListenUrl, ServerType.Api => ServerConfiguration.Instance.ApiListenUrl,
_ => throw new ArgumentOutOfRangeException(), _ => throw new ArgumentOutOfRangeException(),

View file

@ -78,7 +78,11 @@ public static class StartupTasks
return; 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); Logger.Info("Starting room cleanup thread...", LogArea.Startup);
RoomHelper.StartCleanupThread(); RoomHelper.StartCleanupThread();

View file

@ -2,7 +2,7 @@ namespace LBPUnion.ProjectLighthouse.Types;
public enum ServerType public enum ServerType
{ {
GameApi = 0, GameServer = 0,
Website = 1, Website = 1,
Api = 2, Api = 2,
} }