feat(web): use the shared high-score service
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
This commit is contained in:
+11
-7
@@ -40,9 +40,10 @@ just web-serve
|
||||
```
|
||||
|
||||
Then open <http://127.0.0.1:8000/>. The browser build keeps the original
|
||||
640x460 presentation centered on a black page and stores settings and high
|
||||
scores in browser storage. See [web/README.md](web/README.md) for the static
|
||||
bundle details.
|
||||
640x460 presentation centered on a black page and stores settings and a local
|
||||
fallback table in browser storage unless the optional same-origin
|
||||
`/api/highscores` service is deployed. See [web/README.md](web/README.md) and
|
||||
[highscore-server/README.md](highscore-server/README.md) for deployment details.
|
||||
|
||||
## Deterministic mechanics validation
|
||||
|
||||
@@ -88,10 +89,13 @@ box closes the program.
|
||||
|
||||
## Saved data
|
||||
|
||||
Settings and the ten-entry high-score table are stored as `save.json` in the
|
||||
platform's normal per-user application-data directory. On first run, settings
|
||||
are imported from an adjacent original INI (or the embedded distributed
|
||||
TDKPIN.INI), and the table is imported from the original `HISCORES.DAT`.
|
||||
Native settings and the ten-entry high-score table are stored as `save.json` in
|
||||
the platform's normal per-user application-data directory. Browser settings
|
||||
and the fallback table use `localStorage`; a deployed browser build uses the
|
||||
same-origin high-score service as its shared table when available. On first
|
||||
run, native settings are imported from an adjacent original INI (or the
|
||||
embedded distributed TDKPIN.INI), and the table is imported from the original
|
||||
`HISCORES.DAT`.
|
||||
|
||||
## Reconstruction status
|
||||
|
||||
|
||||
Reference in New Issue
Block a user