summaryrefslogtreecommitdiff
path: root/src/commands/cmd_pong.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-01-12 14:19:58 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-01-12 14:19:58 +0100
commit83bcc83a56a235f5c4e479ff47713f467640a4eb (patch)
treea525709b3f8d73f1a6d4ec6b77a93627db466c7c /src/commands/cmd_pong.cpp
parent225322b46f888fb034c87aea45fdde3f941c6450 (diff)
Increase penalty for some core commands
Diffstat (limited to 'src/commands/cmd_pong.cpp')
-rw-r--r--src/commands/cmd_pong.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/commands/cmd_pong.cpp b/src/commands/cmd_pong.cpp
index 825168de7..3b6f17f3b 100644
--- a/src/commands/cmd_pong.cpp
+++ b/src/commands/cmd_pong.cpp
@@ -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;
}