public ChatCommand(string name, string description, string helptext, OnChatCommandDelegate handler, string permissionNode = "") { _name = name; _description = description; _helptext = helptext; _handler = handler; if (permissionNode != "") { _permission = permissionNode; } else { _permission = "chatcommand." + name; } }
public void RegisterChatCommand(string cmd, string description, string helptext, OnChatCommandDelegate handler, string permissionNode = "") { //if (ChatCommandsEnabled) { if (_chatCommands.ContainsKey(cmd)) { Log.Warning("[ChatCommands] Handler Exists for command: " + cmd); return; } ChatCommand chCommand = new ChatCommand(cmd, description, helptext, handler, permissionNode); _chatCommands.Add(cmd, chCommand); SDTM.API.Permissions.RegisterPermission("chatcommand." + cmd); //} }