@hadoku/game-server 0.1.224 → 0.1.225

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.
@@ -281,6 +281,8 @@ export type RoomBody<V extends RoomViewCore, G = never> = V & {
281
281
  /** The members in the room now: those with a screen open on it, its lobby or any game of it. The spectator row lists only these. Absent where this server cannot say: every member is listed. */
282
282
  here?: string[];
283
283
  };
284
+ /** A route's refusal: `status` with a body of exactly `{ error }`. A handler ends on it: `if (…) return refuse(res, 409, '…');`. */
285
+ export declare function refuse(res: Response, status: number, error: string): void;
284
286
  export declare function badRequest(res: Response, error: string): void;
285
287
  export declare function noMatch(res: Response): void;
286
288
  export declare function notDurable(res: Response, verb?: string): void;
@@ -143,8 +143,12 @@ function awayOf(members, seen) {
143
143
  }
144
144
  return away;
145
145
  }
146
+ /** A route's refusal: `status` with a body of exactly `{ error }`. A handler ends on it: `if (…) return refuse(res, 409, '…');`. */
147
+ export function refuse(res, status, error) {
148
+ res.status(status).json({ error });
149
+ }
146
150
  export function badRequest(res, error) {
147
- res.status(400).json({ error });
151
+ refuse(res, 400, error);
148
152
  }
149
153
  export function noMatch(res) {
150
154
  res.status(404).json(NO_MATCH);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hadoku/game-server",
3
- "version": "0.1.224",
4
- "gitHead": "1f29c1c2fc7f6d58219310cd25315623016cdc93",
3
+ "version": "0.1.225",
4
+ "gitHead": "6db2b0d6cae6d1813362faedd2a1a3bef801dcf8",
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.224",
20
- "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.224",
21
- "@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.257",
19
+ "@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.225",
20
+ "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.225",
21
+ "@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.258",
22
22
  "@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.3",
23
23
  "@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.152",
24
24
  "@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.152",