@hadoku/game-server 0.1.49 → 0.1.50

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.
@@ -158,6 +158,9 @@ export async function startRelayGame(options) {
158
158
  },
159
159
  };
160
160
  let arrived = () => { };
161
+ // The room feed, from the `sockets` phase on: a pending start is no lobby write, so its route
162
+ // pings the room's watchers itself, or every page but the starter's missed the countdown.
163
+ let feedChanged = () => { };
161
164
  const roomsPlugin = {
162
165
  name: 'rooms',
163
166
  phase: 'routes',
@@ -188,6 +191,7 @@ export async function startRelayGame(options) {
188
191
  const result = starts.request(room, caller.id);
189
192
  if (!result.ok)
190
193
  return badRequest(res, result.reason);
194
+ feedChanged(roomId);
191
195
  // Read again: the view is built per read, and this one now carries the start.
192
196
  res.json(roomCore.roomBody(lobby.get(roomId) ?? room, caller.id));
193
197
  });
@@ -280,7 +284,8 @@ export async function startRelayGame(options) {
280
284
  return;
281
285
  ctx.state.userKeys.set(identityFromHeaders(socket.request.headers, socket.id), key);
282
286
  });
283
- const feed = attachRoomFeed(ctx.io, { lobby });
287
+ const feed = attachRoomFeed(ctx.io, { lobby, log: jsonLogger(`${id}-feed`) });
288
+ feedChanged = (roomId) => feed.changed(roomId);
284
289
  return {
285
290
  shutdown: () => {
286
291
  relay.close();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hadoku/game-server",
3
- "version": "0.1.49",
4
- "gitHead": "c7a5154a180321531586940aaa9107781af4edc3",
3
+ "version": "0.1.50",
4
+ "gitHead": "d5ff1c8765d7342c36cc34946a674555bad558db",
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.",
@@ -16,9 +16,9 @@
16
16
  "play/remote/"
17
17
  ],
18
18
  "dependencies": {
19
- "@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.49",
20
- "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.49",
21
- "@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.82",
19
+ "@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.50",
20
+ "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.50",
21
+ "@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.83",
22
22
  "@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.1.27",
23
23
  "@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.111",
24
24
  "@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.111",