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.37 by pippijn, Sun Sep 17 23:57:20 2006 UTC

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);
174 }
175
170 if (my $other = cf::player::find $target) { 176 elsif (my $other = cf::player::find $target) {
171 177
172 if ($msg) { 178 if ($msg) {
173 if ($target eq $name) { 179 if ($target eq $name) {
174 $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); 180 $who->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE);
175 } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { 181 } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) {
197 203
198 utf8::decode $args; 204 utf8::decode $args;
199 205
200 return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $who->{ext_last_tell}, $args); 206 return if $who->contr->invoke (cf::EVENT_PLAYER_TELL, $who->{ext_last_tell}, $args);
201 207
208 if ($who->{ext_last_tell} =~ /irc\//) {
209 my (undef, $nick) = split /\//, $who->{ext_last_tell}, 2;
210 $who->message ("You tell " . $who->{ext_last_tell} . ": $args");
211 ext::schmorp_irc::do_notice (sprintf "(%s) %s: %s\n", $name, $nick, $args);
212 }
213
202 if (my $other = cf::player::find $who->{ext_last_tell}) { 214 elsif (my $other = cf::player::find $who->{ext_last_tell}) {
203 215
204 if ($args) { 216 if ($args) {
205 $other->ob->{ext_ignore_tell}{$name} >= time 217 $other->ob->{ext_ignore_tell}{$name} >= time
206 or delete $other->ob->{ext_ignore_tell}{$name}; 218 or delete $other->ob->{ext_ignore_tell}{$name};
207 219
218 } else { 230 } else {
219 $who->message ("What do you want to tell ".$other->ob->name."?", cf::NDI_UNIQUE); 231 $who->message ("What do you want to tell ".$other->ob->name."?", cf::NDI_UNIQUE);
220 } 232 }
221 233
222 } else { 234 } else {
223 $who->message ("Can't reply, player left. Your message: $args", cf::NDI_UNIQUE); 235 $who->message ("Can't reply, player left. Your message: $args".$who->{ext_last_tell}, cf::NDI_UNIQUE);
224 } 236 }
225}; 237};
226 238
227cf::register_command ignore => 0, sub { 239cf::register_command ignore => 0, sub {
228 my ($who, $args) = @_; 240 my ($who, $args) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines