sub readUserFile {
my $f = "$bot_misc_dir/blootbot.users";
+ if (! -f $f) {
+ &DEBUG("userfile not found; new fresh run detected.");
+ return;
+ }
+
if ( -f $f and -f "$f~") {
my $s1 = -s $f;
my $s2 = -s "$f~";
next;
}
+ if (!defined $nick) {
+ &WARN("invalid line: $_");
+ next;
+ }
+
# nice little hack.
if ($what eq "HOSTS") {
$users{$nick}{$what}{$val} = 1;
}
foreach (keys %opts) {
- next unless ($opts{$_} > 1);
+ next unless ($opts{$_} > 2);
&DEBUG(" opts{$_} => $opts{$_}");
}
$utime_userfile = time();
$ucount_userfile++;
- $users{$nick}{HOSTS}{$mask} = 1;
+ if (defined $mask and $mask !~ /^\s*$/) {
+ &DEBUG("userAdd: mask => $mask");
+ $users{$nick}{HOSTS}{$mask} = 1;
+ }
+
$users{$nick}{FLAGS} ||= $users{_default}{FLAGS};
return 1;
return;
}
+sub rehashConfVars {
+ # this is an attempt to fix where an option is loaded but the module
+ # has not loaded. it also can be used for other things.
+
+ foreach (keys %{ $cache{confvars} }) {
+ my $i = $cache{confvars}{$_};
+ &DEBUG("rehashConfVars: _ => $_");
+
+ if (/^news$/ and $i) {
+ &loadMyModule("news");
+ delete $cache{confvars}{$_};
+ }
+
+ if (/^uptime$/ and $i) {
+ &loadMyModule("uptime");
+ delete $cache{confvars}{$_};
+ }
+
+ if (/^rootwarn$/i and $i) {
+ &loadMyModule($_);
+ delete $cache{confvars}{$_};
+ }
+ }
+
+ &DEBUG("end of rehashConfVars");
+
+ delete $cache{confvars};
+}
+
my @regFlagsChan = (
"autojoin",
"freshmeat",
); # todo...
1;
+
+#####
+# Userflags
+# +r - ability to remove factoids
+# +t - ability to teach factoids
+# +m - ability to modify factoids
+# +n - bot owner
+# +o - authorised user of bot (like +m on eggdrop)
+#####