@hadoku/game-server 0.1.193 → 0.1.194
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.
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* `list`, `quarantine`) happen at boot and stay the base class's.
|
|
6
6
|
*
|
|
7
7
|
* `saveSync` keeps its name because the lobby calls it from every mutation and must not await; it
|
|
8
|
-
* returns once the snapshot is queued
|
|
8
|
+
* returns once the snapshot is queued, and the snapshot is serialised only when its write starts (a
|
|
9
|
+
* newer save of the room before then replaces it unserialised). A save then a remove of one room land
|
|
10
|
+
* in that order.
|
|
9
11
|
*/
|
|
10
12
|
import { FileRoomStore, type RoomSnapshot } from '@wolffm/rooms-server/store';
|
|
11
13
|
import { type SnapshotWriter } from '../persist/snapshot-writer.js';
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* `list`, `quarantine`) happen at boot and stay the base class's.
|
|
6
6
|
*
|
|
7
7
|
* `saveSync` keeps its name because the lobby calls it from every mutation and must not await; it
|
|
8
|
-
* returns once the snapshot is queued
|
|
8
|
+
* returns once the snapshot is queued, and the snapshot is serialised only when its write starts (a
|
|
9
|
+
* newer save of the room before then replaces it unserialised). A save then a remove of one room land
|
|
10
|
+
* in that order.
|
|
9
11
|
*/
|
|
10
12
|
import { join } from 'node:path';
|
|
11
13
|
import { FileRoomStore } from '@wolffm/rooms-server/store';
|
|
@@ -22,7 +24,8 @@ export class OffLoopRoomStore extends FileRoomStore {
|
|
|
22
24
|
return join(this.dir, `${Buffer.from(roomId, 'utf8').toString('base64url')}${SUFFIX}`);
|
|
23
25
|
}
|
|
24
26
|
saveSync(snapshot) {
|
|
25
|
-
|
|
27
|
+
// Serialised when its write starts: a burst of mutations to one room costs one stringify, not one each.
|
|
28
|
+
this.#writer.write(this.fileOf(snapshot.roomId), () => JSON.stringify(snapshot));
|
|
26
29
|
}
|
|
27
30
|
save(snapshot) {
|
|
28
31
|
this.saveSync(snapshot);
|
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.194",
|
|
4
|
+
"gitHead": "ebb090b33c52c01759f4b26e99a22be659f7c601",
|
|
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,9 +17,9 @@
|
|
|
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.194",
|
|
21
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.194",
|
|
22
|
+
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.227",
|
|
23
23
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.3",
|
|
24
24
|
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.150",
|
|
25
25
|
"@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.150",
|