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.13 by root, Mon Sep 8 11:39:47 2008 UTC vs.
Revision 1.17 by root, Fri May 14 22:56:47 2010 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 };
43 47
44 () 48 ()
45} 49}
46 50
47cf::sync_job { 51cf::post_init {
48 my $guard = cf::lock_acquire "ext::help::loading";
49 cf::async_ext { 52 cf::async_ext { reload };
50 $Coro::current->{desc} = "help loader";
51 reload;
52 undef $guard;
53 };
54}; 53};
55
56# for lack of a better place: "media tags"
57# b bold
58# i italic
59# ul underlined
60# fixed font
61# arcane font
62# hand font
63# strange font
64# print font (default)
65# color=xxx
66 54
67cf::register_command help => sub { 55cf::register_command help => sub {
68 my ($pl, $topic) = @_; 56 my ($pl, $topic) = @_;
69 57
70 if (cf::lock_active "ext::help::loading") { 58 if (cf::lock_active "ext::help::loading") {
82 push @{$topics{$v->[0]}}, $k; 70 push @{$topics{$v->[0]}}, $k;
83 } 71 }
84 72
85 my $res; 73 my $res;
86 while (my ($k, $v) = each %topics) { 74 while (my ($k, $v) = each %topics) {
87 $res .= "B<$k:>\n" . (join " ", sort @$v) . "\n\n"; 75 $res .= "T<$k:>\n\n" . (join " ", sort @$v) . "\n\n";
88 } 76 }
89 77
90 $pl->send_msg ($HELP_CHANNEL => $res, cf::NDI_REPLY | cf::NDI_CLEAR); 78 $pl->send_msg ($HELP_CHANNEL => $res, cf::NDI_REPLY | cf::NDI_CLEAR);
91 79
92 } elsif (my $item = $TOPIC->{$topic}) { 80 } elsif (my $item = $TOPIC->{$topic}) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines