@rydr/game-sdk 2.1.1 → 3.0.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.
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Canonical, source-agnostic controller vocabulary.
|
|
3
3
|
*
|
|
4
|
-
* Every physical controller (
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* games decoupled from hardware specifics and is the same vocabulary the
|
|
8
|
-
* platform's input layer already uses.
|
|
4
|
+
* Every physical controller (Zwift Play, keyboard, phone) is normalised to these names by the
|
|
5
|
+
* platform before it reaches a game. The game never learns which device produced a press — only
|
|
6
|
+
* the canonical name and edge — which keeps games decoupled from hardware specifics.
|
|
9
7
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* - **Directions** — `UP`/`DOWN`/`LEFT`/`RIGHT` (the D-pad / arrow keys).
|
|
9
|
+
* - **Face buttons** — `A`/`B`/`Y`/`Z`, the four buttons on the controller (Zwift Play layout:
|
|
10
|
+
* A right, B bottom, Y top, Z left). They carry no built-in meaning — each game assigns its
|
|
11
|
+
* own — but the platform **house convention** is `A` = **confirm / primary action** and `Z` =
|
|
12
|
+
* **back / cancel**, with `B`/`Y` as contextual extras. Follow it so confirm/back stay
|
|
13
|
+
* consistent across the library, and show the actual button glyph (A/B/Y/Z, by colour) in
|
|
14
|
+
* on-screen prompts rather than a generic label.
|
|
12
15
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* controller — for games that want all four distinctly) AND the neutral collapse
|
|
16
|
-
* (`A`/`B` → `PRIMARY`, `Y`/`Z` → `SECONDARY` — what most games listen for). A
|
|
17
|
-
* game subscribes to whichever vocabulary it wants. Phone / keyboard emit
|
|
18
|
-
* `PRIMARY`/`SECONDARY` for their two neutral action buttons.
|
|
16
|
+
* Devices with fewer than four face buttons (e.g. a phone) expose at least the `A`/`Z`
|
|
17
|
+
* confirm/back pair — don't require `B`/`Y` for a flow that must work on every input.
|
|
19
18
|
*/
|
|
20
|
-
export type ButtonName = "
|
|
19
|
+
export type ButtonName = "UP" | "DOWN" | "LEFT" | "RIGHT" | "A" | "B" | "Y" | "Z";
|
|
21
20
|
/** Press = "down", release = "up". A held button emits one of each. */
|
|
22
21
|
export type ButtonEdge = "down" | "up";
|
|
23
22
|
//# sourceMappingURL=buttons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../src/protocol/buttons.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"buttons.d.ts","sourceRoot":"","sources":["../../src/protocol/buttons.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,UAAU,GAClB,IAAI,GACJ,MAAM,GACN,MAAM,GACN,OAAO,GAGP,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,CAAC;AAER,uEAAuE;AACvE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,IAAI,CAAC"}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* built against an older protocol keeps working. Evolve the protocol
|
|
7
7
|
* ADDITIVELY — never change or remove an existing message shape.
|
|
8
8
|
*/
|
|
9
|
-
export declare const RYDR_PROTOCOL_VERSION:
|
|
9
|
+
export declare const RYDR_PROTOCOL_VERSION: 11;
|
|
10
10
|
/** Semver of this SDK build. Sent in the handshake for telemetry/debugging.
|
|
11
11
|
* (Bumped to 2.0.0 by `npm version major` on release — see CHANGELOG [Unreleased].) */
|
|
12
|
-
export declare const RYDR_SDK_VERSION = "
|
|
12
|
+
export declare const RYDR_SDK_VERSION = "3.0.0";
|
|
13
13
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAqBH,eAAO,MAAM,qBAAqB,EAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,eAAO,MAAM,gBAAgB,UAAU,CAAC"}
|
package/dist/protocol/version.js
CHANGED
|
@@ -22,8 +22,12 @@
|
|
|
22
22
|
// Bumped 9 → 10: adds `rydr/leaderboard.rankQuery` so a game can ask where an arbitrary value would
|
|
23
23
|
// rank WITHOUT submitting it — a read-only standing for an in-progress score (`getRank`). Additive —
|
|
24
24
|
// older shells never reply, so the call rejects (timeout) and callers treat the rank as optional.
|
|
25
|
-
|
|
25
|
+
// Bumped 10 → 11: button vocabulary dropped the neutral `PRIMARY`/`SECONDARY` pair (BREAKING — the
|
|
26
|
+
// `input.button` `name` values no longer include them). Every controller now normalises to the four
|
|
27
|
+
// raw face buttons `A`/`B`/`Y`/`Z` (+ `UP`/`DOWN`/`LEFT`/`RIGHT`), with the house convention
|
|
28
|
+
// A = confirm, Z = back. Migrate: `name === "PRIMARY"` → `"A"`, `name === "SECONDARY"` → `"Z"`.
|
|
29
|
+
export const RYDR_PROTOCOL_VERSION = 11;
|
|
26
30
|
/** Semver of this SDK build. Sent in the handshake for telemetry/debugging.
|
|
27
31
|
* (Bumped to 2.0.0 by `npm version major` on release — see CHANGELOG [Unreleased].) */
|
|
28
|
-
export const RYDR_SDK_VERSION = "
|
|
32
|
+
export const RYDR_SDK_VERSION = "3.0.0";
|
|
29
33
|
//# sourceMappingURL=version.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,8FAA8F;AAC9F,yDAAyD;AACzD,4FAA4F;AAC5F,oGAAoG;AACpG,kGAAkG;AAClG,6EAA6E;AAC7E,kGAAkG;AAClG,uGAAuG;AACvG,wFAAwF;AACxF,oGAAoG;AACpG,gGAAgG;AAChG,yFAAyF;AACzF,kHAAkH;AAClH,oGAAoG;AACpG,qGAAqG;AACrG,kGAAkG;AAClG,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/protocol/version.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,8FAA8F;AAC9F,yDAAyD;AACzD,4FAA4F;AAC5F,oGAAoG;AACpG,kGAAkG;AAClG,6EAA6E;AAC7E,kGAAkG;AAClG,uGAAuG;AACvG,wFAAwF;AACxF,oGAAoG;AACpG,gGAAgG;AAChG,yFAAyF;AACzF,kHAAkH;AAClH,oGAAoG;AACpG,qGAAqG;AACrG,kGAAkG;AAClG,mGAAmG;AACnG,oGAAoG;AACpG,6FAA6F;AAC7F,gGAAgG;AAChG,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAW,CAAC;AAEjD;wFACwF;AACxF,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC"}
|