@hadoku/game-server 0.1.106 → 0.1.107
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/room/room-list.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export interface RoomBusyHook<R> {
|
|
|
37
37
|
liveMatch(room: R): boolean;
|
|
38
38
|
/** An extra reason — beyond a live match — `room` counts as busy enough to stay offered past `staleMs` (Magic: a draft under way). */
|
|
39
39
|
extraOffered(room: R): boolean;
|
|
40
|
+
/** Whether `room`'s business is over and it leaves the front page, whatever its staleness says (Magic: a tournament that finished a day ago). A live match still keeps it. */
|
|
41
|
+
retired(room: R, now: number): boolean;
|
|
40
42
|
/** The idle window `isSweepableRoom` uses when the caller gives none (Magic: a tournament's `ROOM_IDLE_MS`, else the casual one). */
|
|
41
43
|
defaultIdleMs(room: R): number;
|
|
42
44
|
/** Whether `room` is spared this sweep despite sitting past its idle window (Magic: a pod dealt within `POD_SPARED_MS`). */
|
|
@@ -52,8 +54,8 @@ export declare function sortRoomsByCreation<R extends {
|
|
|
52
54
|
/**
|
|
53
55
|
* Whether `room` belongs on the front page right now: a seeded testing room
|
|
54
56
|
* always; an empty room never (R16 — hidden the instant its last member
|
|
55
|
-
* leaves, not after `staleMs`); otherwise a live match
|
|
56
|
-
* reason, or simply not yet stale since `touchedAt` (`updatedAt`, the last
|
|
57
|
+
* leaves, not after `staleMs`); otherwise a live match; never one the hook
|
|
58
|
+
* calls retired; otherwise the hook's own extra reason, or simply not yet stale since `touchedAt` (`updatedAt`, the last
|
|
57
59
|
* poll, or the event's own start, whichever is latest).
|
|
58
60
|
*/
|
|
59
61
|
export declare function isOfferedRoom<R extends ListableRoom>(room: R, hook: RoomBusyHook<R>, now: number, staleMs: number, touchedAt: number | undefined): boolean;
|
package/dist/room/room-list.js
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
export const NO_BUSY_HOOK = {
|
|
20
20
|
liveMatch: () => false,
|
|
21
21
|
extraOffered: () => false,
|
|
22
|
+
retired: () => false,
|
|
22
23
|
defaultIdleMs: () => 8 * 60 * 60_000,
|
|
23
24
|
sparedFromSweep: () => false,
|
|
24
25
|
};
|
|
@@ -29,8 +30,8 @@ export function sortRoomsByCreation(rooms) {
|
|
|
29
30
|
/**
|
|
30
31
|
* Whether `room` belongs on the front page right now: a seeded testing room
|
|
31
32
|
* always; an empty room never (R16 — hidden the instant its last member
|
|
32
|
-
* leaves, not after `staleMs`); otherwise a live match
|
|
33
|
-
* reason, or simply not yet stale since `touchedAt` (`updatedAt`, the last
|
|
33
|
+
* leaves, not after `staleMs`); otherwise a live match; never one the hook
|
|
34
|
+
* calls retired; otherwise the hook's own extra reason, or simply not yet stale since `touchedAt` (`updatedAt`, the last
|
|
34
35
|
* poll, or the event's own start, whichever is latest).
|
|
35
36
|
*/
|
|
36
37
|
export function isOfferedRoom(room, hook, now, staleMs, touchedAt) {
|
|
@@ -40,6 +41,8 @@ export function isOfferedRoom(room, hook, now, staleMs, touchedAt) {
|
|
|
40
41
|
return false;
|
|
41
42
|
if (hook.liveMatch(room))
|
|
42
43
|
return true;
|
|
44
|
+
if (hook.retired(room, now))
|
|
45
|
+
return false;
|
|
43
46
|
if (hook.extraOffered(room))
|
|
44
47
|
return true;
|
|
45
48
|
const cutoff = now - staleMs;
|
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.107",
|
|
4
|
+
"gitHead": "37dbbaf58dbc0bbf0bf38fa438d0eee421301227",
|
|
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.107",
|
|
20
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.107",
|
|
21
|
+
"@wolffm/service-kernel": "npm:@hadoku/service-kernel@0.1.140",
|
|
22
22
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.1.32",
|
|
23
23
|
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.130",
|
|
24
24
|
"@wolffm/rooms-server": "npm:@hadoku/rooms-server@^0.45.130",
|