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.21 by root, Fri Jul 20 16:11:10 2007 UTC vs.
Revision 1.22 by root, Sun Jul 22 14:17:57 2007 UTC

4# implement a replacement for the built-in say/chat/shout/tell/reply commands 4# implement a replacement for the built-in say/chat/shout/tell/reply commands
5# adds ignore/unignore functionality 5# adds ignore/unignore functionality
6 6
7use NPC_Dialogue; 7use NPC_Dialogue;
8use POSIX (); # for strftime only 8use POSIX (); # for strftime only
9
10our $SAY_CHANNEL = {
11 id => "say",
12 title => "Map",
13 reply => "say ",
14 tooltip => "Things said to and replied from npcs near you and other players on the same map only.",
15};
16
17our $CHAT_CHANNEL = {
18 id => "chat",
19 title => "Chat",
20 reply => "chat ",
21 tooltip => "Player chat and shouts, global to the server.",
22};
9 23
10sub clean_timeouts($) { 24sub clean_timeouts($) {
11 my ($player) = @_; 25 my ($player) = @_;
12 my $NOW = time; 26 my $NOW = time;
13 27
38 prio => -1000, 52 prio => -1000,
39 on_login => sub { 53 on_login => sub {
40 my ($pl) = @_; 54 my ($pl) = @_;
41 55
42 clean_timeouts $pl->ob; 56 clean_timeouts $pl->ob;
57 $pl->ns->send_msg ($SAY_CHANNEL);
58 $pl->ns->send_msg ($CHAT_CHANNEL);
43 }, 59 },
44); 60);
45 61
46cf::register_command listen => sub { 62cf::register_command listen => sub {
47 my ($pl, $msg) = @_; 63 my ($pl, $msg) = @_;
745 $pl->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE); 761 $pl->message ($emote->{self}, cf::NDI_GREY | cf::NDI_UNIQUE);
746 } 762 }
747 }; 763 };
748 }; 764 };
749} 765}
750
751our $SAY_CHANNEL = {
752 id => "say",
753 title => "Map",
754 reply => "say ",
755 tooltip => "Things said to and replied from npcs near you and other players on the same map only.",
756};
757 766
758cf::register_command me => sub { 767cf::register_command me => sub {
759 my ($pl, $msg) = @_; 768 my ($pl, $msg) = @_;
760 769
761 my $name = $pl->name; 770 my $name = $pl->name;
819 } 828 }
820 829
821 } else { 830 } else {
822 $pl->contr->send_msg ($SAY_CHANNEL => "What do you want to say?", 0, reply => 1); 831 $pl->contr->send_msg ($SAY_CHANNEL => "What do you want to say?", 0, reply => 1);
823 } 832 }
824};
825
826our $CHAT_CHANNEL = {
827 id => "chat",
828 title => "Chat",
829 reply => "chat ",
830 tooltip => "Player chat and shouts, global to the server.",
831}; 833};
832 834
833cf::register_command chat => sub { 835cf::register_command chat => sub {
834 my ($pl, $msg) = @_; 836 my ($pl, $msg) = @_;
835 837

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines