]> git.donarmstrong.com Git - infobot.git/blobdiff - src/core.pl
added flood protection for notice()
[infobot.git] / src / core.pl
index ec7a01302d62757ae16212a9062cc36085bffc51..4caf49330df9aa9d7903ec8bbe7b0f30df03fdbb 100644 (file)
@@ -19,6 +19,9 @@ use vars qw(
        $flag_quit $msgType
        $utime_userfile $wtime_userfile $ucount_userfile
        $utime_chanfile $wtime_chanfile $ucount_chanfile
+       $pubsize $pubcount $pubtime $pubsleep
+       $msgsize $msgcount $msgtime $msgsleep
+       $notsize $notcount $nottime $notsleep
 );
 
 # dynamic hash.
@@ -45,7 +48,6 @@ $last{buflen} = 0;
 $last{say}     = "";
 $last{msg}     = "";
 $userHandle    = "default";
-$msgtime       = time();
 $wingaterun    = time();
 $firsttime     = 1;
 $utime_userfile        = 0;
@@ -54,7 +56,17 @@ $ucount_userfile = 0;
 $utime_chanfile        = 0;
 $wtime_chanfile        = 0;
 $ucount_chanfile = 0;
-
+### more variables...
+$msgtime       = time();
+$msgsize       = 0;
+$msgcount      = $msgsleep     = 0;
+$pubtime       = 0;
+$pubsize       = 0;
+$pubcount      = $pubsleep     = 0;
+$nottime       = 0;
+$notsize       = 0;
+$notcount      = $notsleep     = 0;
+###
 $bot_version   = "blootbot cvs (20010214) -- $^O";
 $noreply       = "NOREPLY";
 
@@ -414,11 +426,13 @@ sub restart {
        ### crappy bug in Net::IRC?
        if (!$conn->connected and time - $msgtime > 900) {
            &status("reconnecting because of uncaught disconnect.");
-##         $irc->start;
+###        $irc->start;
            $conn->connect();
-           return;
+###        return;
        }
 
+       &ircCheck();    # heh, evil!
+
        &DCCBroadcast("-HUP called.","m");
        &shutdown();
        &loadConfig($bot_misc_dir."/blootbot.config");