Re-implemented server state machine. Cleaned up code

TODO: Handle trigger errors
This commit is contained in:
2025-02-12 23:02:00 +01:00
parent 4088bfaef5
commit f45699f300
44 changed files with 913 additions and 831 deletions

View File

@@ -249,8 +249,8 @@ public class Startup
private Task RegisterServers()
{
WebApplicationBuilder.Services.AddHostedService<ApplicationStateService>(
sp => sp.GetRequiredService<ApplicationStateService>()
WebApplicationBuilder.Services.AddHostedService(
sp => sp.GetRequiredService<ServerService>()
);
return Task.CompletedTask;
@@ -263,7 +263,7 @@ public class Startup
#endregion
#region Maps
#region Hubs
private Task RegisterSignalR()
{
@@ -273,7 +273,7 @@ public class Startup
private Task MapHubs()
{
WebApplication.MapHub<ServerConsoleHub>("api/servers/console");
WebApplication.MapHub<ServerWebSocketHub>("api/servers/ws");
return Task.CompletedTask;
}
@@ -286,7 +286,7 @@ public class Startup
{
//TODO: IMPORTANT: CHANGE !!!
WebApplicationBuilder.Services.AddCors(x =>
x.AddDefaultPolicy(builder =>
x.AddDefaultPolicy(builder =>
builder.AllowAnyHeader().AllowAnyOrigin().AllowAnyMethod().Build()
)
);