Upgraded mooncore versions. Cleaned up code, especially startup code. Changed versions

This commit is contained in:
2025-10-05 16:07:27 +00:00
parent d2ef59d171
commit 9ab69ffef5
43 changed files with 429 additions and 632 deletions

View File

@@ -18,7 +18,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MoonCore.PluginFramework" Version="1.0.8" />
<PackageReference Include="MoonCore.PluginFramework" Version="1.0.9" />
</ItemGroup>
<Import Project="Plugins.props" />

View File

@@ -1,28 +1,25 @@
using Moonlight.ApiServer.Runtime;
using Moonlight.ApiServer.Configuration;
using Moonlight.ApiServer.Runtime;
using Moonlight.ApiServer.Startup;
var pluginLoader = new PluginLoader();
pluginLoader.Initialize();
/*
await startup.Run(args, pluginLoader.Instances);
*/
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();
@@ -31,5 +28,7 @@ if (cs.Configuration.Frontend.EnableHosting)
app.UseStaticFiles();
}
app.MapMoonlight(pluginLoader.Instances);
await app.RunAsync();