![]() |
TrinityCore
|
#include <ChatCommand.h>
Public Member Functions | |
| ChatCommandNode () | |
Static Public Member Functions | |
| static void | LoadCommandMap () |
| static void | InvalidateCommandMap () |
| static bool | TryExecuteCommand (ChatHandler &handler, std::string_view cmd) |
| static void | SendCommandHelpFor (ChatHandler &handler, std::string_view cmd) |
| static std::vector< std::string > | GetAutoCompletionsFor (ChatHandler const &handler, std::string_view cmd) |
Private Types | |
| using | ChatCommandBuilder = Trinity::ChatCommands::ChatCommandBuilder |
Private Member Functions | |
| void | LoadFromBuilder (ChatCommandBuilder const &builder) |
| ChatCommandNode (ChatCommandNode &&other)=default | |
| void | ResolveNames (std::string name) |
| void | SendCommandHelp (ChatHandler &handler) const |
| bool | IsVisible (ChatHandler const &who) const |
| bool | IsInvokerVisible (ChatHandler const &who) const |
| bool | HasVisibleSubCommands (ChatHandler const &who) const |
Static Private Member Functions | |
| static std::map< std::string_view, ChatCommandNode, StringCompareLessI_T > const & | GetTopLevelMap () |
| static void | LoadCommandsIntoMap (ChatCommandNode *blank, std::map< std::string_view, ChatCommandNode, StringCompareLessI_T > &map, Trinity::ChatCommands::ChatCommandTable const &commands) |
Private Attributes | |
| std::string | _name |
| CommandInvoker | _invoker |
| CommandPermissions | _permission |
| std::variant< std::monostate, TrinityStrings, std::string > | _help |
| std::map< std::string_view, ChatCommandNode, StringCompareLessI_T > | _subCommands |
Friends | |
| struct | FilteredCommandListIterator |
Definition at line 178 of file ChatCommand.h.
|
private |
Definition at line 181 of file ChatCommand.h.
|
inline |
Definition at line 190 of file ChatCommand.h.
|
privatedefault |
|
static |
Definition at line 372 of file ChatCommand.cpp.
References _subCommands, ASSERT, Trinity::Impl::ChatCommands::COMMAND_DELIMITER, StringEqualI(), Trinity::StringFormat(), and Trinity::Impl::ChatCommands::tokenize().
Referenced by Trinity::ChatCommands::GetAutoCompletionsFor().
|
staticprivate |
Definition at line 68 of file ChatCommand.cpp.
References COMMAND_MAP.
|
private |
Definition at line 472 of file ChatCommand.cpp.
Referenced by IsVisible().
|
static |
Definition at line 74 of file ChatCommand.cpp.
References COMMAND_MAP.
Referenced by Trinity::ChatCommands::InvalidateCommandMap().
|
private |
Definition at line 463 of file ChatCommand.cpp.
References ChatHandler::HasPermission(), ChatHandler::IsConsole(), and Trinity::ChatCommands::No.
Referenced by IsVisible(), and TryExecuteCommand().
|
inlineprivate |
Definition at line 202 of file ChatCommand.h.
References HasVisibleSubCommands(), and IsInvokerVisible().
|
static |
Definition at line 75 of file ChatCommand.cpp.
References _help, _subCommands, Trinity::Impl::ChatCommands::COMMAND_DELIMITER, COMMAND_MAP, Field::GetStringView(), sScriptMgr, TC_LOG_ERROR, Trinity::Tokenize(), WORLD_SEL_COMMANDS, and WorldDatabase.
Referenced by Trinity::ChatCommands::LoadCommandMap().
|
staticprivate |
Definition at line 46 of file ChatCommand.cpp.
References ASSERT, Trinity::Impl::ChatCommands::COMMAND_DELIMITER, LoadFromBuilder(), STRING_VIEW_FMT, STRING_VIEW_FMT_ARG, and Trinity::Tokenize().
Referenced by LoadFromBuilder().
|
private |
Definition at line 32 of file ChatCommand.cpp.
References Trinity::ChatCommands::ChatCommandBuilder::_data, _help, _invoker, _permission, _subCommands, ASSERT, and LoadCommandsIntoMap().
Referenced by LoadCommandsIntoMap().
|
private |
Definition at line 123 of file ChatCommand.cpp.
References Trinity::Impl::ChatCommands::COMMAND_DELIMITER, and TC_LOG_WARN.
|
private |
Definition at line 169 of file ChatCommand.cpp.
References LANG_CMD_HELP_GENERIC, LANG_CMD_NO_HELP_AVAILABLE, LANG_SUBCMDS_LIST, LANG_SUBCMDS_LIST_ENTRY, LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS, ChatHandler::PSendSysMessage(), ChatHandler::SendSysMessage(), and STRING_VIEW_FMT_ARG.
Referenced by SendCommandHelpFor(), and TryExecuteCommand().
|
static |
Definition at line 310 of file ChatCommand.cpp.
References _name, _subCommands, Trinity::Impl::ChatCommands::COMMAND_DELIMITER, LANG_AVAILABLE_CMDS, LANG_CMD_AMBIGUOUS, LANG_CMD_INVALID, LANG_SUBCMD_AMBIGUOUS, LANG_SUBCMD_INVALID, LANG_SUBCMDS_LIST_ENTRY, LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS, ChatHandler::PSendSysMessage(), SendCommandHelp(), ChatHandler::SendSysMessage(), STRING_VIEW_FMT_ARG, StringEqualI(), and Trinity::Tokenize().
Referenced by Trinity::ChatCommands::SendCommandHelpFor().
|
static |
Definition at line 243 of file ChatCommand.cpp.
References _invoker, _name, _permission, _subCommands, ASSERT, Trinity::Impl::ChatCommands::COMMAND_DELIMITER, ChatHandler::GetSession(), ChatHandler::HasSentErrorMessage(), ChatHandler::IsConsole(), IsInvokerVisible(), LANG_CMD_AMBIGUOUS, LANG_SUBCMD_AMBIGUOUS, LANG_SUBCMDS_LIST_ENTRY, LANG_SUBCMDS_LIST_ENTRY_ELLIPSIS, LogCommandUsage(), ChatHandler::PSendSysMessage(), Trinity::Impl::ChatCommands::CommandPermissions::RequiredPermission, SendCommandHelp(), ChatHandler::SetSentErrorMessage(), STRING_VIEW_FMT_ARG, StringEqualI(), and Trinity::Impl::ChatCommands::tokenize().
Referenced by Trinity::ChatCommands::TryExecuteCommand().
|
friend |
Definition at line 180 of file ChatCommand.h.
|
private |
Definition at line 209 of file ChatCommand.h.
Referenced by LoadCommandMap(), and LoadFromBuilder().
|
private |
Definition at line 207 of file ChatCommand.h.
Referenced by LoadFromBuilder(), and TryExecuteCommand().
|
private |
Definition at line 206 of file ChatCommand.h.
Referenced by SendCommandHelpFor(), and TryExecuteCommand().
|
private |
Definition at line 208 of file ChatCommand.h.
Referenced by LoadFromBuilder(), and TryExecuteCommand().
|
private |
Definition at line 210 of file ChatCommand.h.
Referenced by GetAutoCompletionsFor(), LoadCommandMap(), LoadFromBuilder(), SendCommandHelpFor(), and TryExecuteCommand().