summaryrefslogtreecommitdiff
path: root/src/command_parse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r--src/command_parse.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 4c58d9b60..11f4b4635 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -284,7 +284,7 @@ bool CommandParser::IsValidCommand(const std::string &commandname, int pcnt, use
// calls a handler function for a command
-bool CommandParser::CallHandler(const std::string &commandname,const char** parameters, int pcnt, userrec *user)
+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);
@@ -298,19 +298,17 @@ bool CommandParser::CallHandler(const std::string &commandname,const char** para
{
if ((user->HasPermission(commandname)) || (!IS_LOCAL(user)))
{
- n->second->Handle(parameters,pcnt,user);
- return true;
+ return n->second->Handle(parameters,pcnt,user);
}
}
else
{
- n->second->Handle(parameters,pcnt,user);
- return true;
+ return n->second->Handle(parameters,pcnt,user);
}
}
}
}
- return false;
+ return CMD_INVALID;
}
void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
@@ -383,8 +381,9 @@ void CommandParser::ProcessCommand(userrec *user, std::string &cmd)
* command handler call, as the handler
* may free the user structure!
*/
+ CmdResult result = cm->second->Handle(command_p,items,user);
- cm->second->Handle(command_p,items,user);
+ FOREACH_MOD(I_OnPostCommand,OnPostCommand(command, command_p, items, user, result));
return;
}
else