# sync time should be done in on_endofwho like in BitchX
if (exists $cache{jointime}{$chan}) {
- my $delta_time = sprintf("%.03f", &timeget() - $cache{jointime}{$chan});
+ my $delta_time = sprintf("%.03f", &timedelta($cache{jointime}{$chan}) );
$delta_time = 0 if ($delta_time < 0);
if ($delta_time > 100) {
&WARN("endofnames: delta_time > 100 ($delta_time)");
&status("$b_blue$chan$ob: [$chanstats]");
&chanServCheck($chan);
- &joinNextChan();
+ # schedule used to solve ircu (OPN) "target too fast" problems.
+ $conn->schedule(5, sub { &joinNextChan(); } );
}
sub on_init {
if (exists $netsplit{lc $who}) {
delete $netsplit{lc $who};
$netsplit = 1;
+ &netsplitCheck() if (time() != $sched{netsplitCheck}{TIME});
}
- if ($netsplit and !$netsplittime) {
+ if ($netsplit and !exists $cache{netsplit}) {
&DEBUG("on_join: ok.... re-running chanlimitCheck in 60.");
$conn->schedule(60, sub {
&chanlimitCheck();
- $netsplittime = undef;
+ delete $cache{netsplit};
} );
- $netsplittime = time();
+ $cache{netsplit} = time();
}
# how to tell if there's a netjoin???
# no need to go further.
return if ($netsplit);
+
# who == bot.
if ($who eq $ident or $who =~ /^$ident$/i) {
if (defined( my $whojoin = $cache{join}{$chan} )) {
if (exists $netsplit{lc $newnick}) {
&status("Netsplit: $newnick/$nick came back from netsplit and changed to original nick! removing from hash.");
delete $netsplit{lc $newnick};
+ &netsplitCheck() if (time() != $sched{netsplitCheck}{TIME});
}
my ($chan,$mode);
$netsplit{lc $nick} = time();
if (!exists $netsplitservers{$1}{$2}) {
- &status("netsplit detected between $1 and $2.");
+ &status("netsplit detected between $1 and $2 at [".scalar(localtime)."]");
$netsplitservers{$1}{$2} = time();
}
}
&ERROR("^^^ THIS SHOULD NEVER HAPPEN (10).");
}
+ # does this work?
if ($nick !~ /^\Q$ident\E$/ and $nick =~ /^\Q$param{'ircNick'}\E$/i) {
&status("nickchange: own nickname became free; changing.");
&nick($param{'ircNick'});
$cache{sleepTime} = time();
}
- } else {
- if (!exists $cache{TargetTooFast}) {
- &DEBUG("on_ttf: failed: $why");
- $cache{TargetTooFast}++;
- }
+ return;
+ }
+
+ if (!exists $cache{TargetTooFast}) {
+ &DEBUG("on_ttf: failed: $why");
+ $cache{TargetTooFast}++;
}
}
if ($ver =~ /bitchx/i) {
$ver{bitchx}{$nick} = $ver;
+
} elsif ($ver =~ /xc\!|xchat/i) {
$ver{xchat}{$nick} = $ver;
+
} elsif ($ver =~ /irssi/i) {
$ver{irssi}{$nick} = $ver;
+
} elsif ($ver =~ /epic/i) {
$ver{epic}{$nick} = $ver;
+
} elsif ($ver =~ /mirc/i) {
&DEBUG("verstats: mirc: $nick => '$ver'.");
$ver{mirc}{$nick} = $ver;
+
} elsif ($ver =~ /ircle/i) {
$ver{ircle}{$nick} = $ver;
+
} elsif ($ver =~ /ircII/i) {
$ver{ircII}{$nick} = $ver;
+
} elsif ($ver =~ /sirc /i) {
$ver{sirc}{$nick} = $ver;
+
} elsif ($ver =~ /kvirc/i) {
$ver{kvirc}{$nick} = $ver;
+
} elsif ($ver =~ /eggdrop/i) {
$ver{eggdrop}{$nick} = $ver;
+
} elsif ($ver =~ /xircon/i) {
$ver{xircon}{$nick} = $ver;
+
} else {
&DEBUG("verstats: other: $nick => '$ver'.");
$ver{other}{$nick} = $ver;
sub on_chanfull {
my ($self, $event) = @_;
my @args = $event->args;
+
&DEBUG("on_chanfull: args => @args");
&joinNextChan();
}
sub on_inviteonly {
my ($self, $event) = @_;
my @args = $event->args;
+
&DEBUG("on_inviteonly: args => @args");
&joinNextChan();
}
sub on_banned {
my ($self, $event) = @_;
my @args = $event->args;
+
&DEBUG("on_banned: args => @args");
&joinNextChan();
}
sub on_badchankey {
my ($self, $event) = @_;
my @args = $event->args;
+
&DEBUG("on_badchankey: args => @args");
&joinNextChan();
}