Repository navigation
Web console
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.
| 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.
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.
| 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 |
- The socket reads a message and queues its command.
- 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.
- The command line is split on single spaces. The first word picks the category, and the rest go to the command as parameters.
- If
characterwas set, the name is looked up among online players at that moment, ignoring case. An empty or whitespace name counts as none. - A command whose category acts on a character fails with "Invalid target for this command!" when no online character was found.
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.
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.
| 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/ |
Guides
- Running it locally
- Using the web console
- Adding a player feature
- Verifying a feature
- Taking a change upstream
- Syncing with upstream
Explanation
- Server architecture
- Login handshake
- Game tables
- Branches and workflow
- Upstream branches
- Contributing
- Galactic Archive
- Account entitlements
Reference
- Processes and projects
- File formats
- Databases
- Web console
- Galactic Archive messages and storage
- Code style
- Code patterns
- Pull requests
Design
About this wiki