ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.591 by root, Tue Nov 6 23:33:15 2012 UTC vs.
Revision 1.592 by root, Fri Nov 9 00:11:49 2012 UTC

3701 my $face = cf::face::find "sound/$v"; 3701 my $face = cf::face::find "sound/$v";
3702 cf::sound::set $k => $face; 3702 cf::sound::set $k => $face;
3703 } 3703 }
3704} 3704}
3705 3705
3706#d# move docstuff to help or so
3707our %DOCSTRING;
3708
3706sub reload_pod { 3709sub reload_pod {
3707 trace "loading pods $PODDIR\n"; 3710 trace "loading pods $PODDIR\n";
3708 3711
3712 %DOCSTRING = ();
3709 my @command_help; 3713 my @command_list;
3710 3714
3711 for ( 3715 for (
3712 [0, "command_help"], 3716 [0, "command_help"],
3713 [1, "emote_help"], 3717 [1, "emote_help"],
3714 [2, "dmcommand_help"], 3718 [2, "dmcommand_help"],
3717 3721
3718 my $paragraphs = &cf::pod::load_pod ("$PODDIR/$path.pod") 3722 my $paragraphs = &cf::pod::load_pod ("$PODDIR/$path.pod")
3719 or die "unable to load $path"; 3723 or die "unable to load $path";
3720 3724
3721 my $level = 1e9; 3725 my $level = 1e9;
3726 my $rpar;
3722 3727
3723 for my $par (@$paragraphs) { 3728 for my $par (@$paragraphs) {
3724 if ($par->{type} eq "head2") { 3729 if ($par->{type} eq "head2") {
3725 # this code taken almost verbatim from DC/Protocol.pm 3730 # this code taken almost verbatim from DC/Protocol.pm
3726 3731
3732 $_ = $_ eq ".*" ? "" : " $_" 3737 $_ = $_ eq ".*" ? "" : " $_"
3733 for @args; 3738 for @args;
3734 3739
3735 my @variants = map "$cmd$_", sort { (length $a) <=> (length $b) } @args; 3740 my @variants = map "$cmd$_", sort { (length $a) <=> (length $b) } @args;
3736 3741
3737 push @command_help, [$type, \@variants, &cf::pod::as_cfpod ([$par])]; 3742 $rpar = \($DOCSTRING{"command/$cmd"} = &cf::pod::as_cfpod ([$par]));
3743
3744 push @command_list, [$type, \@variants];
3738 $level = $par->{level}; 3745 $level = $par->{level};
3739 } else { 3746 } else {
3740 error "$par->{markup}: unparsable command heading"; 3747 error "$par->{markup}: unparsable command heading";
3741 } 3748 }
3742 } elsif ($par->{level} > $level) { 3749 } elsif ($par->{level} > $level) {
3743 $command_help[-1][2] .= &cf::pod::as_cfpod ([$par]); 3750 $$rpar .= &cf::pod::as_cfpod ([$par]);
3744 } 3751 }
3745 3752
3746 cf::cede_to_tick; 3753 cf::cede_to_tick;
3747 } 3754 }
3748 } 3755 }
3749 3756
3750 @command_help = sort { 3757 @command_list = sort {
3751 $a->[0] <=> $b->[0] 3758 $a->[0] <=> $b->[0]
3752 or $a->[1] cmp $b->[1] 3759 or $a->[1] cmp $b->[1]
3753 } @command_help; 3760 } @command_list;
3754 3761
3755 cf::cede_to_tick; 3762 cf::cede_to_tick;
3756 3763
3757 add_face "res/command_help" => FT_RSRC, 3764 add_face "res/command_list" => FT_RSRC,
3758 JSON::XS->new->utf8->encode (\@command_help); 3765 JSON::XS->new->utf8->encode (\@command_list);
3759} 3766}
3760 3767
3761sub reload_resources { 3768sub reload_resources {
3762 trace "reloading resource files...\n"; 3769 trace "reloading resource files...\n";
3763 3770

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines