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 |
} |