@hadoku/game-server 0.1.75 → 0.1.76
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/stats/reporter.d.ts +1 -1
- package/dist/stats/reporter.js +10 -5
- package/package.json +5 -5
package/dist/stats/reporter.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export interface StatsReporter {
|
|
|
33
33
|
}
|
|
34
34
|
export declare const DEFAULT_RETRY_DELAYS_MS: readonly [2000, 10000, 60000];
|
|
35
35
|
/**
|
|
36
|
-
* Report matches to the store, or log once that it will not.
|
|
36
|
+
* Report matches to the store, or log once, on the first report, that it will not.
|
|
37
37
|
*
|
|
38
38
|
* Every attempt re-posts the same `matchId`, and the store treats a repeat as
|
|
39
39
|
* a no-op, so a retry after a response that was lost in transit cannot count a
|
package/dist/stats/reporter.js
CHANGED
|
@@ -22,7 +22,7 @@ const sleep = (ms) => new Promise((r) => {
|
|
|
22
22
|
t.unref?.();
|
|
23
23
|
});
|
|
24
24
|
/**
|
|
25
|
-
* Report matches to the store, or log once that it will not.
|
|
25
|
+
* Report matches to the store, or log once, on the first report, that it will not.
|
|
26
26
|
*
|
|
27
27
|
* Every attempt re-posts the same `matchId`, and the store treats a repeat as
|
|
28
28
|
* a no-op, so a retry after a response that was lost in transit cannot count a
|
|
@@ -34,9 +34,7 @@ export function createStatsReporter(opts) {
|
|
|
34
34
|
const delays = opts.retryDelaysMs ?? DEFAULT_RETRY_DELAYS_MS;
|
|
35
35
|
const serviceKey = opts.serviceKey ?? '';
|
|
36
36
|
const inFlight = new Set();
|
|
37
|
-
|
|
38
|
-
log({ evt: 'stats-disabled', reason: `${opts.serviceKeyEnvVar ?? 'the service key'} unset` });
|
|
39
|
-
}
|
|
37
|
+
let saidDisabled = false;
|
|
40
38
|
const send = async (report) => {
|
|
41
39
|
for (let attempt = 0;; attempt += 1) {
|
|
42
40
|
try {
|
|
@@ -69,8 +67,15 @@ export function createStatsReporter(opts) {
|
|
|
69
67
|
return {
|
|
70
68
|
enabled: serviceKey !== '',
|
|
71
69
|
report(report) {
|
|
72
|
-
if (serviceKey === '')
|
|
70
|
+
if (serviceKey === '') {
|
|
71
|
+
// Said on the first report, not at construction: the line means "a report was built
|
|
72
|
+
// and went nowhere", which a game's own tests read to tell a finished match from one
|
|
73
|
+
// that was never reported.
|
|
74
|
+
if (!saidDisabled)
|
|
75
|
+
log({ evt: 'stats-disabled', reason: `${opts.serviceKeyEnvVar ?? 'the service key'} unset` });
|
|
76
|
+
saidDisabled = true;
|
|
73
77
|
return;
|
|
78
|
+
}
|
|
74
79
|
const p = send(report).finally(() => inFlight.delete(p));
|
|
75
80
|
inFlight.add(p);
|
|
76
81
|
},
|
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.76",
|
|
4
|
+
"gitHead": "ef3e223f147c168b802dbcbf9abf82200c2e665a",
|
|
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.76",
|
|
20
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.76",
|
|
21
|
+
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.109",
|
|
22
22
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.1.31",
|
|
23
23
|
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.122",
|
|
24
24
|
"@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.122",
|