Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ZTzTopia/GTProxy/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The /debug command provides detailed runtime information about the game state, including player data, world information, tile maps, and objects. This is essential for development, troubleshooting, and understanding the proxy’s internal state.

Syntax

/debug <target> [arguments]
target
string
required
The debug target to inspect. Valid options:
  • player - Show player information
  • world - Show world state information
  • tile - Show tile information (not fully implemented)
  • object - Show object information (not fully implemented)

Usage Examples

Debug All Players

To list all players currently in the world:
/debug player
Output:
Total Players: 3
[1] Player1 (512.0, 384.0)
[2] Player2 (768.0, 512.0)
[3] Player3 (256.0, 640.0)
The format shows:
  • [NetID] - The network ID assigned to the player
  • Name - The player’s display name
  • (X, Y) - The player’s position in the world

Debug Specific Player

To get detailed information about a specific player by NetID:
/debug player 1
Output:
Player Info (NetID: 1):
Name: Player1 (User: 12345)
Pos: 512.0, 384.0
Country: US
Mod: 0, SuperMod: 0
net_id
integer
The network ID of the player to inspect. Use /debug player without arguments to see all NetIDs.

Debug World State

To see information about the current world:
/debug world
Output:
World Info:
Version: 25
Size: 100x60
Tiles: 6000
Objects: 42
Player Count: 3
This shows:
  • Version: World data format version
  • Size: World dimensions (width x height in tiles)
  • Tiles: Total number of tiles in the world
  • Objects: Number of dropped items or world objects
  • Player Count: Number of players currently in the world

Invalid Target

If you provide an invalid debug target:
/debug invalid
Output:
Unknown debug target: invalid

Player Information Fields

When debugging a specific player, you get:
FieldDescription
NetIDUnique network identifier for the player
NameDisplay name shown in-game
User IDGrowtopia user ID
PositionX, Y coordinates in the world
CountryTwo-letter country code
ModWhether the player is a moderator (0 or 1)
SuperModWhether the player is a super moderator (0 or 1)

Error Handling

Missing Arguments

/debug
Output:
Usage: /debug <player|world|tile|object>

Invalid NetID

If you provide a non-numeric NetID:
/debug player abc
Output:
Invalid NetID format.

Player Not Found

If the NetID doesn’t exist:
/debug player 999
Output:
Player with NetID 999 not found.

Implementation Details

Source Reference

Implementation: /home/daytona/workspace/source/src/command/commands/debug_command.hpp:16

How It Works

  1. Parses arguments: Validates the debug target and any additional parameters
  2. Queries world state: Accesses the World singleton to retrieve current state
  3. Formats output: Uses fmt::format to create readable debug information
  4. Sends log packets: Sends packet::message::Log packets to display information

Dependencies

The debug command relies on:
  • world::World - Singleton managing world state
  • player::Player - Player entity data
  • world::TileMap - Tile storage and management
  • world::ObjectMap - Dropped item and object management

Use Cases

Player Tracking

Monitor player positions and identify users by NetID

World Analysis

Understand world structure and object distribution

Mod Detection

Identify moderators and super moderators in the world

Development

Debug proxy behavior and verify data parsing

/help

List all available commands

World API

Access world data from Lua scripts

Build docs developers (and LLMs) love