Using the web console - rebaserHEAD/NexusForever GitHub Wiki
This guide gets you running GM commands against a local world server without a client in the loop, by hand or from a script. The message format and the rules the console follows are on Web console.
Warning
The console asks for no login, and every command it runs has every permission. Keep port 5000 on localhost. Under the Aspire host it already is.
A page in your browser, or a few lines of PowerShell, that runs any chat command on the server, as any character who's online.
Start the stack (Running it locally), then open http://localhost:5000/console.html. The page connects by itself when it loads.
Type a command in the command box and press Enter. Write it as you would in chat, without the !. Replies land in the log above the box, marked info or error.
Tip
Start with help. It lists the command categories, and help <category> shows what's inside one.
Note
Most commands answer nothing when they succeed. Silence after a command is the normal result, and the proof of what it did is in the world server log, the database or the game.
Most of the useful commands act on a character: achievements, quests, items, teleports and so on. For those:
- Log a character in with the client.
- Put its name in the Character box. A name with a space in it is fine there, and case doesn't matter.
- Send the command.
If the console answers "Invalid target for this command!", the box is empty or the character isn't online.
For example, with an online character called Test Subject in the box:
achievement grant 1385
quest add 3165
quest achieve 3165
teleport name <zone name>
Account commands need no character. Leave the box empty and run:
account create <email> <password> Administrator
Give every account you'll play on a role, or it can't use commands from chat.
For a long run, send commands over the console's socket instead of typing them. This sends one command as a character and closes:
$none = [System.Threading.CancellationToken]::None
$socket = [System.Net.WebSockets.ClientWebSocket]::new()
$socket.ConnectAsync([Uri]'ws://localhost:5000/ws/commands', $none).Wait()
$json = @{ message = 'achievement grant 1385'; character = 'Test Subject' } | ConvertTo-Json -Compress
$bytes = [System.Text.Encoding]::UTF8.GetBytes($json)
$socket.SendAsync([ArraySegment[byte]]::new($bytes), 'Text', $true, $none).Wait()
# the server's read loop only ends on a close frame
$socket.CloseOutputAsync('NormalClosure', 'done', $none).Wait()
$socket.Dispose()To send several, repeat the send before closing. To read replies, keep a ReceiveAsync running on the same socket before you close it. A command still runs if you close straight away; its reply just has nowhere to go.
| Symptom | Cause | Fix |
|---|---|---|
| "Invalid target for this command!" | The command acts on a character, and none is attached | Fill the Character box with an online character's name |
| The same, with a name in the box | The character logged out, or isn't on this server | Log it in, then send again |
| "Unable to invoke command, it's either an invalid command or you don't have permission to access it!" | The command doesn't exist | Check the spelling with help
|
| "Invalid parameters supplied to command, see help for more information!" | A parameter is missing or the wrong type |
help <category> shows each command's parameters |
| The page never connects | The world server isn't up, or isn't on port 5000 | Check the Aspire dashboard |