Server

From Kevin-Liu-01/Claude-of-Tanks · View interactive version

Server is an AI agent skill from the GitHub repository Kevin-Liu-01/Claude-of-Tanks. Implement and operate the match actor, the LAN room helper, collision manifests, ICE and telemetry services.

How to use this skill

Skill file

claude-of-tanks / server

Purpose

Provide the renderer-free match authority (server/match), the room service

the LAN helper and every headless proof run (server/rooms), and the small

HTTP services the site deploys. The signaling server, the Redis room store, the

dedicated match server and the ranked service of the first multiplayer left the

tree with the cutover of 2026-09-29 (docs/MULTIPLAYER-V2.md §13.10).

Mental model and invariants

§13): MatchActor (one room: roster, the authority, the loop, seat admission,

lag compensation, interest-tiered snapshots), the binary wire in src/mp/wire,

seat tokens (seatToken.ts) the room service signs, service.ts +

localRoomService.ts (the in-process match the LAN helper and the receipts

use), server/match/README.md. The same actor runs in the host commander's

browser (src/mp/host).

frame reads the authority's view (observeForViewer, snapshotMeta), never a

full viewer snapshot; the publisher encodes straight from the frames

(encodeSnapshotFrame) on each viewer's keyframe slot, every 6 s; the

snapshot budget (interestTiers.ts) shares the host's uplink target among the

viewers; events go as binary payloads encoded once (wire 8). Measure with

tools/mp-scale-bench.mjs before and after any change to that path.

shared room actor (src/mp/room/roomActor.ts) over real sockets, the match

in-process or in the admin's browser (COT_ROOMS_MATCH_TRANSPORT).

COT_ROOM_DEV_MAX_TEAM_SIZE (up to 32) lets a versus room seat a larger,

bot-filled test team; the rooms Worker never sets it.

per-map collision shards (collisionManifestCodec.ts, collisionManifestLoader.ts,

mapResourceCache.ts); do not hand-edit their records or checksum index. Keep

idle map retention bounded and release active terrain leases on teardown.

dedicatedWorldCollisionBrowser.ts is the browser-side loader the manifest

receipt compares against.

(battlePacing.selftest.mjs, tools/pacing-trace.mjs): the seeded

era-matched bot fill the gate's bands were measured over.

battlePacingShard1.selftest.mjs to battlePacingShard8.selftest.mjs

(2026-10-16, test-speed R9a). battlePacing.selftest.mjs merges their records

from the run's directory (COT_SELFTEST_RUN_DIR) and judges all 132. Each share

is claimed by one live process, and the judge plays any share nobody plays

(battlePacingRun.test-support.mjs; docs/DEVELOPMENT.md, "The pacing tail").

inside the room (2026-10-02, docs/MULTIPLAYER-V2.md §13.14): the rooms Worker

and the LAN helper hand it to the room actor's relayCredentials port, one

grant per admitted room_relay, never cached or logged; STUN only when no

secret is set. Run node server/relayCredentials.selftest.mjs. Credentials are

never committed (the deprecated STUN-only api/ice.ts route is retired, 229).

local HTTP wrapper around api/jev.ts for the Vite dev server (npm run jev:dev,

port 8794; docs/JEV-COMMANDER.md).

result; a room migrates its host, it never hands a client the verdict.

Verification

Run node server/match/matchActor.selftest.mjs, node server/match/service.selftest.mjs,

node server/dedicatedWorldCollision.selftest.mjs and node server/battlePacing.selftest.mjs.

Regenerate world manifests with tools/capture-world-collision-manifests.mjs after

authored map collision changes. Any gameplay authority added here must also run the

deterministic match tests, abuse cases, and the headless peer-to-peer proofs

(npm run test:net:v2:p2p:headless, npm run test:net:v2:p2p).

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.