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.24 by root, Sun Jul 22 20:08:38 2007 UTC vs.
Revision 1.27 by root, Tue Jul 24 16:42:35 2007 UTC

826 for @plonmap; 826 for @plonmap;
827 } 827 }
828 } 828 }
829 829
830 } else { 830 } else {
831 $ob->contr->send_msg ($SAY_CHANNEL => "What do you want to say?", 0, reply => 1); 831 $ob->contr->ns->send_msg ($SAY_CHANNEL => "What do you want to say?", 0, reply => 1);
832 } 832 }
833}; 833};
834 834
835cf::register_command chat => sub { 835cf::register_command chat => sub {
836 my ($pl, $msg) = @_; 836 my ($ob, $msg) = @_;
837 837
838 utf8::decode $msg; 838 utf8::decode $msg;
839 839
840 my $pl = $ob->contr;
841
840 return if $pl->contr->invoke (cf::EVENT_PLAYER_CHAT, $msg); 842 return if $pl->invoke (cf::EVENT_PLAYER_CHAT, $msg);
841 843
842 if ($msg) { 844 if ($msg) {
843 my $name = $pl->name; 845 my $name = $pl->name;
844 my $NOW = time; 846 my $NOW = time;
845 847
857cf::register_command shout => sub { 859cf::register_command shout => sub {
858 my ($pl, $msg) = @_; 860 my ($pl, $msg) = @_;
859 861
860 utf8::decode $msg; 862 utf8::decode $msg;
861 863
864 my $pl = $ob->contr;
865
862 return if $pl->contr->invoke (cf::EVENT_PLAYER_SHOUT, $msg); 866 return if $pl->invoke (cf::EVENT_PLAYER_SHOUT, $msg);
863 867
864 if ($msg) { 868 if ($msg) {
865 my $NOW = time; 869 my $NOW = time;
866 my $name = $pl->name; 870 my $name = $pl->name;
867 871
912 if ($target eq $name) { 916 if ($target eq $name) {
913 $ns->send_msg ($pl_channel => "You are talking to yourself, you freak!", reply => 1); 917 $ns->send_msg ($pl_channel => "You are talking to yourself, you freak!", reply => 1);
914 } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) { 918 } elsif ($other->ob->{ext_ignore_tell}{$name} >= time) {
915 $ns->send_msg ($pl_channel => "$target ignores what you say. Give up on it.", reply => 1); 919 $ns->send_msg ($pl_channel => "$target ignores what you say. Give up on it.", reply => 1);
916 } else { 920 } else {
917 return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl->contr, $msg); 921 return if $other->invoke (cf::EVENT_PLAYER_TOLD, $pl, $msg);
918 cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg; 922 cf::LOG cf::llevDebug, sprintf "TELL [%s>%s] %s\n", $name, $target, $msg;
919 923
920 $ns->send_msg ($pl_channel => "You tell $target: $msg", reply => 1); 924 $ns->send_msg ($pl_channel => "You tell $target: $msg", reply => 1);
921 $other->ns->send_msg ($other_channel => "$name tells you: $msg"); 925 $other->ns->send_msg ($other_channel => "$name tells you: $msg");
922 } 926 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines