diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-08 03:29:35 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-08 03:29:35 +0100 |
| commit | 058432130628d00764663ecf819a9adc6793768d (patch) | |
| tree | d3f49f111fbfaa48647cca2600adcf9017af2d30 /web/README.md | |
| parent | web: serve latest.php through PHP and refuse stray PHP files (diff) | |
| download | zagan-bet-058432130628d00764663ecf819a9adc6793768d.tar.gz zagan-bet-058432130628d00764663ecf819a9adc6793768d.zip | |
v5.0.0: protocol v5 and the browser frontend
Protocol v5 replaces newline lines with bounded [u32 len][text] frames and REQ/RES/EVT envelopes. Requests carry correlation ids and the server replays the last 256 replies per connection, so a gateway retry cannot double-debit and a late reply cannot clobber a newer request. HELLO/PONG carry server time; crash rounds announce started_at and push coalesced 10 Hz ticks. Crash now commits sha256(seed) before a round and reveals the seed when it ends, so clients recompute the crash point.
Adds the webd/ gateway: one blocking thread, one ClientCore and one pinned upstream TLS connection per session, an HttpOnly session cookie, takeover, and a 60-second grace window. The browser sends Command JSON and renders View JSON; it never speaks the game protocol or stores credentials.
Adds the vanilla TypeScript browser app at /play/ (login, lobby, all four games, history, notices, crash verification), the nginx /play and /ws routes, and the headless DOM smoke test. webd and the app stay out of the TUI/GUI/server build graph.
The client/server version moves to 5.0.0 in lockstep; v4 peers are refused at HELLO.
Diffstat (limited to '')
| -rw-r--r-- | web/README.md | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/web/README.md b/web/README.md index 81346fd..3e81468 100644 --- a/web/README.md +++ b/web/README.md | |||
| @@ -13,6 +13,7 @@ web/ | |||
| 13 | releases.php shared scanner and hash cache | 13 | releases.php shared scanner and hash cache |
| 14 | install.sh stable Linux installer | 14 | install.sh stable Linux installer |
| 15 | install.ps1 stable Windows installer | 15 | install.ps1 stable Windows installer |
| 16 | play/ browser app, served at /play/ | ||
| 16 | bin/gui/ apps, served at /bin/gui/... | 17 | bin/gui/ apps, served at /bin/gui/... |
| 17 | bin/client/ terminal clients | 18 | bin/client/ terminal clients |
| 18 | bin/server/ servers | 19 | bin/server/ servers |
| @@ -20,6 +21,26 @@ web/ | |||
| 20 | 21 | ||
| 21 | Serve `web/` as the document root. Binaries in `bin/` are gitignored. | 22 | Serve `web/` as the document root. Binaries in `bin/` are gitignored. |
| 22 | 23 | ||
| 24 | ## Browser app | ||
| 25 | |||
| 26 | `play/` is a static vanilla TypeScript app. It talks to the WebSocket gateway | ||
| 27 | in `webd/`, not to the game server: the browser sends `Command` JSON and renders | ||
| 28 | `View` JSON, and the gateway owns the upstream TLS connection and the pinned | ||
| 29 | server key. nginx serves `/play/` and proxies `/ws` to `127.0.0.1:8890`. | ||
| 30 | |||
| 31 | Build it before publishing: | ||
| 32 | |||
| 33 | ```sh | ||
| 34 | cd web/play | ||
| 35 | npm ci | ||
| 36 | npm run build # writes app.js | ||
| 37 | cd ../.. | ||
| 38 | ``` | ||
| 39 | |||
| 40 | Commit the generated `app.js`; the site then needs no Node at deploy time. | ||
| 41 | `npm run typecheck` checks the sources. The gateway has its own deployment | ||
| 42 | notes in `webd/README.md`; it is not part of the player download. | ||
| 43 | |||
| 23 | ## Naming | 44 | ## Naming |
| 24 | 45 | ||
| 25 | The page only lists files that match the release pattern; anything else in | 46 | The page only lists files that match the release pattern; anything else in |
| @@ -132,9 +153,9 @@ Then open <http://127.0.0.1:8899/>. | |||
| 132 | `deploy.sh` rsyncs `web/` with `--delay-updates`, so a visitor never sees a | 153 | `deploy.sh` rsyncs `web/` with `--delay-updates`, so a visitor never sees a |
| 133 | half-written binary, then fetches the live page and every artifact it lists — | 154 | half-written binary, then fetches the live page and every artifact it lists — |
| 134 | GUI apps, installers, terminal clients and servers — and compares the | 155 | GUI apps, installers, terminal clients and servers — and compares the |
| 135 | downloaded bytes with the local SHA-256. `--verify-only` skips the | 156 | downloaded bytes with the local SHA-256. It also fetches `/play/`, `app.js` and |
| 136 | upload and only checks the live site. Old versions are left on the server; | 157 | `style.css`. `--verify-only` skips the upload and only checks the live site. |
| 137 | prune them by hand. | 158 | Old versions are left on the server; prune them by hand. |
| 138 | 159 | ||
| 139 | A local directory works as a target, which is how the verification itself is | 160 | A local directory works as a target, which is how the verification itself is |
| 140 | tested: | 161 | tested: |
