}
if ($hash{NoArgs} and $flatarg) {
- &DEBUG("cmd $ident does not take args; skipping.");
+ &DEBUG("cmd $ident does not take args ('$flatarg'); skipping.");
next;
}
}
}
my $topstr = "";
- &DEBUG("tp => $tp");
+ &DEBUG("*stats: tp => $tp");
if (scalar @top) {
$topstr = ". Top ".scalar(@top).": ".join(', ', @top);
}
}
my $topstr = "";
- &DEBUG("tp => $tp");
+ &DEBUG("*stats: tp => $tp");
if (scalar @top) {
$topstr = ". Top ".scalar(@top).": ".join(', ', @top);
}
}
if (!defined $nick) {
- &WARN("invalid line: $_");
+ &WARN("DynaConfig: invalid line: $_");
next;
}
if ($also) { # 'is also'.
if ($exists =~ /^<REPLY> see /i) {
- &DEBUG("todo: append to linked factoid.");
+ &DEBUG("Update.pl: todo: append to linked factoid.");
}
if ($also_or) { # 'is also ||'.
my $rate = sprintf("%.1f", $delta / @c);
delete $cache{joinTime};
- &DEBUG("time taken to join all chans: $timestr; rate: $rate sec/join");
+ &status("time taken to join all chans: $timestr; rate: $rate sec/join");
}
# chanserv check: global channels, in case we missed one.
$uh = $event->userhost();
$nuh = $nick."!".$uh;
$msgtime = time();
+ $h = $host;
if ($nick eq $ident) { # hopefully ourselves.
if ($msg eq "TEST") {
sub on_ping_reply {
my ($self, $event) = @_;
- my $nick = $event->nick;
- my $lag = time() - ($event->args)[1];
+ my $nick = $event->nick;
+ my $t = ($event->args)[1];
+ if (!defined $t) {
+ &WARN("on_ping_reply: t == undefined.");
+ return;
+ }
+
+ my $lag = time() - $t;
&status(">>> ${b_green}CTCP PING$ob reply from $b_cyan$nick$ob: $lag sec.");
}
$msgType = "public";
# todo: move this out of hookMsg to here?
($user,$host) = split(/\@/, $uh);
+ $h = $host;
# rare case should this happen - catch it just in case.
if ($bot_pid != $$) {
}
$cache{'netsplitCache'}++;
- &DEBUG("running netsplitCheck... $cache{netsplitCache}");
+# &DEBUG("running netsplitCheck... $cache{netsplitCache}");
if (!scalar %netsplit and scalar %netsplitservers) {
&DEBUG("nsC: !hash netsplit but hash netsplitservers <- removing!");
if ($delete) {
my $j = scalar(keys %netsplit);
- &DEBUG("nsC: removed from netsplit list: (before: $count; after: $j)");
+ &status("nsC: removed from netsplit list: (before: $count; after: $j)");
}
if (!scalar %netsplit and scalar %netsplitservers) {
$count += scalar(keys %{ $flood{$blah1}{$blah2} });
}
}
- &DEBUG("leak: hash flood has $count total keys.",2);
+ &VERB("leak: hash flood has $count total keys.",2);
# floodjoin.
$count = 0;
$count += scalar(keys %{ $floodjoin{$blah1}{$blah2} });
}
}
- &DEBUG("leak: hash floodjoin has $count total keys.",2);
+ &VERB("leak: hash floodjoin has $count total keys.",2);
# floodwarn.
$count = scalar(keys %floodwarn);
- &DEBUG("leak: hash floodwarn has $count total keys.",2);
+ &VERB("leak: hash floodwarn has $count total keys.",2);
my $chan;
foreach $chan (grep /[A-Z]/, keys %channels) {
# chanstats
$count = scalar(keys %chanstats);
- &DEBUG("leak: hash chanstats has $count total keys.",2);
+ &VERB("leak: hash chanstats has $count total keys.",2);
# nuh.
my $delete = 0;
$package = "";
} else {
- &::WARN("invalid line: '$_'.");
+ &::WARN("debian: invalid line: '$_' (1).");
}
}
close IN;
$desc{$package} = $desc;
$package = "";
} else {
- &::WARN("invalid line: '$_'.");
+ &::WARN("debian: invalid line: '$_'. (2)");
}
}
close IN;
system("cp $idx $idx-old");
}
- &::DEBUG("deb: gIndex: calling DebianDownload($dist, ...).");
+ &::DEBUG("deb: gIndex: calling DebianDownload($dist, ...).") if ($debug);
&DebianDownload($dist, &fixDist($dist, %urlpackages) );
&::status("Debian: generating index for '$dist'.");
}
sub searchDescFE {
- &::DEBUG("deb: FE called for searchDesc");
+# &::DEBUG("deb: FE called for searchDesc");
my ($query) = @_;
my @list = &searchDesc($query);
&::msg($who, "|= Last updated $timestr ago.");
&::msg($who, " \037Num\037 \037Item ".(" "x40)." \037");
- &DEBUG("list: expire = $expire");
- &::DEBUG("list: eno = $eno");
+# &::DEBUG("news: list: expire = $expire");
+# &::DEBUG("news: list: eno = $eno");
my $i = 1;
foreach ( &getNewsAll() ) {
my($args) = @_;
my($item, $what, $value);
+ if (!defined $args) {
+ &::DEBUG("news: set: args == NULL.");
+ return;
+ }
+
$item = $1 if ($args =~ s/^(\S+)\s*//);
$what = $1 if ($args =~ s/^(\S+)\s*//);
$value = $args;
- &::DEBUG("news: set called.");
-
if ($item eq "") {
&::help("news set");
return;
}
my $auth = 0;
- &::DEBUG("news: who => '$who'");
+# &::DEBUG("news: who => '$who'");
my $author = $::news{$chan}{$news}{Author};
$auth++ if ($::who eq $author);
$auth++ if (&::IsFlag("o"));
}
if (@items) {
- &::DEBUG("news: gNI: part_string->full_string: $what->$items[0]");
+# &::DEBUG("news: gNI: part_string->full_string: $what->$items[0]");
return $items[0];
} else {
&::DEBUG("news: gNI: No match for '$what'");
}
}
- &::ERROR("getNewsItem: Should not happen (what = $what)");
+ &::ERROR("news: gNI: should not happen (what = $what)");
return;
}
# Usage: &topicCipher(@topics);
sub topicCipher {
if (!@_) {
- &DEBUG("topicCipher: topic is NULL.");
+ &WARN("topicCipher: topic is NULL for $chan.");
return;
}
undef @subtopics; # lets reuse this array.
foreach (@newtopics) {
- next if ($_ eq "");
+ next if (!defined $_ or $_ eq "");
push(@subtopics, $_);
}
}
# todo: show top 3 with percentages?
- my($count) = (sort { $a <=> $b } keys %new)[0];
+ my($count) = (sort { $new{$a} <=> $new{$b} } keys %new)[0];
if ($count) {
$reply .= ". \002$count\002 has said the most with a total of \002$new{$count}\002 messages";
}
} elsif (/^\+/) {
&DEBUG("spell: '+' found => '$_'.");
last;
+ } elsif (/^# (.*?) 0$/) {
+ # none found.
+ last;
} else {
&DEBUG("spell: unknown: '$_'.");
}
my $pid;
$dns =~ s/^\s+|\s+$//g;
+ if (!defined $dns or $dns =~ /^\s*$/ or $dns =~ / /) {
+ &help("dns");
+ return;
+ }
+
if ($dns =~ /(\d+\.\d+\.\d+\.\d+)/) {
$match = $1;
&status("DNS query by IP address: $match");
" ORDER BY counter DESC", 1);
foreach (keys %hash) {
- &DEBUG("cmdstats: hash{$_} => $hash{$_}");
+ my $i = $_;
+ foreach (keys %{ $hash{$i} }) {
+ &DEBUG("cmdstats: $hash{$i}{$_} = $_");
+ }
}
&DEBUG("end of cmdstats.");
&showProc(" (Time::HiRes)");
sub AUTOLOAD {
- if (defined $::AUTOLOAD) {
+ if (!defined $AUTOLOAD and defined $::AUTOLOAD) {
&DEBUG("AUTOLOAD: hrm.. ::AUTOLOAD defined!");
}
return unless (defined $AUTOLOAD);