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

Comparing deliantra/server/ext/chat.ext (file contents):
Revision 1.15 by root, Fri Apr 27 00:49:58 2007 UTC vs.
Revision 1.16 by root, Fri Apr 27 21:11:00 2007 UTC

764 return if $pl->contr->invoke (cf::EVENT_PLAYER_SAY, $msg); 764 return if $pl->contr->invoke (cf::EVENT_PLAYER_SAY, $msg);
765 765
766 if ($msg) { 766 if ($msg) {
767 my $name = $pl->name; 767 my $name = $pl->name;
768 768
769 utf8::encode $msg; # ->message not yet utf8-ified
770 $_->ob->message ("$name says: $msg", cf::NDI_GREY | cf::NDI_UNIQUE) 769 $_->ob->message ("$name says: $msg", cf::NDI_GREY | cf::NDI_UNIQUE)
771 for grep $pl->on_same_map_as ($_->ob), cf::player::list; 770 for grep $pl->on_same_map_as ($_->ob), cf::player::list;
772 utf8::decode $msg;
773 771
774 # npcs, magic_ears etc. 772 # npcs, magic_ears etc.
775 # first find all objects and theirt-level inventories 773 # first find all objects and their first-level inventories
776 # within a 5x5 square # that have something resembling 774 # within a 5x5 square that have something resembling
777 # dialogue or support on_say. 775 # dialogue or support on_say.
778 my ($map, $x, $y) = ($pl->map, $pl->x - 2, $pl->y - 2); 776 my ($map, $x, $y) = ($pl->map, $pl->x - 2, $pl->y - 2);
779 777
780 for my $npc ( 778 for my $npc (
781 grep +($_->invoke (cf::EVENT_OBJECT_SAY, $pl->contr, $msg) && return) || NPC_Dialogue::has_dialogue $_, 779 grep +($_->invoke (cf::EVENT_OBJECT_SAY, $pl->contr, $msg) && return) || NPC_Dialogue::has_dialogue $_,
850 my $name = $pl->name; 848 my $name = $pl->name;
851 849
852 cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; 850 cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg;
853 ext::schmorp_irc::do_notice (sprintf "\007\0034{%s} %s\n", $name, $msg); 851 ext::schmorp_irc::do_notice (sprintf "\007\0034{%s} %s\n", $name, $msg);
854 852
855 utf8::encode $msg; # ->message not yet utf8-ified
856 $_->ob->message ("$name shouts: $msg", cf::NDI_RED) 853 $_->ob->message ("$name shouts: $msg", cf::NDI_RED)
857 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; 854 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list;
858 855
859 } else { 856 } else {
860 $pl->message ("Shout what?", cf::NDI_UNIQUE); 857 $pl->message ("Shout what?", cf::NDI_UNIQUE);
882 $pl->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE); 879 $pl->message ("You are talking to yourself, you freak!", cf::NDI_UNIQUE);
883 } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { 880 } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) {
884 $pl->message ("$target ignores what you say. Give up on it.", cf::NDI_UNIQUE); 881 $pl->message ("$target ignores what you say. Give up on it.", cf::NDI_UNIQUE);
885 } else { 882 } else {
886 return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl->contr, $msg); 883 return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl->contr, $msg);
887 utf8::encode $msg; # ->message not yet utf8-ified
888 cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; 884 cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg;
889 885
890 $pl->message ("You tell $target: $msg"); 886 $pl->message ("You tell $target: $msg");
891 $other->ob->message ("$name tells you: $msg"); 887 $other->ob->message ("$name tells you: $msg");
892 $other->ob->{ext_last_tell} = $name; 888 $other->ob->{ext_last_tell} = $name;
917 if ($args) { 913 if ($args) {
918 $other->ob->{ext_ignore_tell}{$name} >= time 914 $other->ob->{ext_ignore_tell}{$name} >= time
919 or delete $other->ob->{ext_ignore_tell}{$name}; 915 or delete $other->ob->{ext_ignore_tell}{$name};
920 916
921 if ($other->ob->{ext_ignore_tell}{$name} < time) { 917 if ($other->ob->{ext_ignore_tell}{$name} < time) {
922 utf8::encode $args; # ->message not yet utf8-ified
923 cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $other->ob->name, $args; 918 cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $other->ob->name, $args;
924 919
925 $pl->message ("You tell " . $other->ob->name . ": $args"); 920 $pl->message ("You tell " . $other->ob->name . ": $args");
926 $other->ob->message ("$name tells you: $args"); 921 $other->ob->message ("$name tells you: $args");
927 $pl->{ext_last_tell} = $other->ob->name; 922 $pl->{ext_last_tell} = $other->ob->name;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines