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

Game door: the desk snapshot carries each player's allowed servers, from whoMayReach #18325

opened this

Merged 2h 36m ago, live in production

The snapshot file that the box's agent puts in the proxy's plugin folder now has a reach(uuid, server) table. It has one row for each linked player and each server whoMayReach (src/games/reach.ts) lets them on. The uuid is the one stored on their link.

Notes

opened this

The snapshot file that the box's agent puts in the proxy's plugin folder now has a reach(uuid, server) table. It has one row for each linked player and each server whoMayReach (src/games/reach.ts) lets them on. The uuid is the one stored on their link. The forge's own database and grants are unchanged.

whoMayReach returns player names, so the new reachRows in src/games/desk_snapshot.ts looks each name up in game_link to get its UUID. It reuses whoMayReach as the issue asked instead of a second copy of the rule. pack takes the rows as an optional fourth argument and always keeps them whole; players' answers are still the part dropped when the file gets too big. The rows are part of the version hash, so removing a grant produces a new version and the agent is sent the new file.

One behaviour change: the file used to be made only while a linked player was on a server. It is now made whenever the box's compose file can be read. Without that, a player joining an empty network would find no rule, and the table could not be present but empty when nobody may reach anything. pack([]) now returns a file with an empty answer table instead of undefined. The 1.5 MB limit and the 15-second/one-minute timings are unchanged.

docs/features/games.md names reach(uuid, server) as the contract forge-velocity reads and lists who gets no row. It also says the rule holds in the game only once the plugin filters the server list, hub selector and /server by this table. Until such a plugin is pinned, nothing reads it.

Not done:

  • Plugin side: forge-velocity's source is not in this repository (#18303).
  • Terminal: there is no terminal or page change, because the table is a file for the plugin and nothing a person sees changes. The commit says so in a No door: line.

Two new tests in test/game-desk-snapshot.test.ts:

  • A viewer on hub gets one row. A player with no grant and a suspended account get none, and an offline-mode network gives an empty table. Removing the grant and making the file again empties it.
  • A change in the rows changes the version.

Checks: bun x tsc --noEmit is clean. bun scripts/gate.ts reports 0 failing rules, and its comment rewrap is committed separately. 135 tests across 14 files pass: the snapshot, reach, desk and games tests plus the dead-code, duplicate-import, feature-doc and test-honesty rules. bun scripts/fast.ts named 392 files, about 26 minutes, so the rest is left to the forge's full check.

To try it: bun test test/game-desk-snapshot.test.ts test/game-reach.test.ts.

🤖 Generated with Claude Code

Closes #18323

commented

The snapshot file that the box's agent puts in the proxy's plugin folder now has a reach(uuid, server) table. It has one row for each linked player and each server whoMayReach (src/games/reach.ts) lets them on. The uuid is the one stored on their link. The forge's own database and grants are unchanged.

whoMayReach returns player names, so the new reachRows in src/games/desk_snapshot.ts looks each name up in game_link to get its UUID. It reuses whoMayReach as the issue asked instead of a second copy of the rule. pack takes the rows as an optional fourth argument and always keeps them whole; players' answers are still the part dropped when the file gets too big. The rows are part of the version hash, so removing a grant produces a new version and the agent is sent the new file.

One behaviour change: the file used to be made only while a linked player was on a server. It is now made whenever the box's compose file can be read. Without that, a player joining an empty network would find no rule, and the table could not be present but empty when nobody may reach anything. pack([]) now returns a file with an empty answer table instead of undefined. The 1.5 MB limit and the 15-second/one-minute timings are unchanged.

docs/features/games.md names reach(uuid, server) as the contract forge-velocity reads and lists who gets no row. It also says the rule holds in the game only once the plugin filters the server list, hub selector and /server by this table. Until such a plugin is pinned, nothing reads it.

Not done:

  • Plugin side: forge-velocity's source is not in this repository (#18303).
  • Terminal: there is no terminal or page change, because the table is a file for the plugin and nothing a person sees changes. The commit says so in a No door: line.

Two new tests in test/game-desk-snapshot.test.ts:

  • A viewer on hub gets one row. A player with no grant and a suspended account get none, and an offline-mode network gives an empty table. Removing the grant and making the file again empties it.
  • A change in the rows changes the version.

Checks: bun x tsc --noEmit is clean. bun scripts/gate.ts reports 0 failing rules, and its comment rewrap is committed separately. 135 tests across 14 files pass: the snapshot, reach, desk and games tests plus the dead-code, duplicate-import, feature-doc and test-honesty rules. bun scripts/fast.ts named 392 files, about 26 minutes, so the rest is left to the forge's full check.

To try it: bun test test/game-desk-snapshot.test.ts test/game-reach.test.ts.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs