--- deliantra/server/ext/irc.ext 2007/08/25 11:51:04 1.5 +++ deliantra/server/ext/irc.ext 2008/08/29 23:31:41 1.13 @@ -7,10 +7,10 @@ return unless exists $cf::CFG{irc_server}; -my $BOTSERVER = $cf::CFG{irc_server}; -my $BOTPORT = $cf::CFG{irc_port}; -my $BOTNAME = $cf::CFG{irc_nick}; -my $BOTCHAN = $cf::CFG{irc_chan}; +my $BOTSERVER = $cf::CFG{irc_server} || "localhost"; +my $BOTPORT = $cf::CFG{irc_port} || 6667; +my $BOTNAME = $cf::CFG{irc_nick} || "server"; +my $BOTCHAN = $cf::CFG{irc_chan} || "cf"; my $CON; # the connection @@ -37,8 +37,10 @@ my ($name, $me, $msg) = @_; if ($msg eq "!who") { - do_notice $_ - for ext::commands::who_listing (0, "."); + # clobbers irc, http is available + do_notice "see http://www.deliantra.net/userlist.crossfire.schmorp.de.html"; +# do_notice $_ +# for ext::commands::who_listing (0, "."); } elsif ($msg =~ /^\!tell/) { my (undef, $target, $tmsg) = split / /, $msg, 3; @@ -53,7 +55,7 @@ } else { cf::LOG cf::llevDebug, sprintf "TELL [%s/%s>%s] %s\n", $name, $me, $target, $tmsg; - $other->ns->send_msg (cf::chat::tell_channel ("$name/$me"), "$name/$me tells you: $tmsg", cf::NDI_DK_ORANGE | cf::NDI_DEF); + $other->ns->send_msg (ext::chat::tell_channel ("$name/$me"), "$name/$me tells you: $tmsg", cf::NDI_DK_ORANGE | cf::NDI_DEF); } } else { do_notice "$me: What do you want to tell $target?"; @@ -87,9 +89,10 @@ if ($tmsg =~ /^\!/) { handle_fcmd ($name, $nick, $tmsg); } elsif ($tmsg =~ m/\S/) { - $_->ns->send_msg ($ext::chat::CHAT_CHANNEL, + $_->ns->send_msg ($cf::CHAT_CHANNEL, "$name/".$nick." chats: $tmsg", cf::NDI_BLUE | cf::NDI_DEF - ) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; + ) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list; + cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", "$name/$nick", $tmsg; } 1; }, @@ -105,11 +108,7 @@ ); } -Event->timer ( - reentrant => 0, - after => 1, - interval => 30, - data => cf::WF_AUTOCANCEL, - cb => Coro::unblock_sub { check_connection }, -); +our $RECONNECT = cf::periodic 30, Coro::unblock_sub { + check_connection; +};