diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-14 12:09:53 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-14 12:09:53 +0000 |
commit | 9a3475ed584b09c221219b306611c0b691161a08 (patch) | |
tree | 2525e19a856b31c01dc2d6b2226a6a336c52e621 /src | |
parent | b6b58df62aa2fea0b286b69971140cdec17afa61 (diff) |
Added OnPreCommand
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1080 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 7 | ||||
-rw-r--r-- | src/modules.cpp | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 7b0babd91..273259019 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -3020,6 +3020,7 @@ void process_command(userrec *user, char* cmd) log(DEBUG,"process_command: handler: %s %s %d",user->nick,command,items); if (cmdlist[i].handler_function) { + /* ikky /stats counters */ if (temp) { @@ -3034,6 +3035,12 @@ void process_command(userrec *user, char* cmd) cmdlist[i].total_bytes+=strlen(temp); } + int MOD_RESULT = 0; + FOREACH_RESULT(OnPreCommand(command,command_p,items,user)); + if (MOD_RESULT == 1) { + return; + } + /* WARNING: nothing may come after the * command handler call, as the handler * may free the user structure! */ diff --git a/src/modules.cpp b/src/modules.cpp index 3d4972a2d..6ff60b208 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -332,6 +332,7 @@ int Module::OnKill(userrec* source, userrec* dest, std::string reason) { return void Module::OnLoadModule(Module* mod,std::string name) { }; void Module::OnBackgroundTimer(time_t curtime) { }; void Module::OnSendList(userrec* user, chanrec* channel, char mode) { }; +int Module::OnPreCommand(std::string command, char **parameters, int pcnt, userrec *user) { return 0; }; // server is a wrapper class that provides methods to all of the C-style // exports in the core |