alias für managefactionranks

This commit is contained in:
hydrant
2020-03-25 20:18:18 +01:00
parent 2f70a60c22
commit d90f59f43a
2 changed files with 10 additions and 2 deletions

View File

@@ -49,7 +49,13 @@ namespace ReallifeGamemode.Server
.Where(m => m.GetCustomAttributes(typeof(CommandAttribute), false).Length > 0)
.ToArray();
var registeredCommands = methods.Select(c => c.GetCustomAttribute<CommandAttribute>().CommandString);
var cmdAttributes = methods.Select(c => c.GetCustomAttribute<CommandAttribute>()).ToList();
var registeredCommands = cmdAttributes.Select(c => c.CommandString).ToList();
cmdAttributes.Where(c => c.Alias?.Any() ?? false).ToList().ForEach(a =>
{
registeredCommands.AddRange(a.Alias.Split(','));
});
IAPI apiInstance = new RageAPI();
eventHandler = new EventHandler(apiInstance);