if (IS_LOCAL(user) && !user->HasPrivPermission("users/flood/no-throttle"))
{
// If it *doesn't* exist, give it a slightly heftier penalty than normal to deter flooding us crap
- IS_LOCAL(user)->Penalty += cm != cmdlist.end() ? cm->second->Penalty : 2;
+ IS_LOCAL(user)->CommandFloodPenalty += cm != cmdlist.end() ? cm->second->Penalty * 1000 : 2000;
}
{
user->WriteNumeric(ERR_NEEDMOREPARAMS, "%s %s :Not enough parameters.", user->nick.c_str(), command.c_str());
if ((ServerInstance->Config->SyntaxHints) && (user->registered == REG_ALL) && (cm->second->syntax.length()))
- user->WriteNumeric(RPL_SYNTAX, "%s :SYNTAX %s %s", user->nick.c_str(), cm->second->command.c_str(), cm->second->syntax.c_str());
+ user->WriteNumeric(RPL_SYNTAX, "%s :SYNTAX %s %s", user->nick.c_str(), cm->second->name.c_str(), cm->second->syntax.c_str());
return do_more;
}
if ((user->registered != REG_ALL) && (!cm->second->WorksBeforeReg()))
void CommandParser::RemoveCommand(Command* x)
{
- Commandtable::iterator n = cmdlist.find(x->command);
+ Commandtable::iterator n = cmdlist.find(x->name);
if (n != cmdlist.end() && n->second == x)
cmdlist.erase(n);
}
if (!user || buffer.empty())
return true;
- ServerInstance->Logs->Log("USERINPUT", DEBUG, "C[%d] I :%s %s",
- user->GetFd(), user->nick.c_str(), buffer.c_str());
+ ServerInstance->Logs->Log("USERINPUT", DEBUG, "C[%s] I :%s %s",
+ user->uuid.c_str(), user->nick.c_str(), buffer.c_str());
return ProcessCommand(user,buffer);
}
bool CommandParser::AddCommand(Command *f)
{
/* create the command and push it onto the table */
- if (cmdlist.find(f->command) == cmdlist.end())
+ if (cmdlist.find(f->name) == cmdlist.end())
{
- cmdlist[f->command] = f;
+ cmdlist[f->name] = f;
return true;
}
return false;
}
-CommandParser::CommandParser()
+CommandParser::CommandParser()
{
para.resize(128);
}