@hadoku/game-server 0.1.240 → 0.1.241

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.js CHANGED
@@ -274,7 +274,11 @@ export function jvmHostFactory(config, options = {}) {
274
274
  matches: hosted.map((h) => recordEntry(h.entry)),
275
275
  };
276
276
  try {
277
- writeFileAtomicSync(join(jvm.dir, JVM_RECORD_FILE), `${JSON.stringify(record, null, 2)}\n`);
277
+ // Not flushed (`durable: false`): the record is read only to take back JVMs still running, and
278
+ // none outlives this machine going down. A local JVM dies with it; a claw's agent hears no hold
279
+ // from a server that crashed and fences its JVMs at `AGENT_FENCE_MS`. A server process that
280
+ // exits, however it exits, leaves the page cache, so the next one reads the newest record.
281
+ writeFileAtomicSync(join(jvm.dir, JVM_RECORD_FILE), `${JSON.stringify(record, null, 2)}\n`, { durable: false });
278
282
  for (const h of hosted)
279
283
  h.changed = false;
280
284
  }
@@ -548,7 +548,8 @@ class LocalJvm {
548
548
  this.pid = engineProcess.pid;
549
549
  live.add(this);
550
550
  log({ evt: 'jvm-spawned', id: hostId, pid: this.pid, run });
551
- writeFileAtomicSync(join(run, LAUNCH_RECORD_FILE), `${JSON.stringify({ hostId, pid: this.pid, startedAt: new Date().toISOString() })}\n`);
551
+ // Not flushed: it names a process that dies with this machine (`writeFileAtomicSync`'s `durable`).
552
+ writeFileAtomicSync(join(run, LAUNCH_RECORD_FILE), `${JSON.stringify({ hostId, pid: this.pid, startedAt: new Date().toISOString() })}\n`, { durable: false });
552
553
  this.read();
553
554
  engineProcess.onError((err) => this.finish(`the JVM could not be started: ${err.message}`, { code: null, signal: null }));
554
555
  engineProcess.onExit((code, signal) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hadoku/game-server",
3
- "version": "0.1.240",
4
- "gitHead": "690adad9f5a44802a088418b17b8c1767f2b9510",
3
+ "version": "0.1.241",
4
+ "gitHead": "48e65ea0f104c1a346b58d682865a53a518ac627",
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.240",
20
- "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.240",
21
- "@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.273",
19
+ "@wolffm/host-wire": "npm:@hadoku/host-wire@0.1.241",
20
+ "@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.241",
21
+ "@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.274",
22
22
  "@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.4",
23
23
  "@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.153",
24
24
  "@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.153",