Keep browser settings and the existing local save fallback, but route the browser high-score table through the same-origin service when it is available. The WASM storage bridge now accepts fetched score JSON and queues one validated submission at a time. The JavaScript plugin fetches the canonical table, submits accepted name-entry scores, ignores stale responses, retries failures, and feeds successful responses back into the running game. Update the web and project documentation to describe the optional shared leaderboard and regenerate the tracked browser artifact. A missing service continues to leave the local table usable; the service documentation records that anonymous client scores are intentionally not tamper-resistant. Test Plan: - `just test` -- passed (3 service tests and 137 game tests) - `just clippy` -- passed - `just web-build` -- passed - `cargo +nightly fmt -- --check` -- passed - `node --check web/storage.js` and `prettier --check web/storage.js` -- passed - `rumdl check --flavor commonmark CHANGELOG.md README.md web/README.md highscore-server/README.md` -- passed - Browser WASM load through same-origin API proxy -- passed - `git diff --cached --check` -- passed
21 lines
801 B
Markdown
21 lines
801 B
Markdown
# TDK Pinball Machine web build
|
|
|
|
Build and serve the browser version from this directory with:
|
|
|
|
```sh
|
|
just web-serve
|
|
```
|
|
|
|
The game is compiled for `wasm32-unknown-unknown` and loaded into a fixed
|
|
640x460 canvas centered on the black page by `index.html`. Browser settings and
|
|
a fallback copy of the high-score table are saved in `localStorage`; native
|
|
builds continue to use their normal per-user save file.
|
|
|
|
The page uses Macroquad's official browser loader from the miniquad samples
|
|
site. The web page must be served over HTTP rather than opened directly from a
|
|
`file:` URL.
|
|
|
|
When the same-origin `/api/highscores` endpoint is available, the browser loads
|
|
and submits the shared top-ten table there. The small Axum service and an nginx
|
|
proxy example are in [highscore-server](../highscore-server/).
|