Upgraded mooncore. Done required refactoring to function with new version

This commit is contained in:
2025-10-20 19:27:31 +00:00
parent 85392208c4
commit f6b71f4de6
51 changed files with 239 additions and 224 deletions

View File

@@ -14,8 +14,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.9" />
<PackageReference Include="MoonCore.PluginFramework" Version="1.0.8"/>
<PackageReference Include="MoonCore.PluginFramework.Generator" Version="1.0.2"/>
<PackageReference Include="MoonCore.PluginFramework" Version="1.0.9"/>
<PackageReference Include="MoonCore.PluginFramework.Generator" Version="1.0.3"/>
</ItemGroup>
<ItemGroup>

View File

@@ -1,24 +1,25 @@
using Moonlight.ApiServer.Configuration;
using Moonlight.ApiServer.Startup;
using MoonlightServers.ApiServer.Runtime;
var pluginLoader = new DevPluginLoader();
pluginLoader.Initialize();
var cs = new Startup();
await cs.InitializeAsync(args, pluginLoader.Instances);
var builder = WebApplication.CreateBuilder(args);
await cs.AddMoonlightAsync(builder);
builder.AddMoonlight(pluginLoader.Instances);
var app = builder.Build();
await cs.AddMoonlightAsync(app);
app.UseMoonlight(pluginLoader.Instances);
// Add frontend
var configuration = AppConfiguration.CreateEmpty();
builder.Configuration.Bind(configuration);
// Handle setup of wasm app hosting in the runtime
// so the Moonlight.ApiServer doesn't need the wasm package
if (cs.Configuration.Frontend.EnableHosting)
if (configuration.Frontend.EnableHosting)
{
if (app.Environment.IsDevelopment())
app.UseWebAssemblyDebugging();
@@ -27,5 +28,7 @@ if (cs.Configuration.Frontend.EnableHosting)
app.UseStaticFiles();
}
app.MapMoonlight(pluginLoader.Instances);
await app.RunAsync();