Fixes most commands.

This commit is contained in:
hondacrx
2022-06-11 21:09:48 -04:00
parent 130444d893
commit e0025794a5
31 changed files with 1275 additions and 928 deletions
+17 -5
View File
@@ -23,10 +23,22 @@ namespace Game.Chat
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public class CommandAttribute : Attribute
{
public CommandAttribute(string command)
{
Name = command.ToLower();
}
public CommandAttribute(string command, RBACPermissions rbac, bool allowConsole = false)
{
Name = command.ToLower();
Help = "";
RBAC = rbac;
AllowConsole = allowConsole;
}
public CommandAttribute(string command, CypherStrings help, RBACPermissions rbac, bool allowConsole = false)
{
Name = command.ToLower();
Help = help;
RBAC = rbac;
AllowConsole = allowConsole;
}
@@ -37,9 +49,9 @@ namespace Game.Chat
public string Name { get; private set; }
/// <summary>
/// Help text for command.
/// Help String for command.
/// </summary>
public string Help { get; set; }
public CypherStrings Help { get; set; }
/// <summary>
/// Allow Console?
@@ -55,13 +67,13 @@ namespace Game.Chat
[AttributeUsage(AttributeTargets.Class)]
public class CommandGroupAttribute : CommandAttribute
{
//todo fix me.
public CommandGroupAttribute(string command) : base(command, RBACPermissions.Max, true) { }
public CommandGroupAttribute(string command) : base(command) { }
}
[AttributeUsage(AttributeTargets.Method)]
public class CommandNonGroupAttribute : CommandAttribute
{
public CommandNonGroupAttribute(string command, CypherStrings help, RBACPermissions rbac, bool allowConsole = false) : base(command, help, rbac, allowConsole) { }
public CommandNonGroupAttribute(string command, RBACPermissions rbac, bool allowConsole = false) : base(command, rbac, allowConsole) { }
}
}