feat(registry): live control - queue admin lines for a running server from the admin site #4
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/web-admin-live"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A Live players page on the admin site lists servers that registered with
admin: true, shows the roster each one posts, and queues admin lines (the playground's admin grammar) for one player or everyone.GET /api/v1/servers/{id}/admin/next?wait=long-polls (lease required, max 30 s, woken by the enqueue, no sleep loop);POST .../admin/repliesrecords replies and the roster.GET /api/live,POST /api/live/{id}/commands,GET /api/live/{id}/commands. Each line goes to the audit log.game_serverscolumns with defaults, new routes.Tests:
go vet+go test -race ./...green (golang:1.22 in docker). Negative control: disabling the admin check and the server_id guard on replies turnedTestLiveRefusesWhoShouldNotandTestLiveRepliesOnlyTouchTheirOwnServerred. Driven by hand in a browser against the built image: queued +100 gold from the page, a fake server polled, replied, and the page showed the reply; no horizontal scroll at 400 px.https://claude.ai/code/session_01Trb4CeVT87r1h1qsNjksMB
A server that registers with admin:true long-polls GET /api/v1/servers/{id}/admin/next (lease required, at most 30 s), runs the lines an admin queued on the new Live players page, and posts replies plus a roster to .../admin/replies. Lines expire after 60 s unclaimed, are kept a day, and go with their server. Each queued line is written to the audit log (channel live, action command). Claude-Session: https://claude.ai/code/session_01Trb4CeVT87r1h1qsNjksMB