From 8573114bda2d6de4cf9360900b4d1e80f05db4b1 Mon Sep 17 00:00:00 2001 From: Doug Freed Date: Fri, 4 Dec 2015 11:09:56 +0400 Subject: Better netsplit lag handling --- lib/ASM/Event.pm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'lib/ASM/Event.pm') 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 -- cgit v1.2.3