@hadoku/game-server 0.1.263 → 0.1.264
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,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* One match's two recorded files
|
|
3
|
-
* contract 1): `<matchId>.actions.jsonl.gz` and `<matchId>.public.jsonl.gz`,
|
|
2
|
+
* One match's two recorded files: `<matchId>.actions.jsonl.gz` and `<matchId>.public.jsonl.gz`,
|
|
4
3
|
* and the one gzip JSONL writer and reader every user of the recordings
|
|
5
4
|
* directory goes through (the recorder, a rebuild, the replay routes, an erase).
|
|
6
5
|
*
|
|
@@ -22,12 +21,9 @@
|
|
|
22
21
|
*/
|
|
23
22
|
import type { JsonLog } from '@wolffm/service-kernel/log';
|
|
24
23
|
/**
|
|
25
|
-
* Line 1 of the action log
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* `v:1`'s `cmd` line carried `board`/`prompt`: a seat's folded-board digest and last prompt at
|
|
29
|
-
* `host.send` time, which `rebuild.ts` polled for before resending a command. Gone in `v:2` — see
|
|
30
|
-
* `ActionsCmdLine`'s own doc for why, and for what replaces it.
|
|
24
|
+
* Line 1 of the action log, `v:2`. `spec` always carries a seed (the recorder assigns one if play
|
|
25
|
+
* did not). A `v:1` log's `cmd` lines carried a board and a prompt to poll for; `ActionsCmdLine` says
|
|
26
|
+
* what replaces them.
|
|
31
27
|
*/
|
|
32
28
|
export interface ActionsHeader {
|
|
33
29
|
t: 'header';
|
|
@@ -41,19 +37,15 @@ export interface ActionsHeader {
|
|
|
41
37
|
spec: unknown;
|
|
42
38
|
}
|
|
43
39
|
/**
|
|
44
|
-
* One `cmd` line of the action log
|
|
45
|
-
*
|
|
46
|
-
* `
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* log of what was SENT is not a log of what the game did.
|
|
40
|
+
* One `cmd` line of the action log, `v:2`. `cmd` is the raw `BridgeCommand`: a `reply`/`abort`, or
|
|
41
|
+
* an `act` built from the bridge's own `applied` echo (`SeatController.java`'s `applied`, wired in
|
|
42
|
+
* `recorder.ts`'s `line` hook) rather than the browser's act at send time: Forge can drop a sent act
|
|
43
|
+
* (no input was open) or apply two in a different order than they were sent, so a log of what was
|
|
44
|
+
* SENT is not a log of what the game did.
|
|
50
45
|
*
|
|
51
|
-
* No
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* (same ordinal, fresh JVM) for that seat. A `reply`/`abort` never used them either: it is gated on
|
|
55
|
-
* its own ask (`ask`, below), a separate channel from board/prompt that can read a different stage
|
|
56
|
-
* of the game depending on how Forge batches the two.
|
|
46
|
+
* No board or prompt to poll for: an `act` line IS the applied act, in applied order, so a rebuild
|
|
47
|
+
* resends the next once it sees its own `applied` echo (same ordinal, fresh JVM) for that seat, and
|
|
48
|
+
* a `reply`/`abort` waits for its own ask (`ask`, below).
|
|
57
49
|
*
|
|
58
50
|
* Only `act`/`reply`/`abort`/`rewind` are ever logged: `stop`, `resend-pending`, `cancel-payment` and
|
|
59
51
|
* `probe` are connection/UI housekeeping, never part of the deterministic move sequence a rebuild
|
|
@@ -76,24 +68,30 @@ export interface ActionsEndLine {
|
|
|
76
68
|
reason: string;
|
|
77
69
|
/**
|
|
78
70
|
* Each seat's final board digest (`position.ts`), taken live. A rebuild that does not reach both
|
|
79
|
-
* is refused rather than served: the log alone does not
|
|
80
|
-
*
|
|
71
|
+
* is refused rather than served: the log alone does not reproduce every game, so this is what
|
|
72
|
+
* keeps a wrong replay off the page.
|
|
81
73
|
*/
|
|
82
74
|
boards?: [string, string];
|
|
83
75
|
/**
|
|
84
76
|
* Each seat holder's registry userId, by seat (null for the AI and an unheld seat), so a replay
|
|
85
|
-
* rebuilt from this log names its people as they are when watched
|
|
86
|
-
*
|
|
77
|
+
* rebuilt from this log names its people as they are when watched. The log keeps no name: its
|
|
78
|
+
* spec's human seats are `Player N` (`recorder.ts`'s `anonymousSpec`). Absent from an older log.
|
|
87
79
|
*/
|
|
88
80
|
users?: (string | null)[];
|
|
81
|
+
/**
|
|
82
|
+
* How many asks each seat was sent live, by seat. Forge runs an act after the bridge echoes it, so
|
|
83
|
+
* the asks a stopped match's last act opens can come after both boards already match `boards`: a
|
|
84
|
+
* rebuild waits for these too before it settles. Absent from an older log, which settles on its boards.
|
|
85
|
+
*/
|
|
86
|
+
asks?: [number, number];
|
|
89
87
|
}
|
|
90
88
|
/**
|
|
91
|
-
* The public stream's version. `2`
|
|
89
|
+
* The public stream's version. In `2` the stream is the watcher channel as every player
|
|
92
90
|
* (`visibility.ts`'s `EVERY_PLAYER`), so both hands are face up, and the header names the match's
|
|
93
91
|
* art. A `v:1` stream drew no hand, and is never served.
|
|
94
92
|
*/
|
|
95
93
|
export declare const PUBLIC_VERSION = 2;
|
|
96
|
-
/** Line 1 of the public stream
|
|
94
|
+
/** Line 1 of the public stream. */
|
|
97
95
|
export interface PublicHeader {
|
|
98
96
|
t: 'header';
|
|
99
97
|
v: typeof PUBLIC_VERSION;
|
|
@@ -106,7 +104,7 @@ export interface PublicHeader {
|
|
|
106
104
|
art: string[];
|
|
107
105
|
startedAt: string;
|
|
108
106
|
}
|
|
109
|
-
/** One `env` line of the public stream
|
|
107
|
+
/** One `env` line of the public stream: `env` is the watcher channel's own `ServerEnvelope`. */
|
|
110
108
|
export interface PublicEnvLine {
|
|
111
109
|
t: 'env';
|
|
112
110
|
at: number;
|
|
@@ -115,7 +113,7 @@ export interface PublicEnvLine {
|
|
|
115
113
|
/**
|
|
116
114
|
* The active seat's pointer, as `forge:presence` relayed it (`@hadoku/shared`'s `presence.ts`: it names no
|
|
117
115
|
* hidden card), so a replay draws their cursor and their drags. `playerId` is that seat's Forge player: the
|
|
118
|
-
* replay draws the seat at the bottom, from the player whose turn it is. Absent
|
|
116
|
+
* replay draws the seat at the bottom, from the player whose turn it is. Absent from an older stream.
|
|
119
117
|
* `presence` is kept without its `matchId` and with its coordinates at four places (the recorder's
|
|
120
118
|
* `recordedPresence`); a line written before that carries both, and a reader takes either.
|
|
121
119
|
*/
|
|
@@ -149,7 +147,7 @@ export interface RecordedSeat {
|
|
|
149
147
|
/** Absent when the seat had none, as on the wire. */
|
|
150
148
|
avatarId?: string;
|
|
151
149
|
/**
|
|
152
|
-
* The holder's registry userId, so the replay draws them as they are when it is watched
|
|
150
|
+
* The holder's registry userId, so the replay draws them as they are when it is watched:
|
|
153
151
|
* kept on disk, and replaced by their face and name before a replay leaves the server
|
|
154
152
|
* (`http/replays.ts`). Absent for the AI, and in a recording from before it was kept.
|
|
155
153
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* One match's two recorded files
|
|
3
|
-
* contract 1): `<matchId>.actions.jsonl.gz` and `<matchId>.public.jsonl.gz`,
|
|
2
|
+
* One match's two recorded files: `<matchId>.actions.jsonl.gz` and `<matchId>.public.jsonl.gz`,
|
|
4
3
|
* and the one gzip JSONL writer and reader every user of the recordings
|
|
5
4
|
* directory goes through (the recorder, a rebuild, the replay routes, an erase).
|
|
6
5
|
*
|
|
@@ -32,7 +31,7 @@ import { onRecordingChanged, recordingChanged } from './changes.js';
|
|
|
32
31
|
import { ACTIONS_SUFFIX, PUBLIC_SUFFIX } from './retention.js';
|
|
33
32
|
const gzip = promisify(gzipCb);
|
|
34
33
|
/**
|
|
35
|
-
* The public stream's version. `2`
|
|
34
|
+
* The public stream's version. In `2` the stream is the watcher channel as every player
|
|
36
35
|
* (`visibility.ts`'s `EVERY_PLAYER`), so both hands are face up, and the header names the match's
|
|
37
36
|
* art. A `v:1` stream drew no hand, and is never served.
|
|
38
37
|
*/
|
|
@@ -122,7 +121,7 @@ async function land(file, path, header, log, which) {
|
|
|
122
121
|
}
|
|
123
122
|
}
|
|
124
123
|
/**
|
|
125
|
-
* A match restored on a new JVM (`MatchRegistry.restore`: a lost JVM, an agreed restart, an
|
|
124
|
+
* A match restored on a new JVM (`MatchRegistry.restore`: a lost JVM, an agreed restart, an admin's
|
|
126
125
|
* restore) keeps its id, so each of its epochs finishes onto the same two files. The one already there
|
|
127
126
|
* is an earlier epoch: it moves aside to the first free `<matchId>-e<N>` before the new one is written,
|
|
128
127
|
* the latest staying under the match's own id. A recording like any other under that name — retention
|
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.264",
|
|
4
|
+
"gitHead": "150a898357756dfd5044fb375b226ad1f456d792",
|
|
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.264",
|
|
20
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.264",
|
|
21
|
+
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.297",
|
|
22
22
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.4",
|
|
23
23
|
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.158",
|
|
24
24
|
"@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.158",
|