Cleanup AppContext

This commit is contained in:
Archangel
2025-05-29 19:03:18 +02:00
committed by Jesse
parent 6f3244362c
commit c930197942
7 changed files with 14 additions and 35 deletions
+2 -6
View File
@@ -42,6 +42,8 @@ public static class Program
}
diHandler.InjectAll();
builder.Services.AddSingleton(builder);
builder.Services.AddSingleton<IReadOnlyList<SptMod>>(loadedMods);
var serviceProvider = builder.Services.BuildServiceProvider();
var logger = serviceProvider.GetService<ILoggerFactory>().CreateLogger("Server");
@@ -66,12 +68,6 @@ public static class Program
}
}
// Add the Loaded Mod Assemblies for later
appContext?.AddValue(ContextVariableType.LOADED_MOD_ASSEMBLIES, loadedMods);
// This is the builder that will get use by the HttpServer to start up the web application
appContext?.AddValue(ContextVariableType.APP_BUILDER, builder);
// Get the Built app and run it
var app = serviceProvider.GetService<App>();
app?.Run().Wait();