&leakCheck(2); # mandatory
&ignoreCheck(1); # mandatory
&seenFlushOld(2);
- &ircCheck(2); # mandatory
+# &ircCheck(2); # mandatory
+ &ircCheck(1); # mandatory
&miscCheck(1); # mandatory
&miscCheck2(2); # mandatory
&shmFlush(1); # mandatory
my $time = time();
foreach (keys %seen) {
- my $delta_time = $time - &dbGet("seen", "time", "nick='$_'");
+ my $delta_time = $time - &dbGet("seen", "time", "nick", $_);
next unless ($delta_time > $max_time);
&DEBUG("seenFlushOld: ".&Time2String($delta_time) );
return if ($_[0] eq "2");
}
+ my $str = join(' ', &ChanConfList("chanlimitcheck") );
+ &DEBUG("chanlimitCheck: str => $str");
+
foreach $chan ( &ChanConfList("chanlimitcheck") ) {
next unless (&validChan($chan));
+ if ($chan eq "_default") {
+ &WARN("chanlimit: we're doing $chan!! HELP ME!");
+ next;
+ }
+
my $limitplus = &getChanConfDefault("chanlimitcheckPlus", 5, $chan);
my $newlimit = scalar(keys %{ $channels{$chan}{''} }) + $limitplus;
my $limit = $channels{$chan}{'l'};
if (scalar keys %netsplitservers) {
if (defined $limit) {
- &DEBUG("chanlimit: removing it for $chan.");
+ &status("chanlimit: netsplit; removing it for $chan.");
&rawout("MODE $chan -l");
$cache{chanlimitChange}{$chan} = time();
}
### run NAMES again and flush it.
}
- next unless (!defined $limit);
if (defined $limit and $limit == $newlimit) {
$cache{chanlimitChange}{$chan} = time();
next;
my ($s1,$s2);
if (@_) {
- &ScheduleThis(30, "netsplitCheck");
+ &ScheduleThis(15, "netsplitCheck");
return if ($_[0] eq "2");
}
delete $netsplit{$_};
}
+ # yet another hack.
+ foreach (keys %channels) {
+ my $i = $cache{maxpeeps}{$chan} || 0;
+ my $j = scalar(keys %{ $channels{$chan} });
+ next unless ($i > 10 and 0.25*$i > $j);
+
+ &DEBUG("netsplit: 0.25*max($i) > current($j); possible netsplit?");
+ }
+
if ($delete) {
my $j = scalar(keys %netsplit);
&DEBUG("nsC: removed from netsplit list: (before: $count; after: $j)");
### old code.
###
- my $exists = &dbGet("seen", "nick", "nick='$nick'");
+ my $exists = &dbGet("seen", "nick", "nick=".&dbQuote($nick) );
if (defined $exists and $exists) {
&dbUpdate("seen", "nick", $nick, (
sub ircCheck {
if (@_) {
- &ScheduleThis(60, "ircCheck");
+ &ScheduleThis(15, "ircCheck");
return if ($_[0] eq "2"); # defer.
}
return;
}
+ my $age = "New";
if ( -e "$file~" ) {
- $backup++ if ((stat $file)[9] - (stat "$file~")[9] > $time);
+ $backup++ if ((stat $file)[9] - (stat "$file~")[9] > $time);
+ my $delta = time() - (stat "$file~")[9];
+ $age = &Time2String($delta);
} else {
$backup++;
}
- return unless ($backup);
- # should delta be time(file) - time(file~)?
- my $delta = time() - (stat "$file~")[9];
- my $age = &Time2String($delta);
+ return unless ($backup);
### TODO: do internal copying.
&status("Backup: $file ($age)");