implement PluginV2 for script plugins

This commit is contained in:
RaidMax
2023-04-04 18:24:13 -05:00
parent ad20572879
commit fab3cf95d6
33 changed files with 1659 additions and 1026 deletions

View File

@ -13,4 +13,4 @@ namespace SharedLibraryCore.Interfaces
Task OnEventAsync(GameEvent gameEvent, Server server);
Task OnTickAsync(Server S);
}
}
}

View File

@ -18,6 +18,6 @@ namespace SharedLibraryCore.Interfaces
/// discovers the script plugins
/// </summary>
/// <returns>initialized script plugin collection</returns>
IEnumerable<IPlugin> DiscoverScriptPlugins();
IEnumerable<(Type, string)> DiscoverScriptPlugins();
}
}

View File

@ -0,0 +1,11 @@
using Microsoft.Extensions.DependencyInjection;
namespace SharedLibraryCore.Interfaces;
public interface IPluginV2 : IModularAssembly
{
static void RegisterDependencies(IServiceCollection serviceProvider)
{
}
}

View File

@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Data.Models;
using SharedLibraryCore.Commands;
namespace SharedLibraryCore.Interfaces
{
@ -18,11 +20,11 @@ namespace SharedLibraryCore.Interfaces
/// <param name="permission">minimum required permission</param>
/// <param name="isTargetRequired">target required or not</param>
/// <param name="args">command arguments (name, is required)</param>
/// <param name="executeAction">action to peform when commmand is executed</param>
/// <param name="executeAction">action to perform when command is executed</param>
/// <param name="supportedGames"></param>
/// <returns></returns>
IManagerCommand CreateScriptCommand(string name, string alias, string description, string permission,
bool isTargetRequired, IEnumerable<(string, bool)> args, Func<GameEvent, Task> executeAction,
Server.Game[] supportedGames);
bool isTargetRequired, IEnumerable<CommandArgument> args, Func<GameEvent, Task> executeAction,
IEnumerable<Reference.Game> supportedGames);
}
}

View File

@ -0,0 +1,8 @@
using System;
namespace SharedLibraryCore.Interfaces;
public interface IScriptPluginFactory
{
object CreateScriptPlugin(Type type, string fileName);
}