diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-02 09:57:48 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-03-02 09:57:48 +0000 |
commit | 18c757067c0a9e5c1aa81496dca8428a0bf3635f (patch) | |
tree | 4391711a1e206ba168c5bcb69bdeee79069a8510 /include | |
parent | 86499a92b6ede0fc80ee36e14a2a248a088e5e43 (diff) |
Changed definition of CallHandler and CallCommandHandler for the ability to return false on bad command.
This allows us to terminate server links that send commands we dont know (e.g. admin loads module A after linking, we dont have module A, when it sends module A's command, abort)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3414 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/command_parse.h | 2 | ||||
-rw-r--r-- | include/modules.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/command_parse.h b/include/command_parse.h index a58dfe5d1..5709f5c6a 100644 --- a/include/command_parse.h +++ b/include/command_parse.h @@ -34,7 +34,7 @@ class CommandParser command_table cmdlist; CommandParser(); - void CallHandler(std::string &commandname,char **parameters, int pcnt, userrec *user); + bool CallHandler(std::string &commandname,char **parameters, int pcnt, userrec *user); bool IsValidCommand(std::string &commandname, int pcnt, userrec * user); int LoopCall(command_t *fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins); void ProcessBuffer(const char* cmdbuf,userrec *user); diff --git a/include/modules.h b/include/modules.h index 8eae4f6a3..4dff5d48a 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1597,8 +1597,9 @@ class Server : public classbase * in the array. If you do not pass enough parameters to meet the minimum needed by the handler, the * functiom will silently ignore it. The final parameter is the user executing the command handler, * used for privilage checks, etc. + * @return True if the command exists */ - virtual void CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user); + virtual bool CallCommandHandler(std::string commandname, char** parameters, int pcnt, userrec* user); /** This function returns true if the commandname exists, pcnt is equal to or greater than the number * of paramters the command requires, the user specified is allowed to execute the command, AND |