ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/irc.ext
(Generate patch)

Comparing deliantra/server/ext/irc.ext (file contents):
Revision 1.1 by root, Fri May 18 13:56:50 2007 UTC vs.
Revision 1.5 by elmex, Sat Aug 25 11:51:04 2007 UTC

34} 34}
35 35
36sub handle_fcmd { 36sub handle_fcmd {
37 my ($name, $me, $msg) = @_; 37 my ($name, $me, $msg) = @_;
38 38
39 utf8::decode $msg;
40
41 if ($msg eq "!who") { 39 if ($msg eq "!who") {
42 do_notice $_ 40 do_notice $_
43 for ext::commands::who_listing (); 41 for ext::commands::who_listing (0, ".");
44 42
45 } elsif ($msg =~ /^\!tell/) { 43 } elsif ($msg =~ /^\!tell/) {
46 my (undef, $target, $tmsg) = split / /, $msg, 3; 44 my (undef, $target, $tmsg) = split / /, $msg, 3;
47 45
48 if (my $other = cf::player::find_active $target) { 46 if (my $other = cf::player::find_active $target) {
53 } elsif ($other->ob->{ext_ignore_tell}{$me} >= time) { 51 } elsif ($other->ob->{ext_ignore_tell}{$me} >= time) {
54 $CON->send_chan ($BOTCHAN, NOTICE => "$me: $target ignores what you say. Give up on it.", $BOTCHAN); 52 $CON->send_chan ($BOTCHAN, NOTICE => "$me: $target ignores what you say. Give up on it.", $BOTCHAN);
55 } else { 53 } else {
56 cf::LOG cf::llevDebug, sprintf "TELL [%s/%s>%s] %s\n", $name, $me, $target, $tmsg; 54 cf::LOG cf::llevDebug, sprintf "TELL [%s/%s>%s] %s\n", $name, $me, $target, $tmsg;
57 55
58 $other->ob->message ("$name/$me tells you: $tmsg"); 56 $other->ns->send_msg (cf::chat::tell_channel ("$name/$me"), "$name/$me tells you: $tmsg", cf::NDI_DK_ORANGE | cf::NDI_DEF);
59 $other->ob->{ext_last_tell} = "$name/$me";
60 } 57 }
61 } else { 58 } else {
62 do_notice "$me: What do you want to tell $target?"; 59 do_notice "$me: What do you want to tell $target?";
63 } 60 }
64 61
78 irc_privmsg => sub { 75 irc_privmsg => sub {
79 my ($con, $msg) = @_; 76 my ($con, $msg) = @_;
80 my $name = 'irc'; 77 my $name = 'irc';
81 my $nick = Net::IRC3::Util::prefix_nick ($msg); 78 my $nick = Net::IRC3::Util::prefix_nick ($msg);
82 my $NOW = Time::HiRes::time; 79 my $NOW = Time::HiRes::time;
80
83 my $tmsg = $msg->{trailing}; 81 my $tmsg = $msg->{trailing};
84 $tmsg =~ s/\x01[^\x01]*\x01//g; 82 $tmsg =~ s/\x01[^\x01]*\x01//g;
85 $tmsg =~ s/\015?\012/ /g; 83 $tmsg =~ s/\015?\012/ /g;
86 utf8::encode $tmsg; # ->message not yet utf8-ified 84
85 utf8::decode $tmsg;
86
87 if ($tmsg =~ /^\!/) { 87 if ($tmsg =~ /^\!/) {
88 handle_fcmd ($name, $nick, $tmsg); 88 handle_fcmd ($name, $nick, $tmsg);
89 } elsif ($tmsg =~ m/\S/) { 89 } elsif ($tmsg =~ m/\S/) {
90 $_->ob->message ( 90 $_->ns->send_msg ($ext::chat::CHAT_CHANNEL,
91 "$name/".$nick." chats: $tmsg", cf::NDI_BLUE 91 "$name/".$nick." chats: $tmsg", cf::NDI_BLUE | cf::NDI_DEF
92 ) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; 92 ) for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list;
93 } 93 }
94 1; 94 1;
95 }, 95 },
96# registered => sub { 96# registered => sub {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines