Implemented basic plugin store and improved plugin system

This commit is contained in:
Marcel Baumgartner
2023-07-23 21:30:57 +02:00
parent 21bea974a9
commit 0658e55a78
14 changed files with 288 additions and 15 deletions

View File

@@ -25,6 +25,7 @@ using Moonlight.App.Services.Interop;
using Moonlight.App.Services.Mail;
using Moonlight.App.Services.Minecraft;
using Moonlight.App.Services.Notifications;
using Moonlight.App.Services.Plugins;
using Moonlight.App.Services.Sessions;
using Moonlight.App.Services.Statistics;
using Moonlight.App.Services.SupportChat;
@@ -110,6 +111,9 @@ namespace Moonlight
var builder = WebApplication.CreateBuilder(args);
var pluginService = new PluginService();
await pluginService.BuildServices(builder.Services);
// Switch to logging.net injection
// TODO: Enable in production
builder.Logging.ClearProviders();
@@ -208,6 +212,7 @@ namespace Moonlight
builder.Services.AddScoped<PopupService>();
builder.Services.AddScoped<SubscriptionService>();
builder.Services.AddScoped<BillingService>();
builder.Services.AddSingleton<PluginStoreService>();
builder.Services.AddScoped<SessionClientService>();
builder.Services.AddSingleton<SessionServerService>();
@@ -239,7 +244,8 @@ namespace Moonlight
builder.Services.AddSingleton<MalwareScanService>();
builder.Services.AddSingleton<TelemetryService>();
builder.Services.AddSingleton<TempMailService>();
builder.Services.AddSingleton<PluginService>();
builder.Services.AddSingleton(pluginService);
// Other
builder.Services.AddSingleton<MoonlightService>();
@@ -290,8 +296,7 @@ namespace Moonlight
_ = app.Services.GetRequiredService<MalwareScanService>();
_ = app.Services.GetRequiredService<TelemetryService>();
_ = app.Services.GetRequiredService<TempMailService>();
_ = app.Services.GetRequiredService<PluginService>();
_ = app.Services.GetRequiredService<MoonlightService>();
// Discord bot service