![]() |
TrinityCore
|
#include <ChatCommand.h>
Public Member Functions | |
| ChatCommandNode ()=default | |
| ~ChatCommandNode ()=default | |
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 const &other)=delete | |
| ChatCommandNode (ChatCommandNode &&other) noexcept=default | |
| ChatCommandNode & | operator= (ChatCommandNode const &other)=delete |
| ChatCommandNode & | operator= (ChatCommandNode &&other) noexcept=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, std::span< ChatCommandBuilder 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 177 of file ChatCommand.h.
|
private |
Definition at line 180 of file ChatCommand.h.
|
default |
|
default |
|
privatedelete |
|
privatedefaultnoexcept |
|
static |
Definition at line 385 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 80 of file ChatCommand.cpp.
References COMMAND_MAP.
|
private |
Definition at line 481 of file ChatCommand.cpp.
Referenced by IsVisible().
|
static |
Definition at line 86 of file ChatCommand.cpp.
References COMMAND_MAP.
Referenced by Trinity::ChatCommands::InvalidateCommandMap().
|
private |
Definition at line 472 of file ChatCommand.cpp.
References ChatHandler::HasPermission(), ChatHandler::IsConsole(), and Trinity::ChatCommands::No.
Referenced by IsVisible(), and TryExecuteCommand().
|
inlineprivate |
Definition at line 205 of file ChatCommand.h.
References HasVisibleSubCommands(), and IsInvokerVisible().
|
static |
Definition at line 87 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 58 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, Trinity::ChatCommands::ChatCommandBuilder::InvokerEntry::_help, _invoker, Trinity::ChatCommands::ChatCommandBuilder::InvokerEntry::_invoker, _permission, Trinity::ChatCommands::ChatCommandBuilder::InvokerEntry::_permissions, _subCommands, ASSERT, and LoadCommandsIntoMap().
Referenced by LoadCommandsIntoMap().
|
privatedefaultnoexcept |
|
privatedelete |
|
private |
Definition at line 135 of file ChatCommand.cpp.
References Trinity::Impl::ChatCommands::COMMAND_DELIMITER, and TC_LOG_WARN.
|
private |
Definition at line 182 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 323 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 256 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 179 of file ChatCommand.h.
|
private |
Definition at line 212 of file ChatCommand.h.
Referenced by LoadCommandMap(), and LoadFromBuilder().
|
private |
Definition at line 210 of file ChatCommand.h.
Referenced by LoadFromBuilder(), and TryExecuteCommand().
|
private |
Definition at line 209 of file ChatCommand.h.
Referenced by SendCommandHelpFor(), and TryExecuteCommand().
|
private |
Definition at line 211 of file ChatCommand.h.
Referenced by LoadFromBuilder(), and TryExecuteCommand().
|
private |
Definition at line 213 of file ChatCommand.h.
Referenced by GetAutoCompletionsFor(), LoadCommandMap(), LoadFromBuilder(), SendCommandHelpFor(), and TryExecuteCommand().