Skip to content

Web console

rebaserHEAD edited this page Oct 14, 2026 · 3 revisions

reference, committed verified 2026-10-14 stable a4e75b18

The world server's command console: its page, its socket and message format, and how it runs a command. To use it, see Using the web console.

The socket

Endpoints

Piece Address
The page http://localhost:5000/console.html
The socket ws://localhost:5000/ws/commands

Both are served by the world server's embedded web host. Under the Aspire host it listens on localhost. A world server started on its own takes Urls from WorldServer.json, and the example sets http://0.0.0.0:5000, every interface.

Messages

One JSON object per WebSocket text message, each way.

Direction Field Type Meaning
To the server message string The command, as typed in chat without the !
To the server character string, optional Run the command as this online character. On stable only (#589)
From the server text string The reply
From the server type string info or error
{ "message": "achievement grant 1385", "character": "Test Subject" }
{ "text": "Invalid target for this command!", "type": "error" }

A command can reply several times or not at all. Most commands send nothing when they succeed.

Replies

Text Type Cause
Unable to invoke command, it's either an invalid command or you don't have permission to access it! error No such command, or no permission. The two read the same on purpose
Invalid parameters supplied to command, see help for more information! error A parameter is missing or doesn't convert
Invalid context for this command! error The command can't run from this context
Invalid target for this command! error The command acts on a character, and none was found

How a command runs

Running a command

  1. The socket reads a message and queues its command.
  2. The world thread runs queued commands at the end of each update, so a console command never races a packet handler or a map update.
  3. The command line is split on single spaces. The first word picks the category, and the rest go to the command as parameters.
  4. If character was set, the name is looked up among online players at that moment, ignoring case. An empty or whitespace name counts as none.
  5. A command whose category acts on a character fails with "Invalid target for this command!" when no online character was found.

Permissions

Every console command runs with the permissions of the WebSocket role. The role is seeded to hold every permission it isn't explicitly denied, and a fresh database denies it none. The console asks for no login.

Categories that act on a character

Every command in these categories needs a character and fails without one:

Category Manages
achievement Achievements
character XP, level and saving
door Doors in range
entitlement Account and character entitlements
entity The target entity's display, properties and threat
generic Generic unlocks for the account
guild Registering and joining guilds
house Housing decor and residence teleports
item Inventory
map The current map instance
movement, move Spline and generator movement
path Paths and path XP
pet Pet flair
quest Quests and objectives
rbac The account's roles and permissions
rep, reputation Reputation
story Story panels and communicator windows
teleport, port, tele Teleports
title Titles

A few commands in other categories need one too: ban account player, currency account add, currency character add, spell add, spell cast and spell resetcooldown.

Where the code lives

Piece Path
The page Source/NexusForever.WorldServer/wwwroot/console.html
The socket endpoint Source/NexusForever.WorldServer/Web/Middleware/WebSocketController.cs
The command context, permissions and character lookup Source/NexusForever.WorldServer/Command/Context/WebSocketCommandContext.cs
Queueing and parsing Source/NexusForever.WorldServer/Command/CommandManager.cs
Command categories Source/NexusForever.WorldServer/Command/Handler/

Clone this wiki locally