This commit is contained in:
rfi
2024-02-22 00:25:19 +07:00
parent 9b6673138e
commit b232088f4d
8 changed files with 18 additions and 18 deletions

View File

@@ -3,10 +3,10 @@ using System.Text;
namespace BLHX.Server.Game.Commands;
[commandHandler("help", "Print out all commands with their description and example", "help")]
[CommandHandler("help", "Print out all commands with their description and example", "help")]
public class HelpCommand : Command
{
static readonly Dictionary<Type, commandHandler?> commandAttributes = new Dictionary<Type, commandHandler?>();
static readonly Dictionary<Type, CommandHandler?> commandAttributes = new Dictionary<Type, CommandHandler?>();
public override void Execute(Dictionary<string, string> args)
{
@@ -15,11 +15,11 @@ public class HelpCommand : Command
StringBuilder sb = new StringBuilder();
sb.AppendLine("Available Commands: ");
foreach (var command in CommandHandler.Commands)
foreach (var command in CommandHandlerFactory.Commands)
{
if (!commandAttributes.TryGetValue(command.GetType(), out var attr))
{
attr = command.GetType().GetCustomAttribute(typeof(commandHandler)) as commandHandler;
attr = command.GetType().GetCustomAttribute(typeof(CommandHandler)) as CommandHandler;
commandAttributes[command.GetType()] = attr;
}