]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_pong.cpp
Increase penalty for some core commands
[user/henk/code/inspircd.git] / src / commands / cmd_pong.cpp
index 825168de7773e656e43f1d2fe67df0cd71696d3e..3b6f17f3bd441573ee056ca280502c03b2030677 100644 (file)
@@ -43,8 +43,15 @@ class CommandPong : public Command
 CmdResult CommandPong::Handle (const std::vector<std::string>&, User *user)
 {
        // set the user as alive so they survive to next ping
-       if (IS_LOCAL(user))
-               IS_LOCAL(user)->lastping = 1;
+       LocalUser* localuser = IS_LOCAL(user);
+       if (localuser)
+       {
+               // Increase penalty unless we've sent a PING and this is the reply
+               if (localuser->lastping)
+                       localuser->CommandFloodPenalty += 1000;
+               else
+                       localuser->lastping = 1;
+       }
        return CMD_SUCCESS;
 }