mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 07:13:58 -05:00
support for loading minimum permission level from config for script commands
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
namespace SharedLibraryCore.Commands
|
||||
using SharedLibraryCore.Interfaces;
|
||||
|
||||
namespace SharedLibraryCore.Commands
|
||||
{
|
||||
public static class CommandExtensions
|
||||
{
|
||||
@ -11,5 +13,17 @@
|
||||
{
|
||||
return gameEvent.Origin?.Level > gameEvent.Target?.Level;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// determines the command configuration name for given manager command
|
||||
/// </summary>
|
||||
/// <param name="command">command to determine config name for</param>
|
||||
/// <returns></returns>
|
||||
public static string CommandConfigNameForType(this IManagerCommand command)
|
||||
{
|
||||
return command.GetType().Name is "ScriptCommand"
|
||||
? $"{char.ToUpper(command.Name[0])}{command.Name[1..]}Command"
|
||||
: command.GetType().Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user