X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommand_parse.cpp;h=1ca4c988f0a6c72bafb4c0b85edf3780fa6275d2;hb=86775e2e98f55b3b88befe2daff0ca23f02f3155;hp=e7478478a649e9c207cbaee71decafb4c26a9242;hpb=3d8ec5dbd9cfde34fcbc63ad7b9b1369866f0a33;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/command_parse.cpp b/src/command_parse.cpp index e7478478a..1ca4c988f 100644 --- a/src/command_parse.cpp +++ b/src/command_parse.cpp @@ -28,15 +28,15 @@ int InspIRCd::PassCompare(Extensible* ex, const std::string &data, const std::string &input, const std::string &hashtype) { - int MOD_RESULT = 0; - FOREACH_RESULT_I(this,I_OnPassCompare,OnPassCompare(ex, data, input, hashtype)) + ModResult res; + FIRST_MOD_RESULT(this, OnPassCompare, res, (ex, data, input, hashtype)); /* Module matched */ - if (MOD_RESULT == 1) + if (res == MOD_RES_ALLOW) return 0; /* Module explicitly didnt match */ - if (MOD_RESULT == -1) + if (res == MOD_RES_DENY) return 1; /* We dont handle any hash types except for plaintext - Thanks tra26 */ @@ -278,9 +278,9 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) if (cm == cmdlist.end()) { - int MOD_RESULT = 0; - FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command, command_p, user, false, cmd)); - if (MOD_RESULT == 1) + ModResult MOD_RESULT; + FIRST_MOD_RESULT(ServerInstance, OnPreCommand, MOD_RESULT, (command, command_p, user, false, cmd)); + if (MOD_RESULT == MOD_RES_DENY) return true; /* @@ -341,9 +341,9 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) * We call OnPreCommand here seperately if the command exists, so the magic above can * truncate to max_params if necessary. -- w00t */ - int MOD_RESULT = 0; - FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command, command_p, user, false, cmd)); - if (MOD_RESULT == 1) + ModResult MOD_RESULT; + FIRST_MOD_RESULT(ServerInstance, OnPreCommand, MOD_RESULT, (command, command_p, user, false, cmd)); + if (MOD_RESULT == MOD_RES_DENY) return true; /* activity resets the ping pending timer */ @@ -399,9 +399,8 @@ bool CommandParser::ProcessCommand(User *user, std::string &cmd) cm->second->total_bytes += cmd.length(); /* module calls too */ - MOD_RESULT = 0; - FOREACH_RESULT(I_OnPreCommand,OnPreCommand(command, command_p, user, true, cmd)); - if (MOD_RESULT == 1) + FIRST_MOD_RESULT(ServerInstance, OnPreCommand, MOD_RESULT, (command, command_p, user, true, cmd)); + if (MOD_RESULT == MOD_RES_DENY) return do_more; /*