diff options
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; } |