@hadoku/game-ui 0.1.258 → 0.1.260
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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Identity, the gate and the seal are the server's own `relay-socket.ts`'s job, exactly as the
|
|
9
9
|
* play socket's own `attachPlay` — nothing here carries a credential of its own, same as
|
|
10
|
-
* `play/live/
|
|
10
|
+
* `play/live/transport.ts`'s `socketIoMatchTransport`, whose connection shape this one mirrors.
|
|
11
11
|
*
|
|
12
12
|
* Ordering and at-most-once delivery are `runtimes/relay.ts`'s `RelaySession`'s own guarantees;
|
|
13
13
|
* this file adds nothing to either — it only opens the connection, joins, rejoins on every
|
|
@@ -9,6 +9,10 @@ export declare function trackConnection(transport: Parameters<typeof watchRestar
|
|
|
9
9
|
serverUpdating: boolean;
|
|
10
10
|
/** 1 for the caller's first join, one more for each rejoin. */
|
|
11
11
|
joins: number;
|
|
12
|
+
/** The latest connect came back from a planned restart's drop (`watchRestart`'s `back`), until the next drop. */
|
|
13
|
+
backFromRestart: boolean;
|
|
14
|
+
/** Why the socket last dropped, as socket.io said it (`transport close`, `ping timeout`, …); null before any drop. */
|
|
15
|
+
dropReason: string | null;
|
|
12
16
|
/** Told after every change, the rejoin already sent. Returns the unsubscribe. */
|
|
13
17
|
subscribe(fn: () => void): () => void;
|
|
14
18
|
};
|
package/dist/track-connection.js
CHANGED
|
@@ -11,6 +11,10 @@ export function trackConnection(transport, { onRejoin } = {}) {
|
|
|
11
11
|
serverUpdating: false,
|
|
12
12
|
/** 1 for the caller's first join, one more for each rejoin. */
|
|
13
13
|
joins: 1,
|
|
14
|
+
/** The latest connect came back from a planned restart's drop (`watchRestart`'s `back`), until the next drop. */
|
|
15
|
+
backFromRestart: false,
|
|
16
|
+
/** Why the socket last dropped, as socket.io said it (`transport close`, `ping timeout`, …); null before any drop. */
|
|
17
|
+
dropReason: null,
|
|
14
18
|
/** Told after every change, the rejoin already sent. Returns the unsubscribe. */
|
|
15
19
|
subscribe(fn) {
|
|
16
20
|
listeners.add(fn);
|
|
@@ -21,6 +25,8 @@ export function trackConnection(transport, { onRejoin } = {}) {
|
|
|
21
25
|
// tells anyone; only the quiet window running out is told from here.
|
|
22
26
|
watchRestart(transport, (updating, back) => {
|
|
23
27
|
state.serverUpdating = updating;
|
|
28
|
+
if (back)
|
|
29
|
+
state.backFromRestart = true;
|
|
24
30
|
if (!state.connected && !back)
|
|
25
31
|
tell();
|
|
26
32
|
});
|
|
@@ -33,8 +39,10 @@ export function trackConnection(transport, { onRejoin } = {}) {
|
|
|
33
39
|
}
|
|
34
40
|
tell();
|
|
35
41
|
});
|
|
36
|
-
transport.on('disconnect', () => {
|
|
42
|
+
transport.on('disconnect', (reason) => {
|
|
37
43
|
state.connected = false;
|
|
44
|
+
state.backFromRestart = false;
|
|
45
|
+
state.dropReason = String(reason);
|
|
38
46
|
tell();
|
|
39
47
|
});
|
|
40
48
|
return state;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hadoku/game-ui",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"gitHead": "
|
|
3
|
+
"version": "0.1.260",
|
|
4
|
+
"gitHead": "150a898357756dfd5044fb375b226ad1f456d792",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"description": "The browser parts any hosted game shares, above ui-shell: the room shell and session, seats and looks, the room route, the front page's generic pieces (gate, polls, gallery, patch notes), the bundle slot and relay channel a game's client mounts in, settings and trim screens, the HTTP and socket helpers, and the generic components (modal, popover, avatar, action button, radio cards). Knows no game; Magic's UI (games/magic/ui) plugs in, composed by the site (apps/ui). MIT; imports only react, react-dom, socket.io-client, @wolffm/* and the platform packages.",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"react-dom": "^19.2.8"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.
|
|
57
|
-
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.
|
|
56
|
+
"@wolffm/platform-wire": "npm:@hadoku/platform-wire@0.1.264",
|
|
57
|
+
"@wolffm/ui-shell": "npm:@hadoku/ui-shell@0.1.264",
|
|
58
58
|
"@wolffm/prefs-client": "npm:@hadoku/prefs-client@^1.2.4",
|
|
59
59
|
"@wolffm/rooms-client": "npm:@hadoku/rooms-client@^0.45.158",
|
|
60
60
|
"@wolffm/rooms-protocol": "npm:@hadoku/rooms-protocol@^0.45.158",
|