]> git.donarmstrong.com Git - infobot.git/commitdiff
renamed limitCheck to chanlimitCheck
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 8 Dec 2000 13:09:55 +0000 (13:09 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Fri, 8 Dec 2000 13:09:55 +0000 (13:09 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@183 c11ca15a-4712-0410-83d8-924469b57eb5

src/IRC/Schedulers.pl

index 4b6987ba778401310d216b8d878d947451ea34a4..97d795c54504022907e11d184643857d2315cd7a 100644 (file)
@@ -17,7 +17,7 @@ sub setupSchedulers {
     &randomQuote(1)    if (&IsParam("randomQuote"));
     &randomFactoid(1)  if (&IsParam("randomFactoid"));
     &logCycle(1)       if (defined fileno LOG and &IsParam("logfile") and &IsParam("maxLogSize"));
-    &limitCheck(1)     if (&IsParam("limitcheck"));
+    &chanlimitCheck(1) if (&IsParam("chanlimitcheck"));
     &netsplitCheck(1); # mandatory
     &floodCycle(1);    # mandatory
     &seenFlush(1)      if (&IsParam("seen") and &IsParam("seenFlushInterval"));
@@ -204,9 +204,9 @@ sub seenFlushOld {
     &ScheduleThis(1440, "seenFlushOld") if (@_);
 }
 
-sub limitCheck {
-    my $limitplus = $param{'limitcheckPlus'} || 5;
-    my @channels = split(/[\s\t]+/, lc $param{'limitcheck'});
+sub chanlimitCheck {
+    my $limitplus = $param{'chanlimitcheckPlus'} || 5;
+    my @channels = split(/[\s\t]+/, lc $param{'chanlimitcheck'});
 
     foreach (@channels) {
        next unless (&validChan($_));
@@ -214,6 +214,10 @@ sub limitCheck {
        my $newlimit = scalar(keys %{$channels{$_}{''}}) + $limitplus;
        my $limit = $channels{$_}{'l'};
 
+       if (scalar keys %{$channels{$_}{''}} > $limit) {
+           &status("LIMIT: set too low!!! FIXME");
+       }
+
        next unless (!defined $limit or $limit != $newlimit);
 
        if (scalar keys %netsplit and $limit) {
@@ -222,14 +226,14 @@ sub limitCheck {
        }
 
        if (!exists $channels{$_}{'o'}{$ident}) {
-           &ERROR("limitcheck: dont have ops on $_.");
+           &ERROR("chanlimitcheck: dont have ops on $_.");
            next;
        }
        &rawout("MODE $_ +l $newlimit");
     }
 
-    my $interval = $param{'limitcheckInterval'} || 10;
-    &ScheduleThis($interval, "limitCheck") if (@_);
+    my $interval = $param{'chanlimitcheckInterval'} || 10;
+    &ScheduleThis($interval, "chanlimitCheck") if (@_);
 }
 
 sub netsplitCheck {