diff options
| author | 2015-12-04 11:09:56 +0400 | |
|---|---|---|
| committer | 2015-12-04 11:09:56 +0400 | |
| commit | 8573114bda2d6de4cf9360900b4d1e80f05db4b1 (patch) | |
| tree | 394e81f6d88cb0d828cfe88af471d8df5c2f2b42 /lib | |
| parent | a323264eb30396afad54b1fd2891a118811b8e97 (diff) | |
Better netsplit lag handling
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/ASM/Event.pm | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/ASM/Event.pm b/lib/ASM/Event.pm index 3adfa9c..f75ee42 100644 --- a/lib/ASM/Event.pm +++ b/lib/ASM/Event.pm @@ -408,12 +408,16 @@ sub on_quit } $::log->logg( $event ); - if (($::netsplit == 0) && ($event->{args}->[0] eq "*.net *.split") && (lc $event->{nick} ne 'chanserv')) { #special, netsplit situation - $conn->privmsg($::settings->{masterchan}, "Entering netsplit mode - JOIN and QUIT inspection will be disabled for 60 minutes"); - $::netsplit = 1; - $::netsplit_ignore_lag++; - $conn->schedule(60*60, sub { $::netsplit = 0; $conn->privmsg($::settings->{masterchan}, 'Returning to regular operation'); }); - $conn->schedule(2*60, sub { $::netsplit_ignore_lag--; }); + if (($event->{args}->[0] eq "*.net *.split") && (lc $event->{nick} ne 'chanserv')) { #special, netsplit situation + if ($::netsplit == 0){ + $conn->privmsg($::settings->{masterchan}, "Entering netsplit mode - JOIN and QUIT inspection will be disabled for 60 minutes"); + $::netsplit = 1; + $conn->schedule(60*60, sub { $::netsplit = 0; $conn->privmsg($::settings->{masterchan}, 'Returning to regular operation'); }); + } + if ($::netsplit_ignore_lag == 0){ + $::netsplit_ignore_lag = 1; + $conn->schedule(2*60, sub { $::netsplit_ignore_lag = 0; }); + } } $::inspector->inspect( $conn, $event ) unless $::netsplit; #ugh. Repurge some shit, hopefully this will fix some stuff where things are going wrong |
