ReviewOS

stacks/the-settlers-iii-remake

[S3-093] Implement multiplayer sessions and content negotiation

#95
Open chris opened this 8 days ago ·
8 days ago

S3-093: Implement multiplayer sessions and content negotiation

Parent and ownership

Parent epic: https://github.com/stacksjs/the-settlers-iii-remake/issues/14 Source owner: stacksjs/the-settlers-iii-remake. Master roadmap: https://github.com/stacksjs/the-settlers-iii-remake/issues/4.

Problem and observable result

Create and join authenticated sessions. Assign valid player slots. Reject incompatible content and rules clearly.

The current application is a browser prototype. Passing the Riverlands campaign does not establish original-game or native parity. This issue is complete only when its stated behavior has retained evidence.

Evidence and interfaces

Versioned save envelopes and seeded command logs preserve complete simulation state. Online matches run authoritatively in Bun and emit visibility-filtered updates to authenticated clients.

Pin the inspected revisions and fixture hashes in the implementation evidence. Original-game observations govern rules and timing. JSettlers is implementation evidence, not an authoritative balance specification. Unknown values remain explicitly unverified.

Acceptance criteria

  • Create and join authenticated sessions.
  • Assign valid player slots.
  • Reject incompatible content and rules clearly.
  • The visible result agrees with the underlying simulation or platform state, including failure paths.
  • Tests exercise the maintained public interface and retain reproducible fixtures or execution receipts.

Test matrix

  • Join from browser and native clients.
  • Reject duplicate slots and content mismatches.
  • Exercise invalid input, cancellation or interruption, and repeated execution where this interface permits them.
  • Verify determinism/conservation for simulation changes and resource ownership/disposal for platform changes.
  • Run owning-repository lint, relevant type checks and tests. Capture actual native output for native capability claims.

Scope constraints

Implement this behavior as a complete verifiable slice. Do not silently expand into adjacent tickets or substitute simplified gameplay. Keep the shared TypeScript simulation, shared stx signals, and ts-css conventions. Native gameplay and HUD must not depend on a WebView. HomeOS reuse must not introduce a kernel dependency into the game. Existing unrelated edits and authored guidance must be preserved.

Blocked by

Upstream release and adoption

Application behavior belongs here. If a reproduction identifies a framework defect, repair and release its owning source first, update Stacks where affected, then install the verified packages here.

No node_modules edits, copied runtimes, generated-source string patches, fabricated globals, successful no-op implementations, or skipped release gates. Push tested conventional commits as Chris to the owning origin/main without coauthor trailers or force pushes.

Completion evidence

  • Implementation commits and relevant upstream issue links.
  • Exact checks and results, fixture hashes, and screenshots/native execution evidence where applicable.
  • Published package versions, downstream lockfile identity, and release receipts when affected.
  • Remaining limitations stated explicitly. Partial work does not close this issue.
2 days ago

Online sessions are implemented and tested (commit 6418bc5). Create and join authenticated sessions: POST /api/multiplayer/rooms and /rooms/:code/join behind the auth middleware, with the lobby at /multiplayer. Valid player slots: the server seats the host as player 1 and the guest as player 2, refuses a third player and a late joiner, and ignores any player, tick or sequence a client sends. Incompatible rules are refused with a clear message (SaveError surfaced by the match page, unit-tested in tests/unit/multiplayer-room.test.ts). Evidence: that file (11 tests) and tests/browser/multiplayer.ts (two signed-in browsers host, join, leave and rejoin, start, build, recover from a dropped connection, reload, and end in victory and defeat). Design and limits: docs/multiplayer.md. Not done here: native clients and content negotiation beyond the rules identity, so this stays open.

Sign in to comment on this issue.