@hadoku/game-server 0.1.189 → 0.1.191
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.
package/dist/http/room-core.d.ts
CHANGED
|
@@ -250,6 +250,8 @@ export interface RoomCoreDeps<V extends RoomViewCore, C, P extends object, G = n
|
|
|
250
250
|
arrived?: (roomId: string, caller: CallerLike) => void;
|
|
251
251
|
/** Each table's game, by table id (`play/table-game.ts`). A hook: this file never inspects `G`'s shape. */
|
|
252
252
|
tableGames?(room: V): Record<string, G>;
|
|
253
|
+
/** The room as a browser is sent it, when the game draws less than its lobby holds (Magic's `podForPeople`). Absent: the room as it is. */
|
|
254
|
+
bodyView?(room: V): V;
|
|
253
255
|
featured?(caller: string): {
|
|
254
256
|
matchId: string;
|
|
255
257
|
roomId: string;
|
package/dist/http/room-core.js
CHANGED
|
@@ -25,6 +25,7 @@ import { MultiRateLimiter } from '@wolffm/rooms-server';
|
|
|
25
25
|
import { isDurableParticipantId } from '@wolffm/rooms-protocol';
|
|
26
26
|
import { SEATS_OPEN_BEFORE_MS } from '@wolffm/platform-wire/events';
|
|
27
27
|
import { edgeTierOf, isAdmin } from '../edge-auth.js';
|
|
28
|
+
import { MIN_OPEN_SEATS } from '../room/lobby.js';
|
|
28
29
|
import { tierAdmits } from '../room/tier-floor.js';
|
|
29
30
|
import { bodyErrors, callerOf, parseBody, perCallerLimit, readBody } from './request.js';
|
|
30
31
|
import { isWatchpartyRoomId, watchpartyRoomId } from '../room/watchparty-link.js';
|
|
@@ -81,7 +82,7 @@ function seatOpStatus(res, reason) {
|
|
|
81
82
|
return;
|
|
82
83
|
}
|
|
83
84
|
if (reason === 'too-few') {
|
|
84
|
-
res.status(400).json({ error:
|
|
85
|
+
res.status(400).json({ error: `a room always keeps at least ${String(MIN_OPEN_SEATS)} seats open` });
|
|
85
86
|
return;
|
|
86
87
|
}
|
|
87
88
|
if (reason === 'bad-seat') {
|
|
@@ -189,7 +190,7 @@ export function attachRoomCore(api, deps, opts = {}) {
|
|
|
189
190
|
const inRoom = isWatchpartyRoomId(room.id) ? undefined : deps.here?.(room.id);
|
|
190
191
|
const here = inRoom === undefined ? undefined : room.members.filter((m) => inRoom.has(m.id)).map((m) => m.id);
|
|
191
192
|
return {
|
|
192
|
-
...room,
|
|
193
|
+
...(deps.bodyView?.(room) ?? room),
|
|
193
194
|
you: { id: callerId, leader: room.leader === callerId, ready: mine?.ready === true },
|
|
194
195
|
...(games === undefined ? {} : { tableGames: games }),
|
|
195
196
|
...(away === undefined ? {} : { away }),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadoku/game-server",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "0.1.191",
|
|
4
|
+
"gitHead": "de4b4a096b66ff20dcd18040a85d5a7819554be8",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "The server parts any hosted game shares, above the kernel: the app config and edge auth, the room core (identity, seats, sessions, membership, the room list, the generic room routes), match hosting (the host contract, local and remote JVMs, placement, the start queue, recordings, the in-process and relay runtimes), streams, erase, telemetry and usage. Knows no game; Magic plugs in from apps/server. MIT; imports only node built-ins, express, socket.io, @wolffm/* and the platform packages.",
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
"play/remote/"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.
|
|
21
|
-
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.
|
|
22
|
-
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.
|
|
20
|
+
"@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.191",
|
|
21
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.191",
|
|
22
|
+
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.224",
|
|
23
23
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.3",
|
|
24
|
-
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.
|
|
25
|
-
"@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.
|
|
24
|
+
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.149",
|
|
25
|
+
"@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.149",
|
|
26
26
|
"express": "^5.1.0",
|
|
27
27
|
"socket.io": "^4.8.3",
|
|
28
28
|
"zod": "4.5.4"
|