1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

implement script plugin command registration - issue #132

This commit is contained in:
RaidMax
2020-05-11 16:10:43 -05:00
parent 0e2e739281
commit 46fee97e4e
11 changed files with 301 additions and 6 deletions

View File

@ -0,0 +1,11 @@
using System;
namespace SharedLibraryCore.Exceptions
{
public class PluginException : Exception
{
public PluginException(string message) : base(message) { }
public string PluginFile { get; set; }
}
}

View File

@ -70,5 +70,15 @@ namespace SharedLibraryCore.Interfaces
/// </summary>
/// <param name="gameEvent">event to be processed</param>
void AddEvent(GameEvent gameEvent);
/// <summary>
/// adds an additional (script) command to the command list
/// </summary>
/// <param name="command"></param>
void AddAdditionalCommand(IManagerCommand command);
/// <summary>
/// removes a command by its name
/// </summary>
/// <param name="name">name of command</param>
void RemoveCommandByName(string name);
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
namespace SharedLibraryCore.Interfaces
{
/// <summary>
/// defines capabilities of script command factory
/// </summary>
public interface IScriptCommandFactory
{
/// <summary>
/// generate a new script command from parsed source
/// </summary>
/// <param name="name">name of command</param>
/// <param name="alias">alias of command</param>
/// <param name="description">description of command</param>
/// <param name="permission">minimum required permission</param>
/// <param name="args">command arguments (name, is required)</param>
/// <param name="executeAction">action to peform when commmand is executed</param>
/// <returns></returns>
IManagerCommand CreateScriptCommand(string name, string alias, string description, string permission, IEnumerable<(string, bool)> args, Action<GameEvent> executeAction);
}
}