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:
11
SharedLibraryCore/Exceptions/PluginException.cs
Normal file
11
SharedLibraryCore/Exceptions/PluginException.cs
Normal 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; }
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
23
SharedLibraryCore/Interfaces/IScriptCommandFactory.cs
Normal file
23
SharedLibraryCore/Interfaces/IScriptCommandFactory.cs
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user