diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-01-19 17:47:03 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-01-19 17:47:03 +0100 |
commit | 54ecd7ff910408015d395c5c737fb48dfb9d7a0a (patch) | |
tree | e528150b2ef9507c8a913b38b8ecc5999ec17e11 /src/commands/cmd_pong.cpp | |
parent | 17b4151bff2edcec3f3524cc60e536407c70cec6 (diff) | |
parent | 80350a67aa7d45e5068f46b8995be92b0d9b40aa (diff) |
Merge branch 'insp20+penalty' into insp20
Diffstat (limited to 'src/commands/cmd_pong.cpp')
-rw-r--r-- | src/commands/cmd_pong.cpp | 11 |
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; } |