]> git.donarmstrong.com Git - infobot.git/blobdiff - src/core.pl
added _default to chan mask.
[infobot.git] / src / core.pl
index a81c23f7f503044c5f0792339184300e91945972..71f154acd4f459fae41ad2992ecb461bd4bb6e31 100644 (file)
@@ -30,7 +30,7 @@ use vars qw(@joinchan @ircServers @wingateBad @wingateNow @wingateCache
 use vars qw(%count %netsplit %netsplitservers %flood %dcc %orig
            %nuh %talkWho %seen %floodwarn %param %dbh %ircPort
            %jointime %topic %joinverb %moduleAge %last %time %mask %file
-           %forked %pid %chanconf %channels
+           %forked %chanconf %channels
 );
 
 # Signals.
@@ -85,7 +85,7 @@ sub doExit {
        &quit($param{'quitMsg'}) if (&whatInterface() =~ /IRC/);
        &writeUserFile();
        &writeChanFile();
-       &uptimeWriteFile()      if (&IsParam("uptime"));
+       &uptimeWriteFile()      if (&ChanConfList("uptime"));
        &closeDB();
        &closeSHM($shm);
        &dumpallvars()          if (&IsParam("dumpvarsAtExit"));
@@ -128,16 +128,11 @@ sub IsParam {
 # Return: array of channels
 sub ChanConfList {
     my $param  = $_[0];
-    my %chan   = &getChanConfList($param);
-
     return unless (defined $param);
+    my %chan   = &getChanConfList($param);
 
     ### TODO: -option is included aswell though.
-    if ($chan{_default}) {
-       return keys %channels;
-    } else {
-       return keys %chan;
-    }
+    return keys %chan;
 }
 
 #####
@@ -341,6 +336,7 @@ sub startup {
     $count{'Question'} = 0;
     $count{'Update'}   = 0;
     $count{'Dunno'}    = 0;
+    $count{'Moron'}    = 0;
 }
 
 sub shutdown {
@@ -350,14 +346,14 @@ sub shutdown {
     &closeDB();
     &closeSHM($shm);   # aswell. TODO: use this in &doExit?
     &closeLog();
+    ### is this valid?
+    &writeUserFile();
+    &writeChanFile();
 }
 
 sub restart {
     my ($sig) = @_;
 
-    &DEBUG(" forked => ".scalar(keys %forked) );
-    &DEBUG(" pid    => ".scalar(keys %pid) );
-
     if ($$ == $bot_pid) {
        &status("--- $sig called.");
 
@@ -369,6 +365,7 @@ sub restart {
            return;
        }
 
+       &DCCBroadcast("-HUP called.","m");
        &shutdown();
        &loadConfig($bot_misc_dir."/blootbot.config");
        &reloadAllModules() if (&IsParam("DEBUG"));