14#include <unordered_map>
59 bool IsForeign(std::string_view name)
const;
61 size_t Count()
const {
return _commands.size(); }
89 std::unordered_map<std::string, CommandDefinition> _commands;
91 std::unordered_map<std::string, std::string> _aliases;
The one thing command dispatch needs a running server for.
The registered commands, their usage lines, and the dispatch that runs one.
CommandRouter(const Policy &policy, Translations &translations)
void Dispatch(const CommandDefinition &def, Player *caller, std::span< const std::string > tokens, Origin origin, ArgBinder &binder, const std::function< void(const std::string &)> &say) const
const CommandDefinition * Find(std::string_view name) const
const CommandDefinition * Add(CommandDefinition def)
std::string Usage(const CommandDefinition &def, int slot, Origin origin) const
bool IsForeign(std::string_view name) const
void Attach(IPluginContext *host)
One connected player, owned by PlayerManager for the length of the connection.
The one permission and targeting gate, plus the plugin's reply callback.
Localization system. Loads one JSON file per language; nested objects flatten into dotted keys (categ...
@ Chat
Chat box line (color escapes honored).
static std::string ReadFile(const std::filesystem::path &path)
std::map< std::string, std::string > Tokens
One command as the builder assembled it.