add $where command

This commit is contained in:
Martin Michelsen
2023-12-17 18:31:29 -08:00
parent de5547ff68
commit a6c4217875
2 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -271,8 +271,9 @@ Some commands only work on the game server and not on the proxy server. The chat
* Information commands
* `$li`: Shows basic information about the lobby or game you're in. If you're on the proxy server, shows information about your connection instead (remote Guild Card number, client ID, etc.).
* `$ping` (game server only): Shows round-trip ping time from the server to you.
* `$what` (game server only): Shows the type, name, and stats of the nearest item on the ground.
* `$matcount` (game server only): Shows how many of each type of material you've used.
* `$what` (game server only): Shows the type, name, and stats of the nearest item on the ground.
* `$where` (game server only): Shows your current floor number and coordinates. Mainly useful for debugging.
* Debugging commands
* `$debug` (game server only): Enable or disable debug. You need the DEBUG permission in your user license to use this command. When debug is enabled, you'll see in-game messages from the server when you take certain actions. You'll also be placed into the highest available slot in lobbies and games instead of the lowest, which is useful for finding commands for which newserv doesn't handle client IDs properly. This setting also disables certain safeguards and allows you to do some things that might crash your client.
+5
View File
@@ -1323,6 +1323,10 @@ static void proxy_command_next(shared_ptr<ProxyServer::LinkedSession> ses, const
send_warp(ses->client_channel, ses->lobby_client_id, ses->floor, true);
}
static void server_command_where(shared_ptr<Client> c, const std::string&) {
send_text_message_printf(c, "$C7Floor: %02" PRIX32 "\nX: %g\nZ: %g", c->floor, c->x, c->z);
}
static void server_command_what(shared_ptr<Client> c, const std::string&) {
auto l = c->require_lobby();
check_is_game(l, true);
@@ -1848,6 +1852,7 @@ static const unordered_map<string, ChatCommandDefinition> chat_commands({
{"$warpme", {server_command_warpme, proxy_command_warpme}},
{"$warpall", {server_command_warpall, proxy_command_warpall}},
{"$what", {server_command_what, nullptr}},
{"$where", {server_command_where, nullptr}},
});
struct SplitCommand {