implement PluginV2 for script plugins
This commit is contained in:
@ -13,4 +13,4 @@ namespace SharedLibraryCore.Interfaces
|
||||
Task OnEventAsync(GameEvent gameEvent, Server server);
|
||||
Task OnTickAsync(Server S);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
11
SharedLibraryCore/Interfaces/IPluginV2.cs
Normal file
11
SharedLibraryCore/Interfaces/IPluginV2.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace SharedLibraryCore.Interfaces;
|
||||
|
||||
|
||||
public interface IPluginV2 : IModularAssembly
|
||||
{
|
||||
static void RegisterDependencies(IServiceCollection serviceProvider)
|
||||
{
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
8
SharedLibraryCore/Interfaces/IScriptPluginFactory.cs
Normal file
8
SharedLibraryCore/Interfaces/IScriptPluginFactory.cs
Normal file
@ -0,0 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace SharedLibraryCore.Interfaces;
|
||||
|
||||
public interface IScriptPluginFactory
|
||||
{
|
||||
object CreateScriptPlugin(Type type, string fileName);
|
||||
}
|
Reference in New Issue
Block a user