ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cf.schmorp.de/maps/perl/unignore.ext
Revision: 1.2
Committed: Sat May 6 20:04:49 2006 UTC (18 years, 2 months ago) by pippijn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
State: FILE REMOVED
Log Message:
Conatenated ignore and unignore in ignore.ext

File Contents

# Content
1 cf::register_command unignore => 0, sub {
2 my ($who, $args) = @_;
3 my ($target, $type) = split /\s+/, $args, 3;
4 my @ignored_players = split /\s+/, $who->{ignore};
5
6 if ($args eq "") {
7 if ($who->{ ext_ignore_tell }) {
8 $who->message ("Currently ignoring private messages from: ", cf::NDI_UNIQUE);
9 $who->message (join (", ", sort keys %{ $who->{ ext_ignore_tell } } ), cf::NDI_UNIQUE);
10 $who->message ("Currently ignoring shouts from: ", cf::NDI_UNIQUE);
11 $who->message (join (", ", sort keys %{ $who->{ ext_ignore_shout } } ), cf::NDI_UNIQUE);
12 } else {
13 $who->message ("Not ignoring anyone", cf::NDI_UNIQUE);
14 }
15 } else {
16 if (my $other = cf::player::find $target) {
17 if ($type eq "tell") {
18 $who->message ("Not ignoring private messages from ".$other->ob->name." anymore.", cf::NDI_UNIQUE);
19 delete $who->{ext_ignore_tell}{$other->ob->name};
20 } elsif ($type eq "shout") {
21 $who->message ("Not ignoring shouts from ".$other->ob->name." anymore.", cf::NDI_UNIQUE);
22 delete $who->{ext_ignore_shout}{$other->ob->name};
23 } elsif ($type eq "all") {
24 $who->message ("Not ignoring anything from ".$other->ob->name." anymore.", cf::NDI_UNIQUE);
25 delete $who->{ext_ignore_tell}{$other->ob->name};
26 delete $who->{ext_ignore_shout}{$other->ob->name};
27 } else {
28 $who->message ("You need to specify tell, shout or all.", cf::NDI_UNIQUE);
29 }
30 } else {
31 $who->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE);
32 }
33 }
34 }