]> git.donarmstrong.com Git - infobot.git/blobdiff - src/IRC/Schedulers.pl
- bot stats: "blah has blah... is ranked xx/yy (zz percentile)"
[infobot.git] / src / IRC / Schedulers.pl
index a7d38c4b796270f6d2911810f5077f64fdb4be5f..b5bca95c393aa3f6b1d785fb56ad57fdcefcc48b 100644 (file)
@@ -363,9 +363,17 @@ sub chanlimitCheck {
        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'};
@@ -466,6 +474,15 @@ sub netsplitCheck {
        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)");