summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-14 12:09:53 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-04-14 12:09:53 +0000
commit9a3475ed584b09c221219b306611c0b691161a08 (patch)
tree2525e19a856b31c01dc2d6b2226a6a336c52e621 /include
parentb6b58df62aa2fea0b286b69971140cdec17afa61 (diff)
Added OnPreCommand
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1080 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/modules.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/modules.h b/include/modules.h
index a7a42991e..7f4cc96be 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -384,6 +384,17 @@ class Module : public classbase
*/
virtual void OnSendList(userrec* user, chanrec* channel, char mode);
+ /** Called whenever any command is about to be executed.
+ * This event occurs for all registered commands, wether they are registered in the core,
+ * or another module, but it will not occur for invalid commands (e.g. ones which do not
+ * exist within the command table). By returning 1 from this method you may prevent the
+ * command being executed. If you do this, no output is created by the core, and it is
+ * down to your module to produce any output neccessary.
+ * Note that unless you return 1, you should not destroy any structures (e.g. by using
+ * Server::QuitUser) otherwise when the command's handler function executes after your
+ * method returns, it will be passed an invalid pointer to the user object and crash!)
+ */
+ virtual int OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user);
};