@rydr/game-sdk 8.9.0 → 8.11.0
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/client/PlatformClient.d.ts +40 -0
- package/dist/client/PlatformClient.d.ts.map +1 -1
- package/dist/client/PlatformClient.js +36 -0
- package/dist/client/PlatformClient.js.map +1 -1
- package/dist/host/PlatformHost.d.ts +35 -0
- package/dist/host/PlatformHost.d.ts.map +1 -1
- package/dist/host/PlatformHost.js +18 -0
- package/dist/host/PlatformHost.js.map +1 -1
- package/dist/overlay/index.d.ts +71 -0
- package/dist/overlay/index.d.ts.map +1 -0
- package/dist/overlay/index.js +242 -0
- package/dist/overlay/index.js.map +1 -0
- package/dist/protocol/guards.d.ts.map +1 -1
- package/dist/protocol/guards.js +2 -0
- package/dist/protocol/guards.js.map +1 -1
- package/dist/protocol/identity.d.ts +63 -0
- package/dist/protocol/identity.d.ts.map +1 -1
- package/dist/protocol/identity.js +40 -1
- package/dist/protocol/identity.js.map +1 -1
- package/dist/protocol/index.d.ts +1 -0
- package/dist/protocol/index.d.ts.map +1 -1
- package/dist/protocol/index.js +1 -0
- package/dist/protocol/index.js.map +1 -1
- package/dist/protocol/messages.d.ts +73 -2
- package/dist/protocol/messages.d.ts.map +1 -1
- package/dist/protocol/overlay.d.ts +70 -0
- package/dist/protocol/overlay.d.ts.map +1 -0
- package/dist/protocol/overlay.js +21 -0
- package/dist/protocol/overlay.js.map +1 -0
- package/dist/protocol/version.d.ts +2 -2
- package/dist/protocol/version.d.ts.map +1 -1
- package/dist/protocol/version.js +22 -2
- package/dist/protocol/version.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overlay boxes — the DOM half of overlay mode.
|
|
3
|
+
*
|
|
4
|
+
* `session.overlay` is transport: it moves box declarations out and host answers in, and draws
|
|
5
|
+
* nothing. This module is what actually puts boxes on screen, measures them, drags them and keeps
|
|
6
|
+
* the host told where they are. Same division as `mountOptionMenu` in `@rydr/game-sdk/ui`, and it
|
|
7
|
+
* is deliberate — a game with its own renderer can use the transport directly and ignore this.
|
|
8
|
+
*
|
|
9
|
+
* It lives behind the `./overlay` subpath so the main entry stays free of DOM: a headless consumer
|
|
10
|
+
* (a test, a server-side tool) can import the protocol types without pulling a document in.
|
|
11
|
+
*
|
|
12
|
+
* WHAT THE GAME STILL OWNS: the content. Each box hands back a `body` element and this module never
|
|
13
|
+
* writes to it. That is the whole point of overlay mode — only the game knows what a workout target
|
|
14
|
+
* or a compliance band should look like.
|
|
15
|
+
*
|
|
16
|
+
* COORDINATES. A box's stored position is a FRACTION of the guest viewport, so it survives a
|
|
17
|
+
* resolution change; its size is CSS pixels, because content is laid out in pixels. Rectangles go
|
|
18
|
+
* out in CSS pixels relative to that same viewport, which is what the host's cursor hit test needs.
|
|
19
|
+
* That mapping assumes the guest fills the host window — true when the shell sizes the game frame
|
|
20
|
+
* to the viewport, and the shell is expected to verify it before entering overlay mode rather than
|
|
21
|
+
* shipping boxes that hit-test somewhere else.
|
|
22
|
+
*/
|
|
23
|
+
import type { OverlayBoxPlacement, OverlayBoxRect, OverlayBoxSpec } from "../protocol/overlay.js";
|
|
24
|
+
/**
|
|
25
|
+
* The slice of the session this module needs.
|
|
26
|
+
*
|
|
27
|
+
* A structural type, not `PlatformSession`, for the same reason `OptionMenuSession` is: a showcase
|
|
28
|
+
* page or a test can pass a hand-written stub and see real boxes with no platform in the loop.
|
|
29
|
+
*/
|
|
30
|
+
export interface OverlaySession {
|
|
31
|
+
overlay: {
|
|
32
|
+
readonly supported: boolean;
|
|
33
|
+
readonly active: boolean;
|
|
34
|
+
defineBoxes(boxes: OverlayBoxSpec[]): void;
|
|
35
|
+
publishRects(rects: OverlayBoxRect[]): void;
|
|
36
|
+
setDragging(dragging: boolean): void;
|
|
37
|
+
moveBox(id: string, x: number, y: number): void;
|
|
38
|
+
onStateChange(cb: (active: boolean) => void): () => void;
|
|
39
|
+
onLayout(cb: (placements: Record<string, OverlayBoxPlacement>) => void): () => void;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** One live box. `body` is yours to render into; everything else is managed here. */
|
|
43
|
+
export interface OverlayBoxHandle {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
/** Render the box's content in here. This module never touches its children. */
|
|
46
|
+
readonly body: HTMLElement;
|
|
47
|
+
/** Hide or show this box without redeclaring the set. */
|
|
48
|
+
setVisible(visible: boolean): void;
|
|
49
|
+
readonly visible: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface OverlayBoxesHandle {
|
|
52
|
+
readonly boxes: readonly OverlayBoxHandle[];
|
|
53
|
+
get(id: string): OverlayBoxHandle | undefined;
|
|
54
|
+
/** Replace the whole set. Boxes whose id survives keep their element, and their content. */
|
|
55
|
+
define(specs: OverlayBoxSpec[]): void;
|
|
56
|
+
/** Remove the layer and unsubscribe. Safe to call twice. */
|
|
57
|
+
dispose(): void;
|
|
58
|
+
}
|
|
59
|
+
export interface OverlayBoxesOptions {
|
|
60
|
+
/** Where to mount the layer. Default `document.body`. */
|
|
61
|
+
host?: HTMLElement;
|
|
62
|
+
/**
|
|
63
|
+
* Let the rider drag a box to reposition it. Default true.
|
|
64
|
+
*
|
|
65
|
+
* Pass false for a game that positions boxes itself; the host still hit-tests them, so they
|
|
66
|
+
* remain clickable, they just don't move.
|
|
67
|
+
*/
|
|
68
|
+
draggable?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export declare function mountOverlayBoxes(session: OverlaySession, specs: OverlayBoxSpec[], options?: OverlayBoxesOptions): OverlayBoxesHandle;
|
|
71
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/overlay/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,cAA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ED,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAoCD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,cAAc,EAAE,EACvB,OAAO,GAAE,mBAAwB,GAChC,kBAAkB,CA0OpB"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
const STYLE_ID = "rydr-overlay-css";
|
|
2
|
+
/** Self-contained: this module does not pull in the `./ui` stylesheet, so it stays standalone. */
|
|
3
|
+
function injectCss() {
|
|
4
|
+
if (typeof document === "undefined" || document.getElementById(STYLE_ID))
|
|
5
|
+
return;
|
|
6
|
+
const style = document.createElement("style");
|
|
7
|
+
style.id = STYLE_ID;
|
|
8
|
+
style.textContent = `
|
|
9
|
+
.rydr-overlay-layer{position:fixed;inset:0;pointer-events:none;z-index:60}
|
|
10
|
+
.rydr-overlay-layer[hidden]{display:none}
|
|
11
|
+
/* Only the boxes take the pointer. The layer covers everything, so making IT interactive would
|
|
12
|
+
swallow every click the host meant to let through. */
|
|
13
|
+
.rydr-overlay-box{position:absolute;pointer-events:auto;box-sizing:border-box;
|
|
14
|
+
display:flex;align-items:stretch;justify-content:stretch}
|
|
15
|
+
.rydr-overlay-box[hidden]{display:none}
|
|
16
|
+
.rydr-overlay-box[data-draggable="true"]{cursor:grab}
|
|
17
|
+
.rydr-overlay-box[data-dragging="true"]{cursor:grabbing;user-select:none}
|
|
18
|
+
.rydr-overlay-body{flex:1;min-width:0;min-height:0}
|
|
19
|
+
`;
|
|
20
|
+
document.head.appendChild(style);
|
|
21
|
+
}
|
|
22
|
+
export function mountOverlayBoxes(session, specs, options = {}) {
|
|
23
|
+
injectCss();
|
|
24
|
+
const host = options.host ?? document.body;
|
|
25
|
+
const draggable = options.draggable !== false;
|
|
26
|
+
const layer = document.createElement("div");
|
|
27
|
+
layer.className = "rydr-overlay-layer";
|
|
28
|
+
// Hidden until the host says overlay mode is on, so declaring boxes early cannot leave them
|
|
29
|
+
// floating over the game's ordinary screen.
|
|
30
|
+
layer.hidden = !session.overlay.active;
|
|
31
|
+
host.appendChild(layer);
|
|
32
|
+
const boxes = new Map();
|
|
33
|
+
/** The rider's stored overrides, remembered so a later `define()` still honours them. */
|
|
34
|
+
let placements = {};
|
|
35
|
+
let disposed = false;
|
|
36
|
+
let rectFrame = 0;
|
|
37
|
+
/**
|
|
38
|
+
* The box a fraction is a fraction OF.
|
|
39
|
+
*
|
|
40
|
+
* The LAYER's own size, not the window's. In a game they are the same thing — the layer is
|
|
41
|
+
* `position: fixed; inset: 0` — but a showcase page that mounts the layer inside a panel would
|
|
42
|
+
* otherwise place boxes by the window and scatter them outside it. Measuring what we actually
|
|
43
|
+
* position within is both correct there and identical here.
|
|
44
|
+
*
|
|
45
|
+
* Published rectangles are unaffected: `getBoundingClientRect` is already viewport-relative,
|
|
46
|
+
* which is what the host's cursor hit test needs.
|
|
47
|
+
*/
|
|
48
|
+
function viewport() {
|
|
49
|
+
const r = layer.getBoundingClientRect();
|
|
50
|
+
return { w: r.width || window.innerWidth || 1, h: r.height || window.innerHeight || 1 };
|
|
51
|
+
}
|
|
52
|
+
function place(box) {
|
|
53
|
+
const { w: vw, h: vh } = viewport();
|
|
54
|
+
box.el.style.left = `${Math.round(box.x * vw)}px`;
|
|
55
|
+
box.el.style.top = `${Math.round(box.y * vh)}px`;
|
|
56
|
+
box.el.style.width = `${box.w}px`;
|
|
57
|
+
box.el.style.height = `${box.h}px`;
|
|
58
|
+
box.el.hidden = !box.visible;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Tell the host where the boxes are — coalesced to one report per frame.
|
|
62
|
+
*
|
|
63
|
+
* Every move, resize and visibility change would otherwise post its own message, and a drag
|
|
64
|
+
* fires per pointer event.
|
|
65
|
+
*/
|
|
66
|
+
function publish() {
|
|
67
|
+
if (disposed || rectFrame)
|
|
68
|
+
return;
|
|
69
|
+
rectFrame = requestAnimationFrame(() => {
|
|
70
|
+
rectFrame = 0;
|
|
71
|
+
if (disposed)
|
|
72
|
+
return;
|
|
73
|
+
const rects = [];
|
|
74
|
+
for (const box of boxes.values()) {
|
|
75
|
+
// An invisible box must not be grabbable: there is nothing on screen to aim at, and the
|
|
76
|
+
// host would hand over the mouse for a click the rider aimed at whatever is behind.
|
|
77
|
+
if (!box.visible)
|
|
78
|
+
continue;
|
|
79
|
+
const r = box.el.getBoundingClientRect();
|
|
80
|
+
rects.push({ id: box.spec.id, x: r.left, y: r.top, w: r.width, h: r.height });
|
|
81
|
+
}
|
|
82
|
+
session.overlay.publishRects(rects);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function effective(spec) {
|
|
86
|
+
return placements[spec.id] ?? {};
|
|
87
|
+
}
|
|
88
|
+
function applyPlacement(box) {
|
|
89
|
+
const p = effective(box.spec);
|
|
90
|
+
box.x = p.x ?? box.spec.x;
|
|
91
|
+
box.y = p.y ?? box.spec.y;
|
|
92
|
+
box.w = p.w ?? box.spec.width;
|
|
93
|
+
box.h = p.h ?? box.spec.height;
|
|
94
|
+
// The GAME's visibility wins when it says hidden: a rider override may only reveal a box the
|
|
95
|
+
// game is willing to show, never force one it has deliberately taken away.
|
|
96
|
+
box.visible = box.spec.visible && (p.visible ?? true);
|
|
97
|
+
place(box);
|
|
98
|
+
}
|
|
99
|
+
function attachDrag(box) {
|
|
100
|
+
if (!draggable)
|
|
101
|
+
return;
|
|
102
|
+
box.el.dataset["draggable"] = "true";
|
|
103
|
+
box.el.addEventListener("pointerdown", (event) => {
|
|
104
|
+
if (event.button !== 0)
|
|
105
|
+
return;
|
|
106
|
+
const start = box.el.getBoundingClientRect();
|
|
107
|
+
const grabX = event.clientX - start.left;
|
|
108
|
+
const grabY = event.clientY - start.top;
|
|
109
|
+
box.el.dataset["dragging"] = "true";
|
|
110
|
+
box.el.setPointerCapture(event.pointerId);
|
|
111
|
+
// The host holds the mouse for the whole gesture; without this it would take it back the
|
|
112
|
+
// moment the cursor left the box and the drag would end mid-flight.
|
|
113
|
+
session.overlay.setDragging(true);
|
|
114
|
+
event.preventDefault();
|
|
115
|
+
const move = (e) => {
|
|
116
|
+
const { w: vw, h: vh } = viewport();
|
|
117
|
+
// Clamped so a box cannot be dropped off-screen: there is no window frame to drag it back
|
|
118
|
+
// by, and the only recovery would be resetting the layout.
|
|
119
|
+
const left = Math.min(Math.max(e.clientX - grabX, 0), Math.max(vw - box.w, 0));
|
|
120
|
+
const top = Math.min(Math.max(e.clientY - grabY, 0), Math.max(vh - box.h, 0));
|
|
121
|
+
box.x = left / vw;
|
|
122
|
+
box.y = top / vh;
|
|
123
|
+
place(box);
|
|
124
|
+
publish();
|
|
125
|
+
};
|
|
126
|
+
const end = () => {
|
|
127
|
+
box.el.removeEventListener("pointermove", move);
|
|
128
|
+
box.el.removeEventListener("pointerup", end);
|
|
129
|
+
box.el.removeEventListener("pointercancel", end);
|
|
130
|
+
delete box.el.dataset["dragging"];
|
|
131
|
+
session.overlay.setDragging(false);
|
|
132
|
+
// Remembered locally as well as reported, so a later `define()` doesn't snap the box back
|
|
133
|
+
// to the game's default while the host's echo is still in flight.
|
|
134
|
+
placements = { ...placements, [box.spec.id]: { ...placements[box.spec.id], x: box.x, y: box.y } };
|
|
135
|
+
session.overlay.moveBox(box.spec.id, box.x, box.y);
|
|
136
|
+
publish();
|
|
137
|
+
};
|
|
138
|
+
box.el.addEventListener("pointermove", move);
|
|
139
|
+
box.el.addEventListener("pointerup", end);
|
|
140
|
+
box.el.addEventListener("pointercancel", end);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function create(spec) {
|
|
144
|
+
const el = document.createElement("div");
|
|
145
|
+
el.className = "rydr-overlay-box";
|
|
146
|
+
el.dataset["boxId"] = spec.id;
|
|
147
|
+
const body = document.createElement("div");
|
|
148
|
+
body.className = "rydr-overlay-body";
|
|
149
|
+
el.appendChild(body);
|
|
150
|
+
layer.appendChild(el);
|
|
151
|
+
const box = { spec, el, body, x: spec.x, y: spec.y, w: spec.width, h: spec.height, visible: spec.visible };
|
|
152
|
+
applyPlacement(box);
|
|
153
|
+
attachDrag(box);
|
|
154
|
+
return box;
|
|
155
|
+
}
|
|
156
|
+
function define(next) {
|
|
157
|
+
if (disposed)
|
|
158
|
+
return;
|
|
159
|
+
const seen = new Set();
|
|
160
|
+
for (const spec of next) {
|
|
161
|
+
seen.add(spec.id);
|
|
162
|
+
const existing = boxes.get(spec.id);
|
|
163
|
+
if (existing) {
|
|
164
|
+
// Reuse the element so the game's content survives a redeclaration — rebuilding would
|
|
165
|
+
// throw away whatever it had rendered and flicker on every set change.
|
|
166
|
+
existing.spec = spec;
|
|
167
|
+
applyPlacement(existing);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
boxes.set(spec.id, create(spec));
|
|
171
|
+
}
|
|
172
|
+
for (const [id, box] of [...boxes]) {
|
|
173
|
+
if (seen.has(id))
|
|
174
|
+
continue;
|
|
175
|
+
box.el.remove();
|
|
176
|
+
boxes.delete(id);
|
|
177
|
+
}
|
|
178
|
+
session.overlay.defineBoxes(next);
|
|
179
|
+
publish();
|
|
180
|
+
}
|
|
181
|
+
const offState = session.overlay.onStateChange((active) => {
|
|
182
|
+
layer.hidden = !active;
|
|
183
|
+
// Republish on entering: rects measured while hidden are all zero, and the host would have
|
|
184
|
+
// nothing to hit-test against.
|
|
185
|
+
publish();
|
|
186
|
+
});
|
|
187
|
+
const offLayout = session.overlay.onLayout((next) => {
|
|
188
|
+
placements = next ?? {};
|
|
189
|
+
for (const box of boxes.values())
|
|
190
|
+
applyPlacement(box);
|
|
191
|
+
publish();
|
|
192
|
+
});
|
|
193
|
+
// A resolution or window change moves every box, because positions are fractions.
|
|
194
|
+
const onResize = () => {
|
|
195
|
+
for (const box of boxes.values())
|
|
196
|
+
place(box);
|
|
197
|
+
publish();
|
|
198
|
+
};
|
|
199
|
+
window.addEventListener("resize", onResize);
|
|
200
|
+
define(specs);
|
|
201
|
+
return {
|
|
202
|
+
get boxes() {
|
|
203
|
+
return [...boxes.values()].map(toHandle);
|
|
204
|
+
},
|
|
205
|
+
get: (id) => {
|
|
206
|
+
const box = boxes.get(id);
|
|
207
|
+
return box ? toHandle(box) : undefined;
|
|
208
|
+
},
|
|
209
|
+
define,
|
|
210
|
+
dispose: () => {
|
|
211
|
+
if (disposed)
|
|
212
|
+
return;
|
|
213
|
+
disposed = true;
|
|
214
|
+
if (rectFrame)
|
|
215
|
+
cancelAnimationFrame(rectFrame);
|
|
216
|
+
offState();
|
|
217
|
+
offLayout();
|
|
218
|
+
window.removeEventListener("resize", onResize);
|
|
219
|
+
layer.remove();
|
|
220
|
+
boxes.clear();
|
|
221
|
+
// Tell the host the boxes are gone, or it would keep hit-testing rectangles that are no
|
|
222
|
+
// longer on screen and hand the mouse to empty space.
|
|
223
|
+
session.overlay.publishRects([]);
|
|
224
|
+
session.overlay.defineBoxes([]);
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
function toHandle(box) {
|
|
228
|
+
return {
|
|
229
|
+
id: box.spec.id,
|
|
230
|
+
body: box.body,
|
|
231
|
+
get visible() {
|
|
232
|
+
return box.visible;
|
|
233
|
+
},
|
|
234
|
+
setVisible: (visible) => {
|
|
235
|
+
box.visible = visible && box.spec.visible;
|
|
236
|
+
place(box);
|
|
237
|
+
publish();
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/overlay/index.ts"],"names":[],"mappings":"AA0EA,MAAM,QAAQ,GAAG,kBAAkB,CAAC;AAEpC,kGAAkG;AAClG,SAAS,SAAS;IAChB,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC;QAAE,OAAO;IACjF,MAAM,K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ts","sourceRoot":"","sources":["../../src/protocol/guards.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/protocol/guards.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,eAAe,CAAC;AA0DvB,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,WAAW,CAI1D;AAED,0FAA0F;AAC1F,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,qBAAqB,CAE9E;AAED,8FAA8F;AAC9F,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,qBAAqB,CAE9E"}
|
package/dist/protocol/guards.js
CHANGED
|
@@ -23,6 +23,8 @@ const PLATFORM_TO_GAME = {
|
|
|
23
23
|
"rydr/audio.setMaster": true,
|
|
24
24
|
"rydr/identity.update": true,
|
|
25
25
|
"rydr/trainer.status": true,
|
|
26
|
+
"rydr/overlay.state": true,
|
|
27
|
+
"rydr/overlay.layout": true,
|
|
26
28
|
"rydr/lifecycle.pause": true,
|
|
27
29
|
"rydr/lifecycle.resume": true,
|
|
28
30
|
"rydr/ping": true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guards.js","sourceRoot":"","sources":["../../src/protocol/guards.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;GAUG;AACH,MAAM,gBAAgB,GAAgD;IACpE,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;IACrB,iBAAiB,EAAE,IAAI;IACvB,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,IAAI;IACrB,qBAAqB,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. This is the privacy
|
|
7
7
|
* boundary that makes third-party games safe.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* What CONTENT this rider may see, as a ladder: `free` < `beta` < `all_access`, each rung
|
|
11
|
+
* containing the one below it.
|
|
12
|
+
*
|
|
13
|
+
* | Tier | The rider gets |
|
|
14
|
+
* |---|---|
|
|
15
|
+
* | `free` | the free experiences only |
|
|
16
|
+
* | `beta` | the free ones plus early access |
|
|
17
|
+
* | `all_access` | everything, including unpublished content |
|
|
18
|
+
*
|
|
19
|
+
* ## The platform states the fact, the game applies the policy
|
|
20
|
+
*
|
|
21
|
+
* Which of YOUR experiences are free is yours to decide, not the platform's: it knows nothing
|
|
22
|
+
* about your tracks, songs or levels, and a list of them kept platform-side would drift the first
|
|
23
|
+
* time someone shipped content without updating it. So the host says which tier the rider is on and
|
|
24
|
+
* your game decides what that unlocks. Same division as the FTP difficulty ladder: the platform
|
|
25
|
+
* hands over a calibrated fact, the game decides what to do with it.
|
|
26
|
+
*
|
|
27
|
+
* ## Fewer values than the platform has
|
|
28
|
+
*
|
|
29
|
+
* The platform also holds buckets meaning "cannot play at all" (waiting for a beta place, played at
|
|
30
|
+
* an event, access ended). None of them can appear here, because a game only ever runs for a rider
|
|
31
|
+
* who is already playing. Do not add branches for states that cannot arrive.
|
|
32
|
+
*
|
|
33
|
+
* ## Never compare it directly
|
|
34
|
+
*
|
|
35
|
+
* Use {@link tierAtLeast}. A bare `tier === "beta"` excludes `all_access` riders from content they
|
|
36
|
+
* are entitled to, silently, and the day a tier is inserted into the middle of the ladder every
|
|
37
|
+
* such comparison is wrong at once.
|
|
38
|
+
*/
|
|
39
|
+
export type AccessTier = "free" | "beta" | "all_access";
|
|
40
|
+
/**
|
|
41
|
+
* What an ABSENT tier means, and why it is not the lowest one.
|
|
42
|
+
*
|
|
43
|
+
* The field is missing whenever an older host meets a newer game (the host simply does not send
|
|
44
|
+
* it). Reading that as `free` would strip content from fully entitled riders during any version
|
|
45
|
+
* skew, which is a worse failure than briefly showing someone one track too many. So absence means
|
|
46
|
+
* today's behaviour, which is `beta`.
|
|
47
|
+
*
|
|
48
|
+
* A compatibility default, not a policy: a host that HAS tiers always sends one.
|
|
49
|
+
*/
|
|
50
|
+
export declare const DEFAULT_ACCESS_TIER: AccessTier;
|
|
51
|
+
/**
|
|
52
|
+
* Is this rider on `min` or better? The one way to read {@link AccessTier}.
|
|
53
|
+
*
|
|
54
|
+
* ```ts
|
|
55
|
+
* if (tierAtLeast(identity.accessTier, "beta")) showEarlyAccessTracks();
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* An absent tier counts as {@link DEFAULT_ACCESS_TIER}, and an unrecognised one (a host newer than
|
|
59
|
+
* this SDK, sending a tier that did not exist when you built) counts the same way rather than
|
|
60
|
+
* throwing: a game mid-session should not crash because the ladder grew.
|
|
61
|
+
*/
|
|
62
|
+
export declare function tierAtLeast(tier: AccessTier | undefined, min: AccessTier): boolean;
|
|
9
63
|
export interface ScopedIdentity {
|
|
10
64
|
/** Stable, opaque per-player id. Safe to use as a key; reveals no PII. */
|
|
11
65
|
playerId: string;
|
|
@@ -24,5 +78,14 @@ export interface ScopedIdentity {
|
|
|
24
78
|
* enforces auth via RLS on the admin role.
|
|
25
79
|
*/
|
|
26
80
|
isAdmin?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* What content this rider is entitled to (see {@link AccessTier}). Read it with
|
|
83
|
+
* {@link tierAtLeast}, never by comparing it.
|
|
84
|
+
*
|
|
85
|
+
* A UI hint, exactly like {@link isAdmin}: it tells your game what to OFFER. Nothing stops a
|
|
86
|
+
* modified guest from ignoring it, so the day real money hangs on a tier the enforcement has to
|
|
87
|
+
* be server-side as well. Absent means {@link DEFAULT_ACCESS_TIER}.
|
|
88
|
+
*/
|
|
89
|
+
accessTier?: AccessTier;
|
|
27
90
|
}
|
|
28
91
|
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/protocol/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/protocol/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;AAExD;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,EAAE,UAAmB,CAAC;AAStD;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAGlF;AAED,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB"}
|
|
@@ -1,2 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The scoped identity a game receives — deliberately NOT the full player profile.
|
|
3
|
+
*
|
|
4
|
+
* The platform holds PII (real name, gender, year of birth, exact weight). A
|
|
5
|
+
* game only ever receives this redacted view: a stable opaque id, a display
|
|
6
|
+
* name, and the physics metrics it explicitly requested. This is the privacy
|
|
7
|
+
* boundary that makes third-party games safe.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* What an ABSENT tier means, and why it is not the lowest one.
|
|
11
|
+
*
|
|
12
|
+
* The field is missing whenever an older host meets a newer game (the host simply does not send
|
|
13
|
+
* it). Reading that as `free` would strip content from fully entitled riders during any version
|
|
14
|
+
* skew, which is a worse failure than briefly showing someone one track too many. So absence means
|
|
15
|
+
* today's behaviour, which is `beta`.
|
|
16
|
+
*
|
|
17
|
+
* A compatibility default, not a policy: a host that HAS tiers always sends one.
|
|
18
|
+
*/
|
|
19
|
+
export const DEFAULT_ACCESS_TIER = "beta";
|
|
20
|
+
/** Position on the ladder. Private on purpose: ask {@link tierAtLeast}, never a number. */
|
|
21
|
+
const TIER_RANK = {
|
|
22
|
+
free: 0,
|
|
23
|
+
beta: 1,
|
|
24
|
+
all_access: 2,
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Is this rider on `min` or better? The one way to read {@link AccessTier}.
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* if (tierAtLeast(identity.accessTier, "beta")) showEarlyAccessTracks();
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* An absent tier counts as {@link DEFAULT_ACCESS_TIER}, and an unrecognised one (a host newer than
|
|
34
|
+
* this SDK, sending a tier that did not exist when you built) counts the same way rather than
|
|
35
|
+
* throwing: a game mid-session should not crash because the ladder grew.
|
|
36
|
+
*/
|
|
37
|
+
export function tierAtLeast(tier, min) {
|
|
38
|
+
const have = TIER_RANK[tier] ?? TIER_RANK[DEFAULT_ACCESS_TIER];
|
|
39
|
+
return have >= TIER_RANK[min];
|
|
40
|
+
}
|
|
2
41
|
//# sourceMappingURL=identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/protocol/identity.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/protocol/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAkCH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAe,MAAM,CAAC;AAEtD,2FAA2F;AAC3F,MAAM,SAAS,GAA+B;IAC5C,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,UAAU,EAAE,CAAC;CACd,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CAAC,IAA4B,EAAE,GAAe;IACvE,MAAM,IAAI,GAAG,SAAS,CAAC,IAAkB,CAAC,IAAI,SAAS,CAAC,mBAAmB,CAAC,CAAC;IAC7E,OAAO,IAAI,IAAI,SAAS,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/protocol/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
package/dist/protocol/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/protocol/index.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
@@ -16,6 +16,7 @@ import type { ButtonName, ButtonEdge, AxisName } from "./buttons.js";
|
|
|
16
16
|
import type { GlyphSet } from "./glyphs.js";
|
|
17
17
|
import type { HapticEffect } from "./haptics.js";
|
|
18
18
|
import type { BoardDefinition, BoardEntry, ScoreSubmission, SubmitScoreResult, AdminSeedEntry, LeaderboardPage } from "./boards.js";
|
|
19
|
+
import type { OverlayBoxPlacement, OverlayBoxRect, OverlayBoxSpec } from "./overlay.js";
|
|
19
20
|
import type { GameDataScope, GameDoc } from "./gamedata.js";
|
|
20
21
|
import type { CoreWorld } from "./worlds.js";
|
|
21
22
|
import type { CatalogCharacter, CharacterRig } from "./characters.js";
|
|
@@ -69,6 +70,44 @@ export interface TrainerSetErgModeMessage extends RydrTagged {
|
|
|
69
70
|
type: "rydr/trainer.setErgMode";
|
|
70
71
|
enabled: boolean;
|
|
71
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Ask to enter or leave overlay mode.
|
|
75
|
+
*
|
|
76
|
+
* A request, not a statement: the host answers with {@link OverlayStateMessage}, and may also send
|
|
77
|
+
* that unprompted when the RIDER leaves by some route of its own (a tray item, a global shortcut).
|
|
78
|
+
* Never assume this took effect.
|
|
79
|
+
*/
|
|
80
|
+
export interface OverlaySetModeMessage extends RydrTagged {
|
|
81
|
+
type: "rydr/overlay.setMode";
|
|
82
|
+
enabled: boolean;
|
|
83
|
+
}
|
|
84
|
+
/** Declare the game's box set, replacing any previous one. */
|
|
85
|
+
export interface OverlayDefineBoxesMessage extends RydrTagged {
|
|
86
|
+
type: "rydr/overlay.defineBoxes";
|
|
87
|
+
boxes: OverlayBoxSpec[];
|
|
88
|
+
}
|
|
89
|
+
/** Publish where the boxes now are, so the host can hit-test the cursor against them. */
|
|
90
|
+
export interface OverlayRectsMessage extends RydrTagged {
|
|
91
|
+
type: "rydr/overlay.rects";
|
|
92
|
+
rects: OverlayBoxRect[];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A box drag started or ended.
|
|
96
|
+
*
|
|
97
|
+
* The host must keep giving the game the mouse for the whole drag, or the box would be dropped the
|
|
98
|
+
* instant the cursor outran it.
|
|
99
|
+
*/
|
|
100
|
+
export interface OverlayDraggingMessage extends RydrTagged {
|
|
101
|
+
type: "rydr/overlay.dragging";
|
|
102
|
+
dragging: boolean;
|
|
103
|
+
}
|
|
104
|
+
/** A box was dropped. `x`/`y` are fractions of the usable screen area, for the host to remember. */
|
|
105
|
+
export interface OverlayMoveBoxMessage extends RydrTagged {
|
|
106
|
+
type: "rydr/overlay.moveBox";
|
|
107
|
+
id: string;
|
|
108
|
+
x: number;
|
|
109
|
+
y: number;
|
|
110
|
+
}
|
|
72
111
|
/**
|
|
73
112
|
* Request the rate at which the shell streams hardware to this game. `hz` is a ceiling, never an
|
|
74
113
|
* upsampler: the shell averages the trainer's faster native samples down to `hz` (anti-aliased —
|
|
@@ -377,7 +416,7 @@ export interface RoomScheduleEventMessage extends RydrTagged {
|
|
|
377
416
|
payload?: unknown;
|
|
378
417
|
at?: number;
|
|
379
418
|
}
|
|
380
|
-
export type GameToPlatformMessage = HelloMessage | ReadyMessage | LoadProgressMessage | PongMessage | TrainerSetSimulationMessage | TrainerSetTargetPowerMessage | TrainerSetErgModeMessage | HwSetRateMessage | RouteChangedMessage | SetPowerBarMessage | SetActivityMessage | ExitRequestMessage | RequestHardwareModalMessage | GameErrorMessage | LeaderboardQueryMessage | LeaderboardRankQueryMessage | AdminBoardsMessage | RunSaveMessage | RunStartMessage | HapticsVibrateMessage | TrainerAdjustResistanceMessage | RiderAdjustFtpMessage | MenuToggleMessage | GameDataGetMessage | GameDataListMessage | GameDataSaveMessage | GameDataDeleteMessage | AssetUploadUrlMessage | VoiceoverGenerateMessage | MediaUploadUrlMessage | MediaSavedMessage | ReplaySaveMessage | ReplayGetMessage | RunGetMessage | WorldListMessage | WorldGetMessage | CharacterListMessage | CharacterGetMessage | RigGetMessage | RoomJoinMessage | RoomLeaveMessage | RoomSendMessage | RoomSetStateMessage | RoomScheduleEventMessage;
|
|
419
|
+
export type GameToPlatformMessage = HelloMessage | ReadyMessage | LoadProgressMessage | PongMessage | TrainerSetSimulationMessage | TrainerSetTargetPowerMessage | TrainerSetErgModeMessage | OverlaySetModeMessage | OverlayDefineBoxesMessage | OverlayRectsMessage | OverlayDraggingMessage | OverlayMoveBoxMessage | HwSetRateMessage | RouteChangedMessage | SetPowerBarMessage | SetActivityMessage | ExitRequestMessage | RequestHardwareModalMessage | GameErrorMessage | LeaderboardQueryMessage | LeaderboardRankQueryMessage | AdminBoardsMessage | RunSaveMessage | RunStartMessage | HapticsVibrateMessage | TrainerAdjustResistanceMessage | RiderAdjustFtpMessage | MenuToggleMessage | GameDataGetMessage | GameDataListMessage | GameDataSaveMessage | GameDataDeleteMessage | AssetUploadUrlMessage | VoiceoverGenerateMessage | MediaUploadUrlMessage | MediaSavedMessage | ReplaySaveMessage | ReplayGetMessage | RunGetMessage | WorldListMessage | WorldGetMessage | CharacterListMessage | CharacterGetMessage | RigGetMessage | RoomJoinMessage | RoomLeaveMessage | RoomSendMessage | RoomSetStateMessage | RoomScheduleEventMessage;
|
|
381
420
|
/** Accepts the handshake: grants capabilities and hands over the scoped identity. */
|
|
382
421
|
export interface WelcomeMessage extends RydrTagged {
|
|
383
422
|
type: "rydr/welcome";
|
|
@@ -400,6 +439,17 @@ export interface WelcomeMessage extends RydrTagged {
|
|
|
400
439
|
* right glyphs instead of waiting for the first `input.status`. Omitted ⇒
|
|
401
440
|
* {@link DEFAULT_GLYPH_SET}. See {@link InputStatusMessage} for the update channel. */
|
|
402
441
|
glyphSet?: GlyphSet;
|
|
442
|
+
/**
|
|
443
|
+
* Whether this host can put the game's boxes on top of everything else on the machine — see
|
|
444
|
+
* ./overlay.ts. False or absent in an ordinary browser tab, and true only when the host supports
|
|
445
|
+
* it AND the game's manifest declares an overlay mode.
|
|
446
|
+
*
|
|
447
|
+
* On `welcome` rather than a status message on purpose: it cannot change mid-session, and
|
|
448
|
+
* arriving with the handshake means the game's FIRST frame already knows, so nothing has to
|
|
449
|
+
* render twice. (`TrainerStatusMessage.ergSupported` is the counter-example — it can go stale,
|
|
450
|
+
* because there is no channel that re-pushes it.)
|
|
451
|
+
*/
|
|
452
|
+
overlaySupported?: boolean;
|
|
403
453
|
}
|
|
404
454
|
/** Rejects the handshake (e.g. unknown game, unsupported protocol, denied capabilities). */
|
|
405
455
|
export interface RejectMessage extends RydrTagged {
|
|
@@ -752,7 +802,28 @@ export interface RoomEventMessage extends RydrTagged {
|
|
|
752
802
|
at: number;
|
|
753
803
|
from: string;
|
|
754
804
|
}
|
|
755
|
-
|
|
805
|
+
/**
|
|
806
|
+
* Overlay mode was entered or left.
|
|
807
|
+
*
|
|
808
|
+
* Sent in answer to {@link OverlaySetModeMessage}, and ALSO unprompted when the rider leaves by a
|
|
809
|
+
* route the game cannot see. While the overlay is click-through the game's own menus are
|
|
810
|
+
* unreachable, so the host's tray or shortcut is the way out and this is how the game finds out.
|
|
811
|
+
*/
|
|
812
|
+
export interface OverlayStateMessage extends RydrTagged {
|
|
813
|
+
type: "rydr/overlay.state";
|
|
814
|
+
active: boolean;
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* The rider's stored box placements, to apply over the game's declared defaults.
|
|
818
|
+
*
|
|
819
|
+
* Keyed by box id and sparse: a box with no entry has never been moved. Arrives on entering
|
|
820
|
+
* overlay mode and whenever the host has something new to say about it.
|
|
821
|
+
*/
|
|
822
|
+
export interface OverlayLayoutMessage extends RydrTagged {
|
|
823
|
+
type: "rydr/overlay.layout";
|
|
824
|
+
placements: Record<string, OverlayBoxPlacement>;
|
|
825
|
+
}
|
|
826
|
+
export type PlatformToGameMessage = WelcomeMessage | RejectMessage | PowerMessage | CadenceMessage | HeartRateMessage | SpeedMessage | PowerBufferMessage | InputButtonMessage | InputAxisMessage | AudioSetMasterMessage | IdentityUpdateMessage | TrainerStatusMessage | OverlayStateMessage | OverlayLayoutMessage | InputStatusMessage | LifecyclePauseMessage | LifecycleResumeMessage | PingMessage | LeaderboardQueryResultMessage | LeaderboardRankQueryResultMessage | AdminBoardsResultMessage | GameDataResultMessage | AssetUploadUrlResultMessage | VoiceoverGenerateResultMessage | MediaUploadUrlResultMessage | ReplayResultMessage | RunGetResultMessage | RunStartResultMessage | RunSaveResultMessage | WorldListResultMessage | WorldGetResultMessage | CharacterListResultMessage | CharacterGetResultMessage | RigGetResultMessage | RoomOpenedMessage | RoomClosedMessage | RoomPresenceMessage | RoomStateMessage | RoomMessageMessage | RoomTelemetryMessage | RoomEventMessage;
|
|
756
827
|
/** Any message in the protocol. */
|
|
757
828
|
export type RydrMessage = GameToPlatformMessage | PlatformToGameMessage;
|
|
758
829
|
export {};
|