Skip to content

feat(rust): adopt the websocket RCON protocol - #28

Merged
ValgulNecron merged 2 commits into
mainfrom
feat/rust-websocket-rcon
Jul 14, 2026
Merged

ValgulNecron merged 2 commits into
mainfrom
feat/rust-websocket-rcon

Conversation

@ValgulNecron

Copy link
Copy Markdown
Collaborator

Gameplane's agent now implements Facepunch's WebRcon (ValgulNecron/Gameplane#141), so Rust no longer needs to sit on consoleMode: pty with protocol: none.

  • rcon.protocol: websocket, port 28016, password from RUST_RCON_PASSWORD.
  • The didstopia/rust-server image already enables webrcon by default (RUST_RCON_WEB=1) and serves plain ws:// (RUST_RCON_SECURE_WEBSOCKET=0), which is exactly what the agent dials — no image change needed.
  • Adds a players list: playerlist returns a JSON array rather than lines, but the agent applies players.list.entryRegex with FindAll over the whole reply, so a DisplayName regex pulls out every player (verified against a sample reply, including names containing spaces).
  • Adds kick/ban.
  • lifecycle.stop (server.save, quit) now runs over RCON instead of pty-stdin.

Console, moderation, quiesce and quick actions all become available to Rust as a result.

🤖 Generated with Claude Code

Gameplane's agent now speaks Facepunch's WebRcon, so Rust no longer has to
sit on consoleMode: pty with no RCON at all. Switches to
rcon.protocol: websocket on 28016 with the image's RUST_RCON_PASSWORD.

The image already enables webrcon by default (RUST_RCON_WEB=1) and serves
plain ws:// (RUST_RCON_SECURE_WEBSOCKET=0), which is what the agent dials.

This lights up the console, moderation, and — via playerlist — a real
players list. playerlist returns a JSON array rather than lines, which is
fine: the agent applies players.list.entryRegex with FindAll across the
whole reply, so a DisplayName regex pulls out every player.

lifecycle.stop now runs over RCON instead of pty-stdin.

Signed-off-by: valgulnecron <39313199+ValgulNecron@users.noreply.github.com>
The validator's protocol allowlist is what stops a module shipping a
console that can never connect, so it correctly rejected 'websocket'
until the agent actually implemented it. It does now (Facepunch WebRcon,
ValgulNecron/Gameplane#141), so add it — and lift the list into a named
constant rather than repeating it in the message, so the two can't drift.

Signed-off-by: valgulnecron <39313199+ValgulNecron@users.noreply.github.com>
@ValgulNecron
ValgulNecron merged commit 7eb3e50 into main Jul 14, 2026
1 check passed
@ValgulNecron
ValgulNecron deleted the feat/rust-websocket-rcon branch July 14, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant