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.41 by pippijn, Sun Dec 10 16:51:31 2006 UTC vs.
Revision 1.42 by root, Tue Dec 12 16:59:34 2006 UTC

31 31
32 clean_timeouts $pl->ob; 32 clean_timeouts $pl->ob;
33 }, 33 },
34; 34;
35 35
36cf::register_command listen => 0, sub { 36cf::register_command listen => sub {
37 my ($who, $msg) = @_; 37 my ($who, $msg) = @_;
38 my $player = cf::player::find $who->name; 38 my $player = cf::player::find $who->name;
39 39
40 if ($msg ne "") { 40 if ($msg ne "") {
41 my $prev_listen = $player->listening; 41 my $prev_listen = $player->listening;
48 } else { 48 } else {
49 $who->message ("Your verbose level is " . $player->listening . ".", cf::NDI_UNIQUE); 49 $who->message ("Your verbose level is " . $player->listening . ".", cf::NDI_UNIQUE);
50 } 50 }
51}; 51};
52 52
53cf::register_command say => 0, sub { 53cf::register_command say => sub {
54 my ($who, $msg) = @_; 54 my ($who, $msg) = @_;
55 55
56 utf8::decode $msg; 56 utf8::decode $msg;
57 57
58 return if $who->contr->invoke (cf::EVENT_PLAYER_SAY, $msg); 58 return if $who->contr->invoke (cf::EVENT_PLAYER_SAY, $msg);
108 } else { 108 } else {
109 $who->message ("What do you want to say?", cf::NDI_UNIQUE); 109 $who->message ("What do you want to say?", cf::NDI_UNIQUE);
110 } 110 }
111}; 111};
112 112
113cf::register_command chat => 0, sub { 113cf::register_command chat => sub {
114 my ($who, $msg) = @_; 114 my ($who, $msg) = @_;
115 115
116 utf8::decode $msg; 116 utf8::decode $msg;
117 117
118 return if $who->contr->invoke (cf::EVENT_PLAYER_CHAT, $msg); 118 return if $who->contr->invoke (cf::EVENT_PLAYER_CHAT, $msg);
131 } else { 131 } else {
132 $who->message ("Chat what?", cf::NDI_UNIQUE); 132 $who->message ("Chat what?", cf::NDI_UNIQUE);
133 } 133 }
134}; 134};
135 135
136cf::register_command shout => 0, sub { 136cf::register_command shout => sub {
137 my ($who, $msg) = @_; 137 my ($who, $msg) = @_;
138 138
139 utf8::decode $msg; 139 utf8::decode $msg;
140 140
141 return if $who->contr->invoke (cf::EVENT_PLAYER_SHOUT, $msg); 141 return if $who->contr->invoke (cf::EVENT_PLAYER_SHOUT, $msg);
155 $who->message ("Shout what?", cf::NDI_UNIQUE); 155 $who->message ("Shout what?", cf::NDI_UNIQUE);
156 } 156 }
157 157
158}; 158};
159 159
160cf::register_command tell => 0, sub { 160cf::register_command tell => sub {
161 my ($who, $args) = @_; 161 my ($who, $args) = @_;
162 my ($target, $msg) = split /\s+/, $args, 2; 162 my ($target, $msg) = split /\s+/, $args, 2;
163 163
164 utf8::decode $msg; 164 utf8::decode $msg;
165 165
193 } else { 193 } else {
194 $who->message ("No such player. Your message: $msg", cf::NDI_UNIQUE); 194 $who->message ("No such player. Your message: $msg", cf::NDI_UNIQUE);
195 } 195 }
196}; 196};
197 197
198cf::register_command reply => 0, sub { 198cf::register_command reply => sub {
199 my ($who, $args) = @_; 199 my ($who, $args) = @_;
200 my $name = $who->name; 200 my $name = $who->name;
201 201
202 utf8::decode $args; 202 utf8::decode $args;
203 203
230 } else { 230 } else {
231 $who->message ("Can't reply, player left. Your message: $args".$who->{ext_last_tell}, cf::NDI_UNIQUE); 231 $who->message ("Can't reply, player left. Your message: $args".$who->{ext_last_tell}, cf::NDI_UNIQUE);
232 } 232 }
233}; 233};
234 234
235cf::register_command ignore => 0, sub { 235cf::register_command ignore => sub {
236 my ($who, $args) = @_; 236 my ($who, $args) = @_;
237 my ($target, $type, $timeout) = split /\s+/, $args; 237 my ($target, $type, $timeout) = split /\s+/, $args;
238 238
239 if ($args eq "list") { 239 if ($args eq "list") {
240 clean_timeouts $who; 240 clean_timeouts $who;
279 . "Usage: ignore list\n" 279 . "Usage: ignore list\n"
280 . "will show you a list of players currently ignored.", cf::NDI_UNIQUE); 280 . "will show you a list of players currently ignored.", cf::NDI_UNIQUE);
281 } 281 }
282}; 282};
283 283
284cf::register_command unignore => 0, sub { 284cf::register_command unignore => sub {
285 my ($who, $args) = @_; 285 my ($who, $args) = @_;
286 my ($target, $type) = split /\s+/, $args; 286 my ($target, $type) = split /\s+/, $args;
287 287
288 if ($args eq "") { 288 if ($args eq "") {
289 if ($who->{ext_ignore_tell}) { 289 if ($who->{ext_ignore_tell}) {
313 $who->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); 313 $who->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE);
314 } 314 }
315 } 315 }
316}; 316};
317 317
318cf::register_command seen => 0, sub { 318cf::register_command seen => sub {
319 my ($who, $args) = @_; 319 my ($who, $args) = @_;
320 320
321 if (my ($login) = $args =~ /(\S+)/) { 321 if (my ($login) = $args =~ /(\S+)/) {
322 if ($login eq $who->name) { 322 if ($login eq $who->name) {
323 $who->message ("Very funny, $login. Ha. Ha.", cf::NDI_UNIQUE); 323 $who->message ("Very funny, $login. Ha. Ha.", cf::NDI_UNIQUE);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines