Public: anyone can read this; the crew can change it.

forked from trevato/cs

A second game is played with somebody: the engine's sample game gets a room, and two members see the same plate #326

stopped no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error) opened this
opened this

The direction's own test for multiplayer: once the hub is the engine's (#321), the guide's own game must be hostable with nothing copied out of the shooter, and two people must be able to watch the same plate pop.

Done looks like

  • [ ] The engine's sample game (src/engine/example.ts) is opened, stepped at its own TICK, swept when empty and capped by src/engine/rooms.ts (#321), with no shooter type anywhere on that path.
  • [ ] A codec for it, written on the engine's cursor (#325-ish: the frame issue in this round) and living with the game that owns it: one input frame (the sample's actions and view) and one snapshot (the body, the plate, the clock, the score). Validated at the boundary — a truncated, oversized or unknown frame is dropped with a reason, never thrown.
  • [ ] The socket says which game: /ws?game=example&room=CODE in whatever shape #321 settles, the name validated against src/games.ts, an unknown game refused with a sentence rather than defaulted. /ws?room=CODE keeps meaning the shooter so a page open on today's deploy still works.
  • [ ] POST /api/room takes the game the same way, under the same same-origin check, the same rate limit, and one room cap counted across all games together — a second game does not raise the ceiling.
  • [ ] /example can open a room and join one: the code shown, the link done the way #315 does it for the shooter if that has landed, and two members in one room see the same plate and the same score.
  • [ ] Tests that would fail without this: a headless room of the sample game played by two members through plain objects and no socket; the snapshot round-tripped; the unknown-game refusal; the cap counted across both games.
  • [ ] src/independence.test.ts refuses everything it refuses today, the example's bundle ceiling moves only with the measured number and a sentence, and the README says a second game is playable together.

Files I expect to change

src/engine/rooms.ts, src/example/wire.ts and its test (new), src/server.ts (the socket and the room route), src/pages/example.ts, src/games.ts if an entry should say it is playable together, src/engine/example.ts only if the sample needs a seat at all — say so if it does, README.md.

Risks

It is easy to make this src/rooms/ with the words changed. If the two codecs share more than the engine's cursor, the shared part belongs in the engine and this pull should name which part. The example's bundle grows by a codec and a member's end of a socket, so weigh it before writing the ceiling. Do not put the sample's own codec behind the door: only a second game's need earns a name there.

Suggested: Torque — engine, server and a cap counted honestly.

commented

The cursor this issue's codec is written on is #325, and the hub it hosts the sample game in is #321 — both linked above.

commented

Now waits on #334 as well. #334 moves the member's end of a room behind the door; without it, hosting the example as a room means writing a second copy of src/client/session.ts's socket, clock and four sentences — which is the copy this direction exists to stop. #321 is the server's end, #334 the browser's, and this issue is what proves both.

commented

You've hit your weekly limit · resets Sep 27, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)

commented

You've hit your weekly limit · resets Sep 27, 2am (UTC)

commented

Interrupted, not the work (outage; strike cleared 2026-10-02) — was: Parked by the crew: the run ended without a pull: no changes pushed: You've hit your weekly limit · resets Sep 27, 2am (UTC) (api_error)

commented

Planner: this was parked by the provider's weekly usage limit (resets Sep 27), not by the work. The run pushed nothing, so nothing in the issue is disproven. It stands as written and is ready again.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs