## Admin Commands Admin commands are available to accounts with `admin: true` set in their account YAML file (`data/players/accounts/.yaml`). Non-admin players see "Unknown command." when attempting these, so their existence is hidden. ### Enabling Admin Edit the account YAML and add `admin: true`: ```yaml name: yourname password_hash: sha256:... characters: [...] aliases: {} colors: {} options: {} admin: true ``` The character must log out and back in for the change to take effect. ### Commands #### goto ``` goto ``` Instantly teleports you to the specified room by numeric ID. Cancels any active combat, action, rest, enter sequence, or safespot. Your departure and arrival are broadcast to players in both rooms. #### summon ``` summon ``` Teleports a player to your current room. Their active state is cleaned up (combat, actions, etc.) and they receive a notification. Case-insensitive name matching. #### dig ``` dig [name] ``` Creates a new room in the given direction (north/south/east/west/ne/nw/se/sw/up/down) from your current room. The new room ID is auto-generated as the lowest available integer at-or-above the minimum room ID in the same directory as your current room's YAML file. Both the new room and your current room are updated with reciprocal exits. The admin is teleported into the new room. The new room starts with a generic "A featureless room." description and no spawns, mobs, or objects — edit its YAML file to flesh it out. If the direction would place the new room on a grid cell already occupied by an existing room (a grid overlap), no new room is created. Instead, a two-way link is automatically established between your current room and the existing room. Examples: - `dig north` — creates a room north of you with auto-generated ID and name "Room #<id>" - `dig east "Dark Forest"` — creates a room east of you named "Dark Forest" #### undig ``` undig ``` Deletes the room in the given direction and removes all exits leading to it from every room. Requires confirmation — type `y`/`yes` to proceed, anything else to cancel. The target room's name and ID are shown before deletion. A warning is displayed if deleting the room would create orphaned (unreachable) rooms. Any players currently in the deleted room are teleported to your current room. #### close ``` close ``` Deletes an exit in the given direction from your current room. Also removes the reciprocal exit from the target room if it points back to your room. #### swapid ``` swapid swapid ``` Swaps the numeric IDs of two rooms. The first form swaps your current room with the given room ID. The second form swaps two arbitrary rooms. All exit references across the entire world are updated automatically to keep the world consistent. #### room ``` room [args...] ``` Modify the current room's data directly from inside the game. Type `room` alone to see all available actions: | Action | Usage | Description | |--------|-------|-------------| | `name` | `room name ` | Set the room's name | | `desc` | `room desc ` | Set the room's description | | `addobj` | `room addobj ` | Add a referenced object (must exist in data/objects/) | | `remobj` | `room remobj ` | Remove a referenced object | | `addlocalobj` | `room addlocalobj ` | Add a local object | | `remlocalobj` | `room remlocalobj ` | Remove a local object | | `hide` | `room hide ` | Hide all matching objects (referenced or local) | | `unhide` | `room unhide ` | Unhide all matching objects (referenced or local) | | `addmob` | `room addmob ` | Add a mob spawn (must exist in data/mobs/) | | `remmob` | `room remmob ` | Remove a mob spawn | | `addspawn` | `room addspawn [qty] [respawn]` | Add an item spawn (must exist in data/items/) | | `remspawn` | `room remspawn ` | Remove an item spawn | | `insert` | `room insert [name]` | Insert a new room into an exit, pushing rooms further out | | `remove` | `room remove ` | Delete the inserted room and pull the far end back | All room commands are admin-only. Referenced objects, mobs, and items are validated before being added. `room insert` works like `dig` but for an existing exit: it creates a new room *between* your current room and the room the exit leads to. The far room and everything reachable beyond it in that direction get "pushed" one step away. For N/S/E/W, a grid validation ensures the push won't cause map overlap or twist. For up/down, no grid check is needed — the new room simply becomes an intermediate floor. The new room inherits the current room's outward-facing exit properties (conditions, blocked messages, flags), while the far room's reciprocal exit properties are preserved on its side. You are teleported into the new room, just like `dig`. Diagonal directions (NE/NW/SE/SW) are supported. `room remove` is the inverse of `room insert`: it deletes the room reached via the current room's `` exit (the "inserted" room) and "pulls" the far end of the map back one step — the room that was beyond the deleted room becomes adjacent to the current room, and everything reachable beyond it shifts one step toward you. The current room's `` exit is repointed at the far room (preserving the current room's exit properties), and the far room's reciprocal exit is repointed back at the current room (preserving the far room's own exit properties). You stay where you are; any other player standing in the deleted room is relocated to the current room. `room remove` fails (and prints a message, changing nothing) when: - the `` exit's room does not lead back to the current room via the opposite direction (it's not an insert chain), - the deleted room has no room beyond it to pull (a dead end — use `undig` instead), - the deleted room has any exit other than the back-exit and the forward-exit, - the far room's opposite exit does not lead back to the deleted room, - some other room points into the deleted room (it was modified since insertion), or - the pull would cause a map overlap or twist. Both `room insert` and `room remove` are also available from the admin web GUI's Map page: right-click a room and choose **Insert Room…** or **Remove Room…**, then pick a direction from the submenu. The GUI endpoints perform the same grid validation and exit-property preservation as the in-game commands. The GUI cannot relocate live players standing in a removed room (the same limitation as the existing Delete Room action); ensure no one is in the target room before removing it from the GUI. #### god ``` god ``` Temporarily sets all your skills to level 99, prevents mobs from aggressing you, allows walking through blocked exits, and makes you immune to hazard damage and death. Does NOT persist across reconnects — your original stats are restored automatically when you quit, disconnect, or use the `ungod` command. #### ungod ``` ungod ``` Restores your original skills and removes god-mode privileges. This also happens automatically if you disconnect or quit while in god mode, so your inflated stats are never saved to disk. #### setflag ``` setflag [value] ``` Sets a global flag. Global flags are shared by all players and stored in memory (lost on server restart). Setting a flag fires any triggers watching that flag. Values default to `true` if omitted. Accepted value types: `true`/`false` (bool), integer, or string. #### setplayerflag ``` setplayerflag [value] ``` Sets a player-specific flag on a character. Player flags are persisted to the character YAML file and survive restarts. Setting a flag fires any triggers watching that flag. The character is saved immediately. Values work the same as setflag. #### reload ``` reload ``` Reloads all data caches from disk. Use this after editing YAML files (items, objects, mobs, drops, techs, modules, courses, hazards, triggers) to pick up changes without restarting the server. Rooms already hot-reload automatically. The reload process: 1. Clears item, object, and mob definition caches 2. Rebuilds path indices for items, objects, mobs, drops, and rooms 3. Rebuilds the craft index 4. Reloads techs and modules 5. Reloads courses 6. Clears hazard caches 7. Clears and re-seeds triggers from disk Live state (mob instances, player data, ground items, active sequences) is NOT affected. #### shutdown ``` shutdown shutdown cancel ``` Schedules a graceful shutdown announcement. All online players receive a message every 30 seconds with the remaining time. When the countdown reaches zero, the server exits immediately. Use `shutdown cancel` to abort a pending shutdown. #### inspect ``` inspect ``` Dumps detailed diagnostic information about your current room: - Room ID, name, color, hazard, BlockTransport status - All exits with conditions noted - Objects (with local/global, hidden, and wander status) - Mobs with wander intervals - Item spawns with respawn timers - On-enter step and trigger counts - All global flags - Your player flags - Connected players in the room - Live mob instances with HP ### Web Admin GUI The server includes a browser-based admin panel for managing all game data visually. It runs alongside the game server and is configured in `config.yaml` under `admin_http` (plain HTTP) or `admin_https` (TLS with auto-generated self-signed certificate). #### Setup 1. Ensure your account YAML has `admin: true` (same as in-game admin). 2. Configure the admin server in `config.yaml`: ```yaml admin_http: ":8080" # listens on port 8080, HTTP # or for HTTPS: admin_https: ":8443" ``` 3. Start the game server. The admin panel is available at `http://:8080` (or `https://:8443`). 4. Log in with your account name and password (same credentials as in-game). #### Features | Page | URL | Description | |------|-----|-------------| | Map | `/` | Interactive SVG map showing rooms on a 3D grid. Zoom/pan, click rooms to edit, create/delete rooms and exits, relink exits. Up/down links shown alongside horizontal connections. | | Items | `/editor/items` | Full CRUD editor with sections for equipment (type/slot/attack/defense/other), tool, craft (type/level/XP/ingredients/stations/tool/steps), firemaking, farming, potions, and requirements. Undo/redo supported. | | Objects | `/editor/objects` | CRUD editor with sections for gather (tools/drops/success formula), use (message/wait/consumes), talk (visual talk tree editor), safespot, steal, use_interactions, and on_look. | | Mobs | `/editor/mobs` | CRUD for mob definitions — stats, drops, talk, behavior, assassin/steal/task fields. | | Drops | `/editor/drops` | CRUD for shared drop tables (gem tables, bird's nests, etc.). | | Hazards | `/editor/hazards` | CRUD for hazard definitions. | | Techs | `/editor/techs` | CRUD for technology definitions (buffs, drain rates, categories). | | Courses | `/editor/courses` | CRUD for agility courses (obstacle sequences, XP, fail damage). | | Modules | `/editor/modules` | CRUD for science modules (combat/utility/transport/enchant/processing). | | Players | `/editor/players` | Browse character YAML files and view player state. | | Flags | `/editor/flags` | View and edit global flags in real time. | | Files | `/editor/files` | Raw file tree browser for all YAML files under `data/`. | All CRUD editors support undo/redo (persisted to `data/.admin_history.json`), so changes can be reverted even across sessions. #### Map Interface The map page (`/`) is the main navigation hub: - Rooms are displayed as colored nodes on a 3D grid, connected by links (bars for two-way, arrows for one-way, X for blocked). - Click a room node to edit its properties (name, description, color, exits, objects, mobs, spawns). - **Drag** connections between rooms to create reciprocal exits. **Shift+drag** to create a one-way exit (only the exit from the source room is written; the target room is not modified). - **Right-drag** between rooms to delete the exit (full reciprocal; the sidebar Exits tab has a "Remove reverse" button to convert a two-way exit to one-way). - If deleting an exit severs a room from the seed grid, the room moves to the "Disconnected Rooms" sidebar. Relink it via the Exits tab "Add" form with its ID and direction. - Right-click (or long-press) a room to delete it or access advanced options. - The map uses the same BFS-based grid layout as the in-game map, showing all rooms on the current z-plane. - Up/down links are shown with special glyphs when connecting rooms on different z-levels. ### Workflow The typical admin worldbuilding workflow: 1. **Lay out rooms:** Use `dig` to create connected rooms quickly, or use the web map to create and link rooms visually. If `dig` would create a grid overlap, a two-way link is created instead — no duplicate rooms. Use `room insert` to place a new room between two already-connected rooms without breaking the map grid, and `room remove` to delete an inserted room and pull the far end back. 2. **Flesh out rooms:** Use `room` commands to set names, descriptions, add objects/mobs/spawns directly from inside the game. Use the web admin editors for richer CRUD with undo/redo. For deeper edits, edit the YAML files directly in `data/rooms/` to add on-enter scripts, triggers, hazards, etc. 3. **Rearrange:** Use `swapid` to renumber rooms and `undig` to delete rooms you no longer want (with full exit cleanup). Use `room remove` to cleanly undo a `room insert` (it pulls the far end back and rejects edits that would break the grid). Use `close` to remove individual exits. 4. **Reload:** Run `reload` to pick up YAML changes without restarting (rooms auto-reload). 5. **Test:** Use `goto` to jump around while debugging room connections and content. 6. **God mode:** Use `god` to test dangerous areas safely — full stats, no aggro, pass through blocked exits. `ungod` restores normal state. 7. **Debug:** Use `setflag` / `setplayerflag` to test quest logic and conditional content. Use `inspect` to check room state, flags, and triggers.