ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/chat.ext
(Generate patch)

Comparing deliantra/maps/perl/chat.ext (file contents):
Revision 1.36 by root, Wed Aug 30 08:34:20 2006 UTC vs.
Revision 1.39 by pippijn, Thu Sep 21 14:18:50 2006 UTC

120 if ($msg) { 120 if ($msg) {
121 my $name = $who->name; 121 my $name = $who->name;
122 my $NOW = time; 122 my $NOW = time;
123 123
124 utf8::encode $msg; # ->message not yet utf8-ified 124 utf8::encode $msg; # ->message not yet utf8-ified
125# cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; 125 cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg;
126 ext::schmorp_irc::do_notice (sprintf "[%s] %s", $name, $msg); 126 ext::schmorp_irc::do_notice (sprintf "[%s] %s", $name, $msg);
127 127
128 $_->ob->message ("$name chats: $msg", cf::NDI_BLUE) 128 $_->ob->message ("$name chats: $msg", cf::NDI_BLUE)
129 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; 129 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list;
130 130
142 142
143 if ($msg) { 143 if ($msg) {
144 my $NOW = time; 144 my $NOW = time;
145 my $name = $who->name; 145 my $name = $who->name;
146 146
147# cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; 147 cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg;
148 ext::schmorp_irc::do_notice (sprintf "{%s} %s\n", $name, $msg); 148 ext::schmorp_irc::do_notice (sprintf "{%s} %s\n", $name, $msg);
149 149
150 utf8::encode $msg; # ->message not yet utf8-ified 150 utf8::encode $msg; # ->message not yet utf8-ified
151 $_->ob->message ("$name shouts: $msg", cf::NDI_RED) 151 $_->ob->message ("$name shouts: $msg", cf::NDI_RED)
152 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; 152 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list;
165 165
166 return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $target, $msg); 166 return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $target, $msg);
167 167
168 my $name = $who->name; 168 my $name = $who->name;
169 169
170 if ($target =~ /irc\//) {
171 my (undef, $nick) = split /\//, $target, 2;
172 $who->message ("You tell $target: $args");
173 ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $msg);
170 if (my $other = cf::player::find $target) { 174 } elsif (my $other = cf::player::find $target) {
171 175
172 if ($msg) { 176 if ($msg) {
173 if ($target eq $name) { 177 if ($target eq $name) {
174 $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); 178 $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE);
175 } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { 179 } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) {
197 201
198 utf8::decode $args; 202 utf8::decode $args;
199 203
200 return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $who->{ext_last_tell}, $args); 204 return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $who->{ext_last_tell}, $args);
201 205
206 if ($who->{ext_last_tell} =~ /irc\//) {
207 my (undef, $nick) = split /\//, $who->{ext_last_tell}, 2;
208 $who->message ("You tell " . $who->{ext_last_tell} . ": $args");
209 ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $args);
202 if (my $other = cf::player::find $who->{ext_last_tell}) { 210 } elsif (my $other = cf::player::find $who->{ext_last_tell}) {
203 211
204 if ($args) { 212 if ($args) {
205 $other->ob->{ext_ignore_tell}{$name} >= time 213 $other->ob->{ext_ignore_tell}{$name} >= time
206 or delete $other->ob->{ext_ignore_tell}{$name}; 214 or delete $other->ob->{ext_ignore_tell}{$name};
207 215
218 } else { 226 } else {
219 $who->message ("What do you want to tell ".$other->ob->name."?", cf::NDI_UNIQUE); 227 $who->message ("What do you want to tell ".$other->ob->name."?", cf::NDI_UNIQUE);
220 } 228 }
221 229
222 } else { 230 } else {
223 $who->message ("Can't reply, player left. Your message: $args", cf::NDI_UNIQUE); 231 $who->message ("Can't reply, player left. Your message: $args".$who->{ext_last_tell}, cf::NDI_UNIQUE);
224 } 232 }
225}; 233};
226 234
227cf::register_command ignore => 0, sub { 235cf::register_command ignore => 0, sub {
228 my ($who, $args) = @_; 236 my ($who, $args) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines