mirror of
https://gitea.tendokyu.moe/Kayori/Medusa.net.git
synced 2026-09-27 01:00:40 +03:00
24 lines
740 B
C#
24 lines
740 B
C#
using Abstractions;
|
|
|
|
namespace Server.Plugins;
|
|
|
|
public sealed class PluginSlot(
|
|
PluginLoadContext context,
|
|
IMedusaPlugin plugin,
|
|
IReadOnlyList<Type> handlerTypes,
|
|
IServiceProvider pluginServices)
|
|
{
|
|
public PluginLoadContext Context => context;
|
|
public IMedusaPlugin Plugin => plugin;
|
|
public IReadOnlyList<Type> HandlerTypes => handlerTypes;
|
|
public PluginSlotKey Key => new(plugin.GameCode, plugin.MinVer, plugin.MaxVer);
|
|
|
|
/// <summary>Mini service provider built from the plugin's ConfigurePluginServices call.</summary>
|
|
public IServiceProvider PluginServices => pluginServices;
|
|
|
|
public void Unload()
|
|
{
|
|
context.Unload();
|
|
if (pluginServices is IDisposable d) d.Dispose();
|
|
}
|
|
} |