… | |
… | |
41 | $who->message ("ignore <player> <tell | shout | all> <timeout>", cf::NDI_UNIQUE); |
41 | $who->message ("ignore <player> <tell | shout | all> <timeout>", cf::NDI_UNIQUE); |
42 | $who->message ("will ignore a player for <timeout> hours.", cf::NDI_UNIQUE); |
42 | $who->message ("will ignore a player for <timeout> hours.", cf::NDI_UNIQUE); |
43 | $who->message ("ignore list", cf::NDI_UNIQUE); |
43 | $who->message ("ignore list", cf::NDI_UNIQUE); |
44 | $who->message ("will show you a list of players currently ignored.", cf::NDI_UNIQUE); |
44 | $who->message ("will show you a list of players currently ignored.", cf::NDI_UNIQUE); |
45 | } |
45 | } |
46 | } |
46 | }; |
|
|
47 | |
|
|
48 | cf::register_command unignore => 0, sub { |
|
|
49 | my ($who, $args) = @_; |
|
|
50 | my ($target, $type) = split /\s+/, $args, 3; |
|
|
51 | my @ignored_players = split /\s+/, $who->{ignore}; |
|
|
52 | |
|
|
53 | if ($args eq "") { |
|
|
54 | if ($who->{ ext_ignore_tell }) { |
|
|
55 | $who->message ("Currently ignoring private messages from: ", cf::NDI_UNIQUE); |
|
|
56 | $who->message (join (", ", sort keys %{ $who->{ ext_ignore_tell } } ), cf::NDI_UNIQUE); |
|
|
57 | $who->message ("Currently ignoring shouts from: ", cf::NDI_UNIQUE); |
|
|
58 | $who->message (join (", ", sort keys %{ $who->{ ext_ignore_shout } } ), cf::NDI_UNIQUE); |
|
|
59 | } else { |
|
|
60 | $who->message ("Not ignoring anyone", cf::NDI_UNIQUE); |
|
|
61 | } |
|
|
62 | } else { |
|
|
63 | if (my $other = cf::player::find $target) { |
|
|
64 | if ($type eq "tell") { |
|
|
65 | $who->message ("Not ignoring private messages from ".$other->ob->name." anymore.", cf::NDI_UNIQUE); |
|
|
66 | delete $who->{ext_ignore_tell}{$other->ob->name}; |
|
|
67 | } elsif ($type eq "shout") { |
|
|
68 | $who->message ("Not ignoring shouts from ".$other->ob->name." anymore.", cf::NDI_UNIQUE); |
|
|
69 | delete $who->{ext_ignore_shout}{$other->ob->name}; |
|
|
70 | } elsif ($type eq "all") { |
|
|
71 | $who->message ("Not ignoring anything from ".$other->ob->name." anymore.", cf::NDI_UNIQUE); |
|
|
72 | delete $who->{ext_ignore_tell}{$other->ob->name}; |
|
|
73 | delete $who->{ext_ignore_shout}{$other->ob->name}; |
|
|
74 | } else { |
|
|
75 | $who->message ("You need to specify tell, shout or all.", cf::NDI_UNIQUE); |
|
|
76 | } |
|
|
77 | } else { |
|
|
78 | $who->message ("No such player or ambiguous name: $target", cf::NDI_UNIQUE); |
|
|
79 | } |
|
|
80 | } |
|
|
81 | }; |