@hadoku/game-ui 0.1.126 → 0.1.128
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,47 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The ONE config for every external game cardtable may host as a room type
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* itself.
|
|
2
|
+
* The ONE config for every external game cardtable may host as a room type: the HOST's half of
|
|
3
|
+
* each, pure data. "Deleting that one entry removes bomberman from cardtable" (wave 119's settled
|
|
4
|
+
* rule): an entry names the game's id, that it runs on cardtable's relay, where its same-origin
|
|
5
|
+
* embed bundle is, and who may play it. Nothing here is the game's to decide: its name, seat range
|
|
6
|
+
* and seat hold are in the `manifest.json` it publishes beside its embed entry
|
|
7
|
+
* (`@hadoku/platform-wire/external-game-manifest`, `docs/GAME_AUTHORS.md`), which the server reads.
|
|
9
8
|
*
|
|
10
9
|
* Read by both sides, which never import each other:
|
|
11
|
-
* - `apps/server/src/plugins/external-games.ts` (the site
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* room UI's `BundleSlot`, unconditionally — a room already made keeps rendering whatever today's
|
|
17
|
-
* deployment flag says, since reading it needs no server round trip the client doesn't already
|
|
18
|
-
* make.
|
|
19
|
-
*
|
|
20
|
-
* Two test files outside this package read this same array rather than re-typing its fields:
|
|
21
|
-
* `games/magic/server/src/plugins/relay.test.ts` and `games/magic/server/src/room/codec-generic.test.ts`.
|
|
10
|
+
* - `apps/server/src/plugins/external-games.ts` (the site) reads each entry's manifest, builds the
|
|
11
|
+
* pair into a `GameTypeSpec` (`@hadoku/shared`'s `externalGameSpec`) and registers it, gated on
|
|
12
|
+
* `CARDTABLE_EXPERIMENTAL_GAMES=1`, and answers `GET /api/external-games` with the labels.
|
|
13
|
+
* - `./external-games.tsx` (platform) registers each entry's room UI, a `BundleSlot` on the relay,
|
|
14
|
+
* unconditionally: a room already made keeps rendering whatever today's deployment flag says.
|
|
22
15
|
*/
|
|
16
|
+
import type { ExternalGameManifestInput } from '@wolffm/platform-wire/external-game-manifest';
|
|
23
17
|
export interface ExternalGameConfig {
|
|
24
18
|
/** The room's wire `gameType`. */
|
|
25
19
|
id: string;
|
|
26
|
-
/** What Create room's radio calls it. */
|
|
27
|
-
label: string;
|
|
28
|
-
/** The ROOM's own capacity — one meaning across every registered type (`GameTypeSpec.seats`). */
|
|
29
|
-
seats: {
|
|
30
|
-
min: number;
|
|
31
|
-
max: number;
|
|
32
|
-
};
|
|
33
20
|
/**
|
|
34
21
|
* This game type's match runs on cardtable's relay (`RelaySession`): the host has no engine
|
|
35
22
|
* of its own for it, only seats, watchers and a channel each seat's bundle speaks over.
|
|
36
23
|
*/
|
|
37
24
|
runtime: 'relay';
|
|
38
|
-
/** The same-origin path the client's `BundleSlot` loads this game's bundle from
|
|
25
|
+
/** The same-origin path the client's `BundleSlot` loads this game's bundle from; its `manifest.json` is beside it. */
|
|
39
26
|
embedSrc: string;
|
|
40
|
-
/** How long a dropped seat is held for its player to come back (`relay-match.ts`'s `seatRejoinGraceMs`). */
|
|
41
|
-
seatRejoinGraceMs: number;
|
|
42
27
|
/**
|
|
43
28
|
* Every room of this game is friends-only (`GameTypeSpec.minTier`): the server hides and refuses
|
|
44
|
-
* it below friend tier, as the edge names it, and
|
|
29
|
+
* it below friend tier, as the edge names it, and lists it only to a friend or above.
|
|
45
30
|
*/
|
|
46
31
|
minTier?: 'friend';
|
|
47
32
|
/**
|
|
@@ -54,15 +39,12 @@ export interface ExternalGameConfig {
|
|
|
54
39
|
* where a real external game is turned on. The e2e spec's own `startPlayStack` sets both.
|
|
55
40
|
*/
|
|
56
41
|
e2eOnly?: boolean;
|
|
42
|
+
/** An `e2eOnly` fixture's manifest, since no publisher serves one for it. A real game's is always its own file. */
|
|
43
|
+
manifest?: ExternalGameManifestInput;
|
|
57
44
|
}
|
|
58
45
|
/**
|
|
59
46
|
* One entry per external game cardtable may host, plus one e2e-only fixture entry. Bomberman's own
|
|
60
47
|
* repo serves `/bomberman/embed/bomberman-embed.js` same-origin, the same path watchparty loads it
|
|
61
48
|
* from.
|
|
62
|
-
*
|
|
63
|
-
* - `seats: {min:2, max:10}` — `hadoku-bomberman/game/src/consts.rs:54` (`MAX_PLAYERS = 10`) and
|
|
64
|
-
* `game/src/board.rs:136` (no 1-player map).
|
|
65
|
-
* - `seatRejoinGraceMs: 120_000` — bomberman's own seat hold (its `BOMBERMAN_SEAT_HOLD_MS`), so a
|
|
66
|
-
* player who drops keeps their seat as long here as on bomberman's own server.
|
|
67
49
|
*/
|
|
68
50
|
export declare const EXTERNAL_GAMES: readonly ExternalGameConfig[];
|
|
@@ -1,63 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The ONE config for every external game cardtable may host as a room type — pure data, no
|
|
3
|
-
* React, no import beyond this file's own types. "Deleting that one entry removes bomberman from
|
|
4
|
-
* cardtable" (wave 119's settled rule): each entry names everything a room of that type needs —
|
|
5
|
-
* its id, its label on the create form, its seat range, that it runs on cardtable's relay, its
|
|
6
|
-
* same-origin embed bundle and its seat-rejoin grace — and nothing of that game's own code lives
|
|
7
|
-
* here, exactly as `packages/shared/src/bomberman-game-type.ts` (deleted this wave) said of
|
|
8
|
-
* itself.
|
|
9
|
-
*
|
|
10
|
-
* Read by both sides, which never import each other:
|
|
11
|
-
* - `apps/server/src/plugins/external-games.ts` (the site, which may import anything) builds
|
|
12
|
-
* each entry into a `GameTypeSpec` and registers it, gated on `CARDTABLE_EXPERIMENTAL_GAMES=1`
|
|
13
|
-
* — unset, nothing here ever reaches the room registry, and creating or joining one of these
|
|
14
|
-
* room types refuses the same way any unregistered type always has.
|
|
15
|
-
* - `./external-games.tsx` (platform) builds the same shape into a client `GameTypeSpec` plus the
|
|
16
|
-
* room UI's `BundleSlot`, unconditionally — a room already made keeps rendering whatever today's
|
|
17
|
-
* deployment flag says, since reading it needs no server round trip the client doesn't already
|
|
18
|
-
* make.
|
|
19
|
-
*
|
|
20
|
-
* Two test files outside this package read this same array rather than re-typing its fields:
|
|
21
|
-
* `games/magic/server/src/plugins/relay.test.ts` and `games/magic/server/src/room/codec-generic.test.ts`.
|
|
22
|
-
*/
|
|
23
1
|
/**
|
|
24
2
|
* One entry per external game cardtable may host, plus one e2e-only fixture entry. Bomberman's own
|
|
25
3
|
* repo serves `/bomberman/embed/bomberman-embed.js` same-origin, the same path watchparty loads it
|
|
26
4
|
* from.
|
|
27
|
-
*
|
|
28
|
-
* - `seats: {min:2, max:10}` — `hadoku-bomberman/game/src/consts.rs:54` (`MAX_PLAYERS = 10`) and
|
|
29
|
-
* `game/src/board.rs:136` (no 1-player map).
|
|
30
|
-
* - `seatRejoinGraceMs: 120_000` — bomberman's own seat hold (its `BOMBERMAN_SEAT_HOLD_MS`), so a
|
|
31
|
-
* player who drops keeps their seat as long here as on bomberman's own server.
|
|
32
5
|
*/
|
|
33
6
|
export const EXTERNAL_GAMES = [
|
|
34
7
|
{
|
|
35
8
|
id: 'bomberman',
|
|
36
|
-
label: 'Bomberman',
|
|
37
|
-
seats: { min: 2, max: 10 },
|
|
38
9
|
runtime: 'relay',
|
|
39
10
|
embedSrc: '/bomberman/embed/bomberman-embed.js',
|
|
40
|
-
seatRejoinGraceMs: 120_000,
|
|
41
11
|
},
|
|
42
12
|
// An outside author's game (Cozmiverse/crossover-cards), served friends-only from
|
|
43
13
|
// `/games/crossover-cards/` by hadoku_site's game-bundles.json row. Its rooms are friends-only
|
|
44
14
|
// too, whatever the app's floor: it carries other publishers' card data.
|
|
45
15
|
{
|
|
46
16
|
id: 'crossover-cards',
|
|
47
|
-
label: 'Crossover Cards',
|
|
48
|
-
seats: { min: 1, max: 4 },
|
|
49
17
|
runtime: 'relay',
|
|
50
18
|
embedSrc: '/games/crossover-cards/embed.js',
|
|
51
|
-
seatRejoinGraceMs: 120_000,
|
|
52
19
|
minTier: 'friend',
|
|
53
20
|
},
|
|
54
21
|
{
|
|
55
22
|
id: 'e2e-toy-relay',
|
|
56
|
-
label: 'Toy Relay Game',
|
|
57
|
-
seats: { min: 2, max: 4 },
|
|
58
23
|
runtime: 'relay',
|
|
59
24
|
embedSrc: '/e2e/toy-relay-embed.js',
|
|
60
|
-
seatRejoinGraceMs: 120_000,
|
|
61
25
|
e2eOnly: true,
|
|
26
|
+
manifest: { label: 'Toy Relay Game', seats: { min: 2, max: 4 }, seatRejoinGraceMs: 120_000 },
|
|
62
27
|
},
|
|
63
28
|
];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadoku/game-ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "0.1.128",
|
|
4
|
+
"gitHead": "5dd41313efc861da44f781b3e8479a6b9f6b3494",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "The browser parts any hosted game shares, above ui-shell: the room shell and session, seats and looks, the room route, the front page's generic pieces (gate, polls, gallery, patch notes), the bundle slot and relay channel a game's client mounts in, settings and trim screens, the HTTP and socket helpers, and the generic components (modal, popover, avatar, action button, radio cards). Knows no game; Magic's UI (games/magic/ui) plugs in, composed by the site (apps/ui). MIT; imports only react, react-dom, socket.io-client, @wolffm/* and the platform packages.",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"react-dom": "^19.2.8"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.
|
|
58
|
-
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.
|
|
57
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.132",
|
|
58
|
+
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.132",
|
|
59
59
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.1",
|
|
60
|
-
"@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.
|
|
61
|
-
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.
|
|
60
|
+
"@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.139",
|
|
61
|
+
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.139",
|
|
62
62
|
"@wolffm/task-ui-components": "npm:@hadoku/task-ui-components@^4.23.48",
|
|
63
63
|
"@wolffm/themes": "npm:@hadoku/themes@^5.14.18",
|
|
64
|
-
"@wolffm/watchparty-ui": "npm:@hadoku/watchparty-ui@^0.45.
|
|
64
|
+
"@wolffm/watchparty-ui": "npm:@hadoku/watchparty-ui@^0.45.139",
|
|
65
65
|
"socket.io-client": "^4.8.3",
|
|
66
66
|
"zod": "4.5.4"
|
|
67
67
|
},
|