]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Files.pl
- patch from Morten Brix Pedersen <morten@wtf.dk>. Thanks!
[infobot.git] / src / Files.pl
index c8ba101fa816c6b9c3adc8192d54beb26028be59..add4a4df235229321baa8afd40eaf0ff6f296bb6 100644 (file)
@@ -1,7 +1,7 @@
 #
 # Files.pl: Open and close, read and probably write files.
 #   Author: dms
-#  Version: v0.2 (2000502)
+#  Version: v0.3 (20010120)
 #  Created: 19991221
 #
 
@@ -47,36 +47,9 @@ sub loadLang {
     &status("Loaded lang $file ($langCount items)");
 }
 
-# File: Ignore list.
-sub loadIgnore {
-    my ($file) = @_;
-    %ignoreList        = ();
-
-    if (!open(FILE, $file)) {
-       &ERROR("FAILED loadIgnore ($file): $!");
-       return;
-    }
-
-    my $count = 0;
-    while (<FILE>) {
-       chomp;
-       next if /^\s*\#/;
-       next unless /\S/;
-
-       if (/^(\S+)[\t\s]+(\S+)([\t\s]+.*)?$/) {
-           $ignoreList{$2} = 1;
-           $count++;
-       }
-    }
-    close FILE;
-
-    $file =~ s/^.*\///;
-    &status("Loaded ignore $file ($count masks)");
-}
-
 # File: Irc Servers list.
 sub loadIRCServers {
-    my ($file) = @_;
+    my ($file) = $bot_config_dir."/blootbot.servers";
     @ircServers = ();
     %ircPort = ();
 
@@ -103,61 +76,4 @@ sub loadIRCServers {
     &status("Loaded ircServers $file (". scalar(@ircServers) ." servers)");
 }
 
-# File: User List.
-sub loadUsers {
-    my ($file) = @_;
-    %userList = ();    # clear it.
-
-    if (!open(FILE, $file)) {
-       &ERROR("FAILED loadUsers ($file): $!");
-       exit 0;
-    }
-
-    my $userName;
-
-    while (<FILE>) {
-       next if /^\s*$/;
-       next if /^#/;
-
-       if (/^UserEntry\s+(.+?)\s/) {
-           $userName = $1;
-           if (/\s*\{\s*/) {
-               while (<FILE>) {
-                   if (/^\s*(\w+)\s+(.+);$/) {
-                       my ($opt,$val) = ($1,$2);
-
-                       $opt =~ tr/A-Z/a-z/;
-                       $val =~ s/\"//g;
-                       $val =~ s/\+// if ($opt =~ /^flags$/i);
-
-                       if ($opt =~ /^mask$/i) {
-                           $userList{$userName}{$opt}{$val} = 1;
-                       } else {
-                           $userList{$userName}{$opt} = $val;
-                       }
-                   } elsif (/^\s*\}\s*$/) {
-                       last;
-                   }
-               }
-           } else {
-               &status("parse error: User Entry $userName without right brace");
-           }
-       }
-    }
-    close FILE;
-
-    return unless (&IsParam("VERBOSITY"));
-
-    $file =~ s/^.*\///;
-    &status("Loaded userlist $file (". scalar(keys %userList) ." users)");
-    foreach $userName (keys %userList) {
-       &status("  $userName:");
-       &status("    flags: +$userList{$userName}{'flags'}");
-
-       foreach (keys %{$userList{$userName}{'mask'}}) {
-           &status("    hostmask: $_");
-       }
-    }
-}
-
 1;