ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/help.ext
(Generate patch)

Comparing deliantra/server/ext/help.ext (file contents):
Revision 1.12 by root, Fri Apr 11 01:15:49 2008 UTC vs.
Revision 1.16 by root, Tue Sep 23 05:01:41 2008 UTC

32 32
33 @topics 33 @topics
34} 34}
35 35
36sub reload() { 36sub reload() {
37 my $guard = cf::lock_acquire "ext::help::loading";
38
39 local $Coro::current->{desc} = "help loader";
40
37 $TOPIC = { 41 $TOPIC = {
38 (load_topics "DM Commands" => "dmcommand_help"), 42 (load_topics "DM Commands" => "dmcommand_help"),
39 (load_topics "Emotes" => "emote_help"), 43 (load_topics "Emotes" => "emote_help"),
40 (load_topics "Commands" => "command_help"), 44 (load_topics "Commands" => "command_help"),
41 (load_topics "Generic Help Topics" => "generic_help"), 45 (load_topics "Generic Help Topics" => "generic_help"),
42 }; 46 };
47
48 ()
43} 49}
44 50
45cf::sync_job { 51cf::post_init {
46 my $guard = cf::lock_acquire "ext::help::loading";
47 cf::async_ext { 52 cf::async {
48 $Coro::current->{desc} = "help loader";
49 reload; 53 reload;
50 undef $guard;
51 }; 54 };
52}; 55};
53
54# for lack of a better place: "media tags"
55# b bold
56# i italic
57# ul underlined
58# fixed font
59# arcane font
60# hand font
61# strange font
62# print font (default)
63# color=xxx
64 56
65cf::register_command help => sub { 57cf::register_command help => sub {
66 my ($pl, $topic) = @_; 58 my ($pl, $topic) = @_;
67 59
68 if (cf::lock_active "ext::help::loading") { 60 if (cf::lock_active "ext::help::loading") {
80 push @{$topics{$v->[0]}}, $k; 72 push @{$topics{$v->[0]}}, $k;
81 } 73 }
82 74
83 my $res; 75 my $res;
84 while (my ($k, $v) = each %topics) { 76 while (my ($k, $v) = each %topics) {
85 $res .= "B<$k:>\n" . (join " ", sort @$v) . "\n\n"; 77 $res .= "T<$k:>\n\n" . (join " ", sort @$v) . "\n\n";
86 } 78 }
87 79
88 $pl->send_msg ($HELP_CHANNEL => $res, cf::NDI_REPLY | cf::NDI_CLEAR); 80 $pl->send_msg ($HELP_CHANNEL => $res, cf::NDI_REPLY | cf::NDI_CLEAR);
89 81
90 } elsif (my $item = $TOPIC->{$topic}) { 82 } elsif (my $item = $TOPIC->{$topic}) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines