@hadoku/game-server 0.1.215 → 0.1.217
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/play/host.d.ts
CHANGED
|
@@ -300,6 +300,8 @@ export interface Durable {
|
|
|
300
300
|
epoch: string;
|
|
301
301
|
owners: (string | null)[];
|
|
302
302
|
checkpoint?: unknown;
|
|
303
|
+
/** What the game keeps beside its board across a restart (Magic's: each seat's own settings), opaque to the host as `checkpoint` is; absent when the game keeps nothing. */
|
|
304
|
+
carry?: unknown;
|
|
303
305
|
}
|
|
304
306
|
/**
|
|
305
307
|
* A match an earlier server left running, as `orphans()` offers it: everything a re-attach needs
|
|
@@ -308,7 +310,7 @@ export interface Durable {
|
|
|
308
310
|
* `Durable`'s own, always-set `epoch`) because a freshly placed match has none yet — before its
|
|
309
311
|
* first `remember()`, it has no durable identity to resume by.
|
|
310
312
|
*/
|
|
311
|
-
export interface MatchRecord extends Pick<Durable, 'owners' | 'checkpoint'> {
|
|
313
|
+
export interface MatchRecord extends Pick<Durable, 'owners' | 'checkpoint' | 'carry'> {
|
|
312
314
|
matchId: string;
|
|
313
315
|
/** The JVM it runs in. */
|
|
314
316
|
hostId: string;
|
package/dist/play/host.js
CHANGED
|
@@ -212,6 +212,7 @@ export function readJvmRecord(dir) {
|
|
|
212
212
|
// checkpoint IS its turn-start snapshot.
|
|
213
213
|
...(isTurnSnapshot(m.snapshot) ? { snapshot: m.snapshot } : isTurnSnapshot(m.checkpoint) ? { snapshot: m.checkpoint } : {}),
|
|
214
214
|
spec: m.spec,
|
|
215
|
+
...(m.carry === undefined ? {} : { carry: m.carry }),
|
|
215
216
|
...(isClockMs(m.clockMs) ? { clockMs: m.clockMs } : {}),
|
|
216
217
|
...(m.clockPaused === true ? { clockPaused: true } : {}),
|
|
217
218
|
...(m.clockSeated === true ? { clockSeated: true } : {}),
|
|
@@ -772,7 +773,7 @@ export function jvmHostFactory(config, options = {}) {
|
|
|
772
773
|
},
|
|
773
774
|
stop: () => stopMatch(h),
|
|
774
775
|
remember: (state) => {
|
|
775
|
-
const { clockPaused: _was, clockSeated: _seated, ...entry } = h.entry;
|
|
776
|
+
const { clockPaused: _was, clockSeated: _seated, carry: _carried, ...entry } = h.entry;
|
|
776
777
|
h.entry = {
|
|
777
778
|
...entry,
|
|
778
779
|
epoch: state.epoch,
|
|
@@ -780,6 +781,7 @@ export function jvmHostFactory(config, options = {}) {
|
|
|
780
781
|
// Whatever the caller's own game last had of its `{ t: 'checkpoint' }` line — see `Durable`'s own doc.
|
|
781
782
|
checkpoint: state.checkpoint ?? null,
|
|
782
783
|
...(state.snapshot === undefined ? {} : { snapshot: state.snapshot }),
|
|
784
|
+
...(state.carry === undefined ? {} : { carry: state.carry }),
|
|
783
785
|
...(state.clockMs === undefined ? {} : { clockMs: state.clockMs }),
|
|
784
786
|
...(state.clockPaused === true ? { clockPaused: true } : {}),
|
|
785
787
|
...(state.clockSeated === true ? { clockSeated: true } : {}),
|
|
@@ -237,6 +237,8 @@ export declare abstract class MatchShell<Line extends {
|
|
|
237
237
|
* server hands the match over, so a crash between two of those gives a seat back at most a turn.
|
|
238
238
|
*/
|
|
239
239
|
protected remember(): void;
|
|
240
|
+
/** What the game keeps beside its board across a restart, opaque here (`Durable.carry`); undefined: nothing, and {@link remember} writes no key. */
|
|
241
|
+
protected carry(): unknown;
|
|
240
242
|
/** Each seat's chess-clock time left, or null in a game without one. */
|
|
241
243
|
clockLeft(): [number, number] | null;
|
|
242
244
|
/**
|
package/dist/play/match/shell.js
CHANGED
|
@@ -154,16 +154,22 @@ export class MatchShell {
|
|
|
154
154
|
*/
|
|
155
155
|
remember() {
|
|
156
156
|
const clockMs = this.clockLeft();
|
|
157
|
+
const carry = this.carry();
|
|
157
158
|
this.host?.remember?.({
|
|
158
159
|
epoch: this.epoch,
|
|
159
160
|
owners: this.owners(),
|
|
160
161
|
checkpoint: this.latestCheckpoint,
|
|
161
162
|
snapshot: this.latestSnapshot,
|
|
163
|
+
...(carry === undefined ? {} : { carry }),
|
|
162
164
|
...(clockMs === null ? {} : { clockMs }),
|
|
163
165
|
...(this.clockPaused ? { clockPaused: true } : {}),
|
|
164
166
|
...(this.#clockSeated ? { clockSeated: true } : {}),
|
|
165
167
|
});
|
|
166
168
|
}
|
|
169
|
+
/** What the game keeps beside its board across a restart, opaque here (`Durable.carry`); undefined: nothing, and {@link remember} writes no key. */
|
|
170
|
+
carry() {
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
167
173
|
/** Each seat's chess-clock time left, or null in a game without one. */
|
|
168
174
|
clockLeft() {
|
|
169
175
|
return this.clock?.left(this.now()) ?? null;
|
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.217",
|
|
4
|
+
"gitHead": "08f73d5b7b868ba55e0dbe3e29ad695e159b2dd3",
|
|
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.
|
|
20
|
-
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.
|
|
21
|
-
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.
|
|
19
|
+
"@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.217",
|
|
20
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.217",
|
|
21
|
+
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.250",
|
|
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",
|