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.40 by root, Thu May 1 06:33:19 2008 UTC vs.
Revision 1.43 by root, Fri Aug 29 06:48:45 2008 UTC

61 $pl->send_msg ($cf::SAY_CHANNEL); 61 $pl->send_msg ($cf::SAY_CHANNEL);
62 $pl->send_msg ($cf::CHAT_CHANNEL); 62 $pl->send_msg ($cf::CHAT_CHANNEL);
63 }, 63 },
64); 64);
65 65
66# TODO: remove once safe
66cf::register_command listen => sub { 67cf::register_command listen => sub {
67 my ($pl, $msg) = @_;
68 my $player = cf::player::find_active $pl->name;
69
70 if ($msg ne "") {
71 $msg = 10 if $msg > 10;
72
73 my $prev_listen = $player->listening;
74 $player->listening ($msg);
75 if ($prev_listen == $player->listening) {
76 $pl->message ("Your verbose level stays at $prev_listen.", cf::NDI_REPLY);
77 } else {
78 $pl->message ("Your verbose level is now " . $player->listening . ". (previously: $prev_listen)", cf::NDI_REPLY);
79 }
80 } else {
81 $pl->message ("Your verbose level is " . $player->listening . ".", cf::NDI_REPLY);
82 }
83}; 68};
84 69
85cf::register_command cointoss => sub { 70cf::register_command cointoss => sub {
86 my ($ob, $msg) = @_; 71 my ($ob, $msg) = @_;
87 72
795 # within a 5x5 square that have something resembling 780 # within a 5x5 square that have something resembling
796 # dialogue or support on_say. 781 # dialogue or support on_say.
797 my ($map, $x, $y) = ($ob->map, $ob->x - 2, $ob->y - 2); 782 my ($map, $x, $y) = ($ob->map, $ob->x - 2, $ob->y - 2);
798 783
799 for my $npc ( 784 for my $npc (
800 grep +($_->invoke (cf::EVENT_OBJECT_SAY, $ob->contr, $msg) && return) || NPC_Dialogue::has_dialogue $_, 785 grep +($_->invoke (cf::EVENT_OBJECT_SAY, $ob->contr, $msg) && return) || $_->has_dialogue,
801 map +($_, $_->inv), 786 map +($_, $_->inv),
802 grep $_, 787 grep $_,
803 map $map->at ($x + $_ % 5, $y + (int $_ / 5)), 788 map $map->at ($x + $_ % 5, $y + (int $_ / 5)),
804 0..24 789 0..24
805 ) { 790 ) {
850 835
851 cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; 836 cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg;
852 send_irc ("[%s] %s", $name, $msg); 837 send_irc ("[%s] %s", $name, $msg);
853 838
854 send_msg $_, $cf::CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat" 839 send_msg $_, $cf::CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat"
855 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; 840 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list;
856 841
857 } else { 842 } else {
858 $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); 843 $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY);
859 } 844 }
860}; 845};
874 859
875 cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; 860 cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg;
876 send_irc ("\007\0034{%s} %s\n", $name, $msg); 861 send_irc ("\007\0034{%s} %s\n", $name, $msg);
877 862
878 send_msg $_, $cf::CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_shout" 863 send_msg $_, $cf::CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_shout"
879 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; 864 for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list;
880 865
881 } else { 866 } else {
882 $pl->send_msg ($cf::CHAT_CHANNEL => "Shout what?", cf::NDI_RED | cf::NDI_DEF | cf::NDI_REPLY); 867 $pl->send_msg ($cf::CHAT_CHANNEL => "Shout what?", cf::NDI_RED | cf::NDI_DEF | cf::NDI_REPLY);
883 } 868 }
884}; 869};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines