$msgType = 'chat';
}
- if (!exists $dcc{'CHAT'}{$nick}) {
- my $userHandle = &verifyUser($who, $nuh);
+ if (!exists $dcc{'CHATvrfy'}{$nick}) {
+ $userHandle = &verifyUser($who, $nuh);
my $crypto = $userList{$userHandle}{'pass'};
my $success = 0;
} else {
&status("DCC CHAT: incorrect pass; closing connection.");
&DEBUG("chat: sock => '$sock'.");
-### $sock->close();
+ $sock->close();
+ delete $dcc{'CHAT'}{$nick};
&DEBUG("chat: after closing sock. FIXME");
### BUG: close seizes bot. why?
}
if ($success) {
&status("DCC CHAT: user $nick is here!");
- $dcc{'CHAT'}{$nick} = $sock;
&DCCBroadcast("$nick ($uh) has joined the chat arena.");
+ $dcc{'CHATvrfy'}{$nick} = 1;
+ if ($userHandle ne "default") {
+ &dccsay($nick,"Flags: $userList{$userHandle}{'flags'}");
+ }
}
return;
}
-
$userHandle = &verifyUser($who, $nuh);
&status("$b_red=$b_cyan$who$b_red=$ob $message");
if ($message =~ s/^\.//) { # dcc chat commands.
sub on_endofmotd {
my ($self) = @_;
+ # what's the following for?
+ $ident = $param{'ircNick'};
+ # update IRCStats.
+ $ircstats{'ConnectTime'} = time();
+ $ircstats{'ConnectCount'}++;
+
if (&IsParam("wingate")) {
my $file = "$bot_base_dir/$param{'ircUser'}.wingate";
open(IN, $file);
}
if ($firsttime) {
- &DEBUG("on_EOM: calling sS in 60s.");
$conn->schedule(60, \&setupSchedulers, "");
$firsttime = 0;
}
# pity Net::IRC doesn't store nuh. Here's a hack :)
$self->whois($nick);
+ $type ||= "???";
if ($type eq 'SEND') { # GET for us.
# incoming DCC SEND. we're receiving a file.
&DEBUG("starting chat.");
$self->new_chat($event);
} else {
- &status("${b_green}DCC $type$ob unknown ...");
+ &WARN("${b_green}DCC $type$ob (1)");
}
}
&DEBUG("dcc_close: nick => '$nick'.");
- if (exists $dcc{'SEND'}{$nick} and -f "temp/$nick.txt") {
+ if (exists $dcc{'SEND'}{$nick} and -f "$param{tempDir}/$nick.txt") {
&status("${b_green}DCC SEND$ob close from $b_cyan$nick$ob");
&status("dcc_close: purging $nick.txt from Debian.pl");
- unlink "temp/$nick.txt";
+ unlink "$param{tempDir}/$nick.txt";
delete $dcc{'SEND'}{$nick};
} elsif (exists $dcc{'CHAT'}{$nick} and $dcc{'CHAT'}{$nick} eq $sock) {
&status("${b_green}DCC CHAT$ob close from $b_cyan$nick$ob");
delete $dcc{'CHAT'}{$nick};
} else {
- &status("${b_green}DCC$ob UNKNOWN close from $b_cyan$nick$ob");
+ &status("${b_green}DCC$ob UNKNOWN close from $b_cyan$nick$ob (2)");
}
}
my $sock = ($event->to)[0];
$msgType = 'chat';
+ $type ||= "???";
+
if ($type eq 'SEND') {
&status("${b_green}DCC lGET$ob established with $b_cyan$nick$ob");
} elsif ($type eq 'CHAT') {
- &status("${b_green}DCC CHAT$ob established with $b_cyan$nick$ob ($nuh{$nick})");
- my $userHandle = &verifyUser($nick, $nuh{lc $nick});
+ &status("${b_green}DCC CHAT$ob established with $b_cyan$nick$ob $b_yellow($ob$nuh{$nick}$b_yellow)$ob");
+ $userHandle = &verifyUser($nick, $nuh{lc $nick});
my $crypto = $userList{$userHandle}{'pass'};
+ $dcc{'CHAT'}{$nick} = $sock;
+
if (defined $crypto) {
- $self->privmsg($sock,"Enter Password, $userHandle.");
+ &dccsay($nick,"Enter Password, $userHandle.");
} else {
- $self->privmsg($sock,"Welcome to blootbot DCC CHAT interface, $userHandle.");
+ &dccsay($nick,"Welcome to blootbot DCC CHAT interface, $userHandle.");
}
} elsif ($type eq 'SEND') {
&DEBUG("Starting DCC receive.");
&DEBUG(" => '$_'.");
}
} else {
- &status("${b_green}DCC $type$ob unknown ...");
+ &WARN("${b_green}DCC $type$ob (3)");
}
}
$chanstats{$chan}{'Join'}++;
$userstats{lc $who}{'Join'} = time() if (&IsParam("seenStats"));
+ &joinfloodCheck($who, $chan, $event->userhost);
+
# netjoin detection.
my $netsplit = 0;
if (exists $netsplit{lc $who}) {
$netsplit = 1;
}
+ if ($netsplit and !$netsplittime) {
+ &status("ok.... re-running chanlimitCheck in 60.");
+ $conn->schedule(60, sub {
+ &chanlimitCheck();
+ $netsplittime = undef;
+ } );
+
+ $netsplittime = time();
+ }
+
# how to tell if there's a netjoin???
my $netsplitstr = "";
&status(">>> kick/$b_blue$chan$ob [$b$kickee!$uh$ob] by $b_cyan$kicker$ob $b_yellow($ob$reason$b_yellow)$ob");
+ $chan = lc $chan; # forgot about this, found by xsdg, 20001229.
$chanstats{$chan}{'Kick'}++;
if ($kickee eq $ident) {
my $nick = $event->nick;
my $userhost = $event->userhost;
+ if (!exists $floodjoin{$chan}{$nick}{Time}) {
+ &WARN("on_part: $nick/$chan not in floodjoin hash?");
+ } else {
+ delete $floodjoin{$chan}{$nick};
+ }
+
$chanstats{$chan}{'Part'}++;
&DeleteUserInfo($nick,$chan);
&clearChanVars($chan) if ($nick eq $ident);