return 0;
/* Only one commasepstream here */
- ServerInstance->Log(DEBUG,"LoopCall on '%s'",parameters[splithere]);
irc::commasepstream items1(parameters[splithere]);
std::string item = "";
unsigned int max = 0;
*/
while (((item = items1.GetToken()) != "") && (max++ < ServerInstance->Config->MaxTargets))
{
- ServerInstance->Log(DEBUG,"LoopCall get item: '%s'", item.c_str());
parameters[splithere] = item.c_str();
CommandObj->Handle(parameters,pcnt,user);
}
{
const char *command_p[127];
int items = 0;
- std::string para[127];
irc::tokenstream tokens(cmd);
std::string command = tokens.GetToken();
while (((para[items] = tokens.GetToken()) != "") && (items < 127))
- command_p[items] = para[items++].c_str();
+ {
+ command_p[items] = para[items].c_str();
+ items++;
+ }
std::transform(command.begin(), command.end(), command.begin(), ::toupper);
int MOD_RESULT = 0;
- FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command,command_p,items,user,false));
+ FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command,command_p,items,user,false,cmd));
if (MOD_RESULT == 1) {
return;
}
cm->second->total_bytes += cmd.length();
int MOD_RESULT = 0;
- FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command,command_p,items,user,true));
+ FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command,command_p,items,user,true,cmd));
if (MOD_RESULT == 1)
return;
*/
CmdResult result = cm->second->Handle(command_p,items,user);
- FOREACH_MOD(I_OnPostCommand,OnPostCommand(command, command_p, items, user, result));
+ if (result != CMD_USER_DELETED)
+ {
+ FOREACH_MOD(I_OnPostCommand,OnPostCommand(command, command_p, items, user, result,cmd));
+ }
return;
}
else
CommandParser::CommandParser(InspIRCd* Instance) : ServerInstance(Instance)
{
+ para.resize(128);
this->SetupCommandTable();
}
dlclose(command->second);
RFCCommands.erase(command);
- sprintf(filename, "cmd_%s.so", commandname);
+ snprintf(filename, MAXBUF, "cmd_%s.so", commandname);
this->LoadCommand(filename);
return true;