… | |
… | |
66 | $ob->reply (undef, "You can temporarily see through walls."); |
66 | $ob->reply (undef, "You can temporarily see through walls."); |
67 | |
67 | |
68 | 1 |
68 | 1 |
69 | }; |
69 | }; |
70 | |
70 | |
71 | cf::register_command maps => sub { |
|
|
72 | my ($ob, $arg) = @_; |
|
|
73 | |
|
|
74 | no re 'eval'; $arg = qr<$arg>; |
|
|
75 | |
|
|
76 | my $format = "%2s %2s %-30.30s\n"; |
|
|
77 | |
|
|
78 | my $msg = sprintf $format, "Pl", "Fl", "Reset", "Name"; |
|
|
79 | |
|
|
80 | for (sort keys %cf::MAP) { |
|
|
81 | my $map = $cf::MAP{$_} |
|
|
82 | or next; |
|
|
83 | |
|
|
84 | $msg |
|
|
85 | } |
|
|
86 | |
|
|
87 | 1 |
|
|
88 | }; |
|
|
89 | |
|
|
90 | cf::register_command reset => sub { |
71 | cf::register_command reset => sub { |
91 | my ($ob, $arg) = @_; |
72 | my ($ob, $arg) = @_; |
92 | |
73 | |
93 | return unless $ob->may ("command_reset"); |
74 | return unless $ob->may ("command_reset"); |
94 | |
75 | |
95 | $ob->reply (undef, "You can temporarily see through walls."); |
76 | my $map = $ob->map; |
|
|
77 | |
|
|
78 | my @pl = $map->players; |
|
|
79 | $_->enter_link for @pl; |
|
|
80 | Coro::async_pool { |
|
|
81 | my $name = $map->{path}->as_string; |
|
|
82 | |
|
|
83 | $map->reset; |
|
|
84 | $_->leave_link for @pl; |
|
|
85 | |
|
|
86 | $ob->reply (undef, "$name was reset."); |
|
|
87 | }; |
96 | |
88 | |
97 | 1 |
89 | 1 |
98 | }; |
90 | }; |
99 | |
91 | |
100 | for my $command (qw(teleport summon arrest kick banish)) { |
92 | for my $command (qw(teleport summon arrest kick banish)) { |