bool CommandParser::IsValidCommand(const std::string &commandname, int pcnt, userrec * user)
{
- nspace::hash_map<std::string,command_t*>::iterator n = cmdlist.find(commandname);
+ command_table::iterator n = cmdlist.find(commandname);
if (n != cmdlist.end())
{
command_t* CommandParser::GetHandler(const std::string &commandname)
{
- nspace::hash_map<std::string,command_t*>::iterator n = cmdlist.find(commandname);
+ command_table::iterator n = cmdlist.find(commandname);
if (n != cmdlist.end())
return n->second;
CmdResult CommandParser::CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user)
{
- nspace::hash_map<std::string,command_t*>::iterator n = cmdlist.find(commandname);
+ command_table::iterator n = cmdlist.find(commandname);
if (n != cmdlist.end())
{
std::string command;
tokens.GetToken(command);
+ /* A client sent a nick prefix on their command (ick)
+ * rhapsody and some braindead bouncers do this --
+ * the rfc says they shouldnt but also says the ircd should
+ * discard it if they do.
+ */
+ if (*command.c_str() == ':')
+ tokens.GetToken(command);
+
while (tokens.GetToken(para[items]) && (items < 127))
{
command_p[items] = para[items].c_str();
return;
}
- nspace::hash_map<std::string,command_t*>::iterator cm = cmdlist.find(command);
+ command_table::iterator cm = cmdlist.find(command);
if (cm != cmdlist.end())
{
bool CommandParser::RemoveCommands(const char* source)
{
- nspace::hash_map<std::string,command_t*>::iterator i,safei;
+ command_table::iterator i,safei;
for (i = cmdlist.begin(); i != cmdlist.end(); i++)
{
safei = i;
return true;
}
-void CommandParser::RemoveCommand(nspace::hash_map<std::string,command_t*>::iterator safei, const char* source)
+void CommandParser::RemoveCommand(command_table::iterator safei, const char* source)
{
command_t* x = safei->second;
if (x->source == std::string(source))