--- deliantra/server/ext/commands.ext 2007/10/07 15:52:05 1.63 +++ deliantra/server/ext/commands.ext 2007/10/25 09:01:23 1.64 @@ -49,14 +49,7 @@ $ob->speed_left ($ob->speed_left - 4); - my $CHANNEL = { - id => "who", - title => "Players", - reply => undef, - tooltip => "Shows players who are currently online", - }; - - $ob->send_msg ($CHANNEL => (join "\n\n", who_listing $ob->may ("extended_who"), $arg), cf::NDI_DK_ORANGE | cf::NDI_REPLY | cf::NDI_CLEAR | cf::NDI_DEF); + $ob->send_msg ("c/who" => (join "\n\n", who_listing $ob->may ("extended_who"), $arg), cf::NDI_DK_ORANGE | cf::NDI_REPLY | cf::NDI_CLEAR | cf::NDI_DEF); }; cf::register_command seen => sub { @@ -105,14 +98,7 @@ $reply .= "You are not allowed to use weapons\n\n" unless $ob->flag (cf::FLAG_USE_WEAPON); - my $CHANNEL = { - id => "body", - title => "Body Parts", - reply => undef, - tooltip => "Shows which body parts you posess and are available", - }; - - $ob->send_msg ($CHANNEL => $reply, cf::NDI_REPLY); + $ob->send_msg ("c/body" => $reply, cf::NDI_REPLY); }; cf::register_command mark => sub { @@ -154,13 +140,6 @@ }; } -our $MAPINFO_CHANNEL = { - id => "mapinfo", - title => "Map Info", - reply => undef, - tooltip => "Information about the map", -}; - cf::register_command mapinfo => sub { my ($ob) = @_; @@ -174,14 +153,14 @@ (scalar $map->players), $map->difficulty, $map->width, $map->height, $map->enter_x, $map->enter_y, $map->timeout if $ob->flag (cf::FLAG_WIZ); - $ob->send_msg ($MAPINFO_CHANNEL => $msg, cf::NDI_REPLY | cf::NDI_CLEAR); + $ob->send_msg ("c/mapinfo" => $msg, cf::NDI_REPLY | cf::NDI_CLEAR); }; cf::register_command whereami => sub { my ($ob) = @_; my $reg = $ob->contr->observe->region; - $ob->send_msg ($MAPINFO_CHANNEL => (sprintf "You are %s.\n%s", $reg->longname, $reg->msg), cf::NDI_REPLY | cf::NDI_CLEAR); + $ob->send_msg ("c/mapinfo" => (sprintf "You are %s.\n%s", $reg->longname, $reg->msg), cf::NDI_REPLY | cf::NDI_CLEAR); }; cf::register_command whereabouts => sub { @@ -196,7 +175,7 @@ my $msg = "In the world currently there are:\n\n" . join "", map "$count{$_} player(s) $_\n\n", sort keys %count; - $ob->send_msg ($MAPINFO_CHANNEL => $msg, cf::NDI_REPLY | cf::NDI_CLEAR); + $ob->send_msg ("c/mapinfo" => $msg, cf::NDI_REPLY | cf::NDI_CLEAR); }; cf::register_command hiscore => sub { @@ -393,7 +372,7 @@ my $startup = POSIX::strftime "%Y-%m-%d %H:%M:%S %Z", localtime $cf::UPTIME; my $runtime = sprintf "%.1f", (time - $cf::UPTIME) / 86400; - $ob->send_msg (log => "server started $startup, uptime ${runtime}\d", cf::NDI_REPLY); + $ob->send_msg ("c/uptime" => "server started $startup, uptime ${runtime}\d", cf::NDI_REPLY); }; my %IN_MEMORY = ( @@ -409,7 +388,7 @@ my $format = "%2s %1s %3s %5s %.60s\n"; - $ob->send_msg ($MAPINFO_CHANNEL => (sprintf $format, "Pl", "I", "Svd", "Reset", "Name"), cf::NDI_REPLY | cf::NDI_CLEAR); + $ob->send_msg ("c/mapinfo" => (sprintf $format, "Pl", "I", "Svd", "Reset", "Name"), cf::NDI_REPLY | cf::NDI_CLEAR); for (sort keys %cf::MAP) { my $map = $cf::MAP{$_} @@ -421,7 +400,7 @@ my $svd = int $cf::RUNTIME - $map->{last_save}; $svd = "++" if $svd > 99; - $ob->send_msg ($MAPINFO_CHANNEL => + $ob->send_msg ("c/mapinfo" => (sprintf $format, (scalar $map->players), $IN_MEMORY{$map->in_memory} || "?",