Repository navigation
Conversation
Season 3 (CL-533689) serves the current map's chat over RCON: GET /v1/chat with ?after=<seq>, and Bulkhead's terms at GET/POST /v1/chat/terms. Three actions read and accept them: chat and chatTerms need Chat (never View alone, since chat is players' words under their real names), and chatTermsAccept needs Config & settings, as the game saves the acceptance in its config. The server's new Chat tab polls with after, newest last, and reads the map again from the start when the numbering goes back. Until the terms are accepted it shows them, with Accept for those who may apply the config. Nothing is stored. The demo server serves the three routes, and MOCK_LIVE_BUILD leaves them out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtMArSWCQVUG3qWgzi2Ebi
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Season 3 (build CL-533689, live 2026-11-12) serves what players say in chat over the RCON API, and Warcon has no way to show it. Staff moderating a server still have to be in the game to see who said what.
The game gates it behind Bulkhead's terms, which an operator has to accept once per server before
GET /v1/chatreturns anything. Read on our live server today:GET /v1/chatanswers{ latestSeq, messages: [{ seq, sentUtc, channel, faction, steamId, realName, hiddenName, anonymous, text, rawText, ping }], count }.channelwasTeamorGlobal;hiddenNameis the anonymised name other players see.?after=Nanswers only the lines above N (after=5 gave 6 and 7).?limit=nanswers the oldest n.since,afterSeq,sinceSeqandfromSeqare ignored.seqstarts again at 1.GET /v1/chat/termsanswers{ requiredVersion: 1, acceptedVersion: 0, accepted: false, text }.POST /v1/chat/termswith{ "version": 1 }answered{ ok: true, pending: false, message: "OK: chat terms accepted and saved." }. Until then/v1/chatis empty andGET /v1/feedreportspausedForTerms: true. The accepted version is kept asAcceptedChatTermsVersionin the RCON block (next-restart).The change
actions.ts, run through/api/servers/:id/rcon/:actionlike the rest:chat(Chat):GET /v1/chat?after=N,afterclamped to a whole number from 0. Keeps the known fields of each line (notping, whose meaning was not seen) and refuses an answer without amessageslist asbad_response, asplayersdoes, rather than reading it as an empty map.chatTerms(Chat): the terms, withacceptedtrue only when the game saystrue.chatTermsAccept(Config & settings, audited): posts{ version }, refuses without one, and treats a 200 that saysok: falseas a refusal (terms_refused), since the game answers other refusals that way.server/[id]/chat/+page.svelte), shown to those with Chat. It lists the current map's lines, newest last: time, channel, faction (theFactionChipcolours from the scoreboard), the real name linking to the dossier, and the hidden name beside it. A filter by player or text and one by channel. It reads every 5 seconds while open, with the samepollas the Server log tab. WhentextandrawTextdiffer, the line's tooltip shows what was typed.afterset to one below the last line it holds, so the answer starts with that line again.mergeChat($lib/chat.ts) adds the new lines when it does, and whenlatestSeqwent down or that line is not where it was, the tab reads from 0. Checking the line and not only the number also catches a new map that passed the old one's count while the tab was hidden (pollpauses in hidden tabs).AUDIT_LOG_READSis on, and then the row carries no chat. The terms forbid storing chat beyond what moderation needs, and live-only matches what Bulkhead itself provides.mockgame.tsserves the three routes: a line every 8 seconds of the clock (picked withoutMath.random, so the demo's other draws are unchanged), emptied and renumbered at each map change, nothing until the terms are accepted.MOCK_LIVE_BUILD=trueleaves the routes out, like the builds it imitates.docs/wardogs-api.mdgets the three routes in the table and a Season 3 section with the shapes,afterandlimit, the reset at a map load,pausedForTermsandAcceptedChatTermsVersion. The README gets a short "In-game chat" section, the Chat row of the capability table, and the actions in the Game actions table and the by-capability list.Things worth your view
chat.send) rather than adding one. It already belongs to the people who talk to players in game (operator and admin by default), and reading what players say back is the other half of that job. A new capability is not trivial here: roles and API keys store their capability lists, so a new one would need a migration in the style of 0036 to give it to existing operator and admin roles, or chat would appear for nobody on upgrade. The cost of reusing it: a role cannot whisper without also reading chat, and an API key with Chat can now read chat too. If you would rather have a separate "Read chat" capability, I can add it with that migration. View alone never reads chat, since it is players' words under their real names.requiredVersionwhile the tab is open, the chat goes empty and the tab only shows the new terms on the next visit. Re-reading them on every look would double the requests.limit(it answers the oldest lines, not the newest), theanonymousandpingflags (never seen true), andpausedForTermsfrom the feed report (the terms route says the same thing directly).Tests
actions.test.ts:chatsendsafter, defaults and clamps it, keeps the known fields and fills missing ones, and refuses an answer that is not chat;chatTermscounts onlyaccepted: true;chatTermsAcceptposts the version, refuses without one before asking the game, and treatsok: falseas a refusal; the capabilities are Chat, Chat and Config & settings, and the built-in viewer does not hold Chat; against the demo server, chat stays empty until the terms are accepted, and underMOCK_LIVE_BUILDit answersno_route.chat.test.ts:chatAfterandmergeChat: nothing held, new lines added after the anchor, nothing new,latestSeqgoing down, a new map that passed the old count, and the anchor missing.action-matrix.test.tshas lines for the three actions, so the permission matrix checks them for every member of the cast.Checks
Run on Windows with Bun 1.4.2, on this branch and on untouched
upstream/main(867bd15) the same way:prettier --check .: clean on both.bun run check: 0 errors, 0 warnings on both (2170 files here, 2167 on main).bun testwithoutTEST_DATABASE_URL(no Postgres or Docker on this machine): main 1032 pass, 967 skip, 23 fail across 186 files; this branch 1048 pass, 970 skip, 23 fail across 187 files. The 16 new passing tests are the ones above; the 3 new skips are the permission matrix lines, which need the database. The 23 failures are the same tests on both, by name:page-loads.test.ts, the route and load matrix coverage checks and theconsolecheck find or name source files by/-separated paths, which Windows writes with\.🤖 Generated with Claude Code
https://claude.ai/code/session_01DtMArSWCQVUG3qWgzi2Ebi