35 : m_services( services )
61 std::string reason =
"Commands: ";
63 std::map<std::string, CommandRecord *>::const_iterator cur =
m_commands.begin();
66 reason +=
"'" + cur->second->command +
"',";
72 std::map<std::string, CommandRecord*>::const_iterator itr =
m_commands.find( sep.
arg( 0 ) );
74 _log(COMMAND__ERROR,
"Unable to find command '%s' for %s", sep.
arg( 0 ).c_str(), from->
GetName() );
83 throw CustomError (
"Access denied to command '%s'", sep.
arg (0).c_str ());
91 std::map<std::string, CommandRecord*>::iterator itr =
m_commands.find( cmd );
99 sLog.Green(
" EVEmu",
"Currently Loaded %u Commands:",
m_commands.size());
100 std::map<std::string, CommandDispatcher::CommandRecord*>::iterator itr =
m_commands.begin();
102 sLog.Magenta(
" Call and Role",
"%s - %p (%li)",
103 itr->first.c_str(), itr->second->required_role, itr->second->required_role);
int64 GetAccountRole() const
#define _log(type, fmt,...)
const std::string & arg(size_t index) const
CommandDispatcher(PyServiceMgr &services)
PyResult Execute(Client *from, const char *msg)
UserError & AddFormatValue(const char *name, PyRep *value)
Fluent version of the protected AddKeyword, allows for adding a keyword to the exception.
Separates string to arguments.
Advanced version of UserError that allows to send a full custom message.
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
#define sLog
Evaluates to a NewLog instance.
void AddCommand(const char *cmd, const char *desc, int64 required_role, CommandFunc function)
virtual ~CommandDispatcher()
std::map< std::string, CommandRecord * > m_commands
PyServiceMgr & m_services
const char * GetName() const
Python object "ccp_exceptions.UserError".