From 521ae5c70434864ee0fb9c32592922927a5c0eff Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 27 Jun 2010 03:22:29 +0000 Subject: [PATCH] Anti-join flood bans for 2^5 hours for first offense instead of 2^7 hours (now uses 2^(4+number_of_offenses) hours as timeout) --- PBot/AntiFlood.pm | 4 ++-- PBot/VERSION.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index 43785f8a..bb1bd8b1 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -208,7 +208,7 @@ sub check_flood { if(${ $self->message_history }{$account}{$channel}{join_watch} >= $max_messages) { ${ $self->message_history }{$account}{$channel}{offenses}++; - my $timeout = (2 ** (($self->message_history->{$account}{$channel}{offenses} + 6) < 10 ? ${ $self->message_history }{$account}{$channel}{offenses} + 6 : 10)); + my $timeout = (2 ** (($self->message_history->{$account}{$channel}{offenses} + 4) < 10 ? ${ $self->message_history }{$account}{$channel}{offenses} + 6 : 10)); my $banmask = address_to_mask($host); @@ -218,7 +218,7 @@ sub check_flood { $timeout = "several" if($timeout > 8); - $self->{pbot}->conn->privmsg($nick, "You have been banned from $channel for $timeout hours due to join flooding. If your connection issues have been fixed, or this was an accident, you may request an unban at any time by responding to this message with: unbanme $channel; however, abusing this may lead to a permanent ban."); + $self->{pbot}->conn->privmsg($nick, "You have been banned from $channel for $timeout hours due to join flooding. If your connection issues have been fixed, or this was an accident, you may request an unban at any time by responding to this message with: unbanme $channel"); ${ $self->message_history }{$account}{$channel}{join_watch} = $max_messages - 2; # give them a chance to rejoin } diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 4af7630d..9582d4ee 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,7 +13,7 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 205, + BUILD_REVISION => 206, BUILD_DATE => "2010-06-26", };