Added third party library loading and execution

This commit is contained in:
clodan
2025-02-25 17:35:34 +00:00
parent 4999b80172
commit aca6446d5c
39 changed files with 294 additions and 268 deletions
+2 -2
View File
@@ -31,12 +31,12 @@ public static class Program
// validate and sort mods, this will also discard any mods that are invalid
var sortedLoadedMods = ValidateMods(mods);
// for harmony we use the original list, as some mods may only be bepinex patches only
HarmonyBootstrapper.LoadAllPatches(mods.Select(asm => asm.Assembly).ToList());
HarmonyBootstrapper.LoadAllPatches(mods.SelectMany(asm => asm.Assemblies).ToList());
// register SPT components
DependencyInjectionRegistrator.RegisterSptComponents(typeof(Program).Assembly, typeof(App).Assembly, builder.Services);
// register mod components from the filtered list
DependencyInjectionRegistrator.RegisterModOverrideComponents(builder.Services, sortedLoadedMods.Select(a => a.Assembly).ToList());
DependencyInjectionRegistrator.RegisterModOverrideComponents(builder.Services, sortedLoadedMods.SelectMany(a => a.Assemblies).ToList());
var logger = new SerilogLoggerProvider(registeredLogger).CreateLogger("Server");
try
{