@hypersoniclabs/helix-sdk 0.1.2 → 0.1.9
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/README.md +859 -8
- package/dist/action-surface.d.ts +182 -0
- package/dist/action-surface.js +1032 -0
- package/dist/action-surface.js.map +1 -0
- package/dist/camera.d.ts +65 -1
- package/dist/camera.js +568 -0
- package/dist/camera.js.map +1 -1
- package/dist/dev-shell/criteria.d.ts +46 -0
- package/dist/dev-shell/criteria.js +98 -0
- package/dist/dev-shell/criteria.js.map +1 -0
- package/dist/dev-shell/index.d.ts +189 -0
- package/dist/dev-shell/index.js +287 -0
- package/dist/dev-shell/index.js.map +1 -0
- package/dist/dev-shell/keys.d.ts +14 -0
- package/dist/dev-shell/keys.js +78 -0
- package/dist/dev-shell/keys.js.map +1 -0
- package/dist/dev-shell/simulator.d.ts +436 -0
- package/dist/dev-shell/simulator.js +1634 -0
- package/dist/dev-shell/simulator.js.map +1 -0
- package/dist/dev-shell/state.d.ts +148 -0
- package/dist/dev-shell/state.js +196 -0
- package/dist/dev-shell/state.js.map +1 -0
- package/dist/device-definition-resolver.d.ts +34 -0
- package/dist/device-definition-resolver.js +172 -0
- package/dist/device-definition-resolver.js.map +1 -0
- package/dist/device-trial.d.ts +3 -0
- package/dist/device-trial.js +132 -0
- package/dist/device-trial.js.map +1 -0
- package/dist/devices.d.ts +228 -0
- package/dist/devices.js +198 -0
- package/dist/devices.js.map +1 -0
- package/dist/dreamerAudio.d.ts +126 -0
- package/dist/dreamerAudio.js +135 -0
- package/dist/dreamerAudio.js.map +1 -0
- package/dist/generated/runtime-contract.d.ts +15529 -0
- package/dist/generated/runtime-contract.js +20470 -0
- package/dist/generated/runtime-contract.js.map +1 -0
- package/dist/index.d.ts +272 -15
- package/dist/index.js +1401 -91
- package/dist/index.js.map +1 -1
- package/dist/interaction-mode.d.ts +172 -0
- package/dist/interaction-mode.js +553 -0
- package/dist/interaction-mode.js.map +1 -0
- package/dist/internal/avatar-pose.d.ts +25 -0
- package/dist/internal/avatar-pose.js +46 -0
- package/dist/internal/avatar-pose.js.map +1 -0
- package/dist/internal/keyed-collection.d.ts +2 -0
- package/dist/internal/keyed-collection.js +12 -0
- package/dist/internal/keyed-collection.js.map +1 -0
- package/dist/internal/vehicle-detach-action.d.ts +2 -0
- package/dist/internal/vehicle-detach-action.js +6 -0
- package/dist/internal/vehicle-detach-action.js.map +1 -0
- package/dist/matchmaking.d.ts +433 -0
- package/dist/matchmaking.js +1487 -0
- package/dist/matchmaking.js.map +1 -0
- package/dist/materials.d.ts +122 -0
- package/dist/materials.js +217 -0
- package/dist/materials.js.map +1 -0
- package/dist/multiplayer-accessors.d.ts +100 -0
- package/dist/multiplayer-accessors.js +200 -0
- package/dist/multiplayer-accessors.js.map +1 -0
- package/dist/multiplayer-contract/avatar-pose.d.ts +112 -0
- package/dist/multiplayer-contract/avatar-pose.js +250 -0
- package/dist/multiplayer-contract/avatar-pose.js.map +1 -0
- package/dist/multiplayer-contract/credential.d.ts +38 -0
- package/dist/multiplayer-contract/final-rest.d.ts +66 -0
- package/dist/multiplayer-contract/final-rest.js +38 -0
- package/dist/multiplayer-contract/final-rest.js.map +1 -0
- package/dist/multiplayer-contract/index.d.ts +11 -5
- package/dist/multiplayer-contract/index.js +16 -5
- package/dist/multiplayer-contract/index.js.map +1 -1
- package/dist/multiplayer-contract/messages.d.ts +461 -14
- package/dist/multiplayer-contract/messages.js +141 -15
- package/dist/multiplayer-contract/messages.js.map +1 -1
- package/dist/multiplayer-contract/room.d.ts +55 -4
- package/dist/multiplayer-contract/state.d.ts +181 -1
- package/dist/multiplayer-contract/state.js.map +1 -1
- package/dist/multiplayer-final-rest.d.ts +32 -0
- package/dist/multiplayer-final-rest.js +217 -0
- package/dist/multiplayer-final-rest.js.map +1 -0
- package/dist/multiplayer.d.ts +507 -16
- package/dist/multiplayer.js +2242 -73
- package/dist/multiplayer.js.map +1 -1
- package/dist/package.json +3 -0
- package/dist/protocol.d.ts +668 -5
- package/dist/protocol.js +101 -1
- package/dist/protocol.js.map +1 -1
- package/dist/runtime-contract/index.d.ts +15 -0
- package/dist/runtime-contract/index.js +12 -0
- package/dist/runtime-contract/index.js.map +1 -0
- package/dist/server-clock.d.ts +25 -0
- package/dist/server-clock.js +88 -0
- package/dist/server-clock.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/universal-vehicles.d.ts +111 -0
- package/dist/universal-vehicles.js +2 -0
- package/dist/universal-vehicles.js.map +1 -0
- package/dist/vault.d.ts +562 -0
- package/dist/vault.js +365 -0
- package/dist/vault.js.map +1 -0
- package/dist/vehicle-specialty-placement.d.ts +28 -0
- package/dist/vehicle-specialty-placement.js +154 -0
- package/dist/vehicle-specialty-placement.js.map +1 -0
- package/dist/vehicle-specialty-transport.d.ts +78 -0
- package/dist/vehicle-specialty-transport.js +183 -0
- package/dist/vehicle-specialty-transport.js.map +1 -0
- package/dist/voice.d.ts +229 -0
- package/dist/voice.js +1348 -0
- package/dist/voice.js.map +1 -0
- package/generated/runtime-contract/helix-runtime-contract.json +13332 -0
- package/generated/runtime-contract/known-answer.json +20471 -0
- package/generated/runtime-contract/known-answer.schema.json +630 -0
- package/generated/runtime-contract/runtime-contract.schema.json +607 -0
- package/generated/runtime-contract/unreal/HelixRuntimeContract.generated.h +908 -0
- package/package.json +32 -6
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
export declare const ROOM_CREDENTIAL_AUDIENCE: "helix-instant-room";
|
|
2
|
+
export interface RoomTrialClaim {
|
|
3
|
+
id: string;
|
|
4
|
+
itemId: string;
|
|
5
|
+
kind: 'avatar' | 'vehicle';
|
|
6
|
+
/** Trial expiry as Unix epoch seconds, sealed into the room credential. */
|
|
7
|
+
expiresAt: number;
|
|
8
|
+
}
|
|
9
|
+
/** A scalar an `openRoom` effect may seed a declared roomVar / playerVar with (credential `roomInit` / `playerInit`). */
|
|
10
|
+
export type RoomInitValue = number | boolean | string;
|
|
2
11
|
/**
|
|
3
12
|
* Claims the backend signs (HS384) and the room verifies. Mirrors the world_session claim shape
|
|
4
13
|
* (sub/displayName/worldId/scopes/jti) plus the immutable buildId the room loads its config from.
|
|
@@ -20,6 +29,8 @@ export interface RoomCredentialClaims {
|
|
|
20
29
|
worldId: string;
|
|
21
30
|
/** Immutable build the room loads its declarative config (allowed messages, room-var shape) from. */
|
|
22
31
|
buildId: string;
|
|
32
|
+
/** Active published Build UUID used to resolve the fleet snapshot. Absent for Home and legacy credentials. */
|
|
33
|
+
baseBuildId?: string;
|
|
23
34
|
/** Scopes from manifest.permissions; must include 'multiplayer' to join a room. */
|
|
24
35
|
scopes: string[];
|
|
25
36
|
/** Manifest maxPlayers (authoritative) → the room's maxClients cap, so it auto-locks + spills when full. */
|
|
@@ -33,6 +44,33 @@ export interface RoomCredentialClaims {
|
|
|
33
44
|
* tolerates its absence (older credentials / a build with no declared config) by running the fixed schema.
|
|
34
45
|
*/
|
|
35
46
|
configUrl: string;
|
|
47
|
+
/** Server-minted, page-view-scoped marketplace trial carried into the reserved room. */
|
|
48
|
+
trial?: RoomTrialClaim;
|
|
49
|
+
/**
|
|
50
|
+
* Named room type this credential admits to (manifest `multiplayer.roomTypes.<name>`). ABSENT = the world's
|
|
51
|
+
* default room type, which is what every credential minted before room types carries — so an older room
|
|
52
|
+
* server, which never reads the claim, keeps working. The room treats the client-supplied `roomType` join
|
|
53
|
+
* option as untrusted and rejects unless it equals this claim (absent on both sides = default), the same
|
|
54
|
+
* treatment as `trial.id` vs the `trialId` option. For a typed room `maxPlayers` is that TYPE's cap.
|
|
55
|
+
*/
|
|
56
|
+
roomType?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Ticketed rooms only: the room instance id (a backend-minted uuid, `world_room_instances.id`). Unguessable,
|
|
59
|
+
* and minted only into credentials for holders of a ticket to that instance — it is what partitions one
|
|
60
|
+
* ticketed match from another of the same type. Absent for the default type and for `open` types.
|
|
61
|
+
*/
|
|
62
|
+
instanceKey?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Initial values for the target type's DECLARED roomVars, fixed by the `openRoom` effect that created the
|
|
65
|
+
* instance. Applied once, at room creation, from the creating credential; unknown keys or wrong scalar types
|
|
66
|
+
* are ignored by the room with a warning.
|
|
67
|
+
*/
|
|
68
|
+
roomInit?: Record<string, RoomInitValue>;
|
|
69
|
+
/**
|
|
70
|
+
* Initial values for THIS player's declared playerVars in the target type, evaluated per selected player by
|
|
71
|
+
* the `openRoom` effect. Applied at join; unknown keys or wrong scalar types are ignored with a warning.
|
|
72
|
+
*/
|
|
73
|
+
playerInit?: Record<string, RoomInitValue>;
|
|
36
74
|
/** Always ROOM_CREDENTIAL_AUDIENCE. */
|
|
37
75
|
aud: typeof ROOM_CREDENTIAL_AUDIENCE;
|
|
38
76
|
iss: string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { EntityStateBatchMessage, GroupRestSnapshotMessage } from './messages.js';
|
|
2
|
+
import type { Vec3, Quat } from './state.js';
|
|
3
|
+
/** Additive opt-in on existing action/ping/entity channels; no manifest capability. */
|
|
4
|
+
export declare const FINAL_REST_REPLY = "__helix:finalRest";
|
|
5
|
+
/** A separate channel prevents old global consumers from applying module-local transforms. */
|
|
6
|
+
export declare const MODULE_FINAL_REST_SNAPSHOT = "__helix:moduleFinalRestSnapshot";
|
|
7
|
+
export declare const FINAL_REST_TIMEOUT_MS = 120000;
|
|
8
|
+
/** Explicit opt-in module address. The SDK supplies runtime generation and engagement authority. */
|
|
9
|
+
export interface FinalRestScope {
|
|
10
|
+
moduleId: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FinalRestProvenance extends FinalRestScope {
|
|
13
|
+
generation: number;
|
|
14
|
+
engagementEpoch?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const sameFinalRestScope: (a?: FinalRestProvenance, b?: FinalRestProvenance) => boolean;
|
|
17
|
+
export declare const finalRestScopeKey: (group: string, scope?: FinalRestScope) => string;
|
|
18
|
+
export declare function validFinalRestScope(scope: unknown): scope is FinalRestProvenance | undefined;
|
|
19
|
+
export interface FinalRestMember {
|
|
20
|
+
id: string;
|
|
21
|
+
epoch: number;
|
|
22
|
+
position: Vec3;
|
|
23
|
+
velocity: Vec3;
|
|
24
|
+
angularVelocity: Vec3;
|
|
25
|
+
orientation: Quat;
|
|
26
|
+
}
|
|
27
|
+
export interface FinalRestGrant {
|
|
28
|
+
scope?: FinalRestProvenance;
|
|
29
|
+
version: 1;
|
|
30
|
+
status: 'claimed';
|
|
31
|
+
group: string;
|
|
32
|
+
requestId: number;
|
|
33
|
+
transactionId: string;
|
|
34
|
+
members: FinalRestMember[];
|
|
35
|
+
}
|
|
36
|
+
export type FinalRestReply = FinalRestGrant | {
|
|
37
|
+
scope?: FinalRestProvenance;
|
|
38
|
+
version: 1;
|
|
39
|
+
status: 'rejected' | 'invalidated';
|
|
40
|
+
group: string;
|
|
41
|
+
requestId: number;
|
|
42
|
+
transactionId?: string;
|
|
43
|
+
reason: string;
|
|
44
|
+
entries?: Array<{
|
|
45
|
+
id: string;
|
|
46
|
+
accepted: boolean;
|
|
47
|
+
}>;
|
|
48
|
+
} | {
|
|
49
|
+
scope?: FinalRestProvenance;
|
|
50
|
+
version: 1;
|
|
51
|
+
status: 'committed';
|
|
52
|
+
group: string;
|
|
53
|
+
requestId: number;
|
|
54
|
+
transactionId: string;
|
|
55
|
+
snapshot: GroupRestSnapshotMessage;
|
|
56
|
+
};
|
|
57
|
+
export declare const finalRestId: (v: unknown) => v is string;
|
|
58
|
+
export declare const finalRestSequence: (v: unknown) => v is number;
|
|
59
|
+
export declare function isFinalRestClaim(v: unknown): v is {
|
|
60
|
+
version: 1;
|
|
61
|
+
requestId: number;
|
|
62
|
+
group: string;
|
|
63
|
+
scope?: FinalRestProvenance;
|
|
64
|
+
};
|
|
65
|
+
/** In addition to the ordinary server shape/auth/source-time/movement gates. */
|
|
66
|
+
export declare function isFinalRestBatch(m: EntityStateBatchMessage): boolean;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Additive opt-in on existing action/ping/entity channels; no manifest capability. */
|
|
2
|
+
export const FINAL_REST_REPLY = '__helix:finalRest';
|
|
3
|
+
/** A separate channel prevents old global consumers from applying module-local transforms. */
|
|
4
|
+
export const MODULE_FINAL_REST_SNAPSHOT = '__helix:moduleFinalRestSnapshot';
|
|
5
|
+
export const FINAL_REST_TIMEOUT_MS = 120_000;
|
|
6
|
+
export const sameFinalRestScope = (a, b) => a?.moduleId === b?.moduleId && a?.generation === b?.generation && a?.engagementEpoch === b?.engagementEpoch;
|
|
7
|
+
export const finalRestScopeKey = (group, scope) => scope === undefined ? group : `m:${scope.moduleId}|${group}`;
|
|
8
|
+
export function validFinalRestScope(scope) {
|
|
9
|
+
if (scope === undefined)
|
|
10
|
+
return true;
|
|
11
|
+
if (!scope || typeof scope !== 'object')
|
|
12
|
+
return false;
|
|
13
|
+
const s = scope;
|
|
14
|
+
return finalRestId(s.moduleId) && finalRestSequence(s.generation) &&
|
|
15
|
+
(s.engagementEpoch === undefined || finalRestSequence(s.engagementEpoch));
|
|
16
|
+
}
|
|
17
|
+
export const finalRestId = (v) => typeof v === 'string' && /^[a-zA-Z0-9_.:-]{1,128}$/.test(v);
|
|
18
|
+
export const finalRestSequence = (v) => Number.isSafeInteger(v) && v > 0;
|
|
19
|
+
export function isFinalRestClaim(v) {
|
|
20
|
+
if (!v || typeof v !== 'object')
|
|
21
|
+
return false;
|
|
22
|
+
const m = v;
|
|
23
|
+
return m.version === 1 && finalRestSequence(m.requestId) && finalRestId(m.group) && validFinalRestScope(m.scope);
|
|
24
|
+
}
|
|
25
|
+
/** In addition to the ordinary server shape/auth/source-time/movement gates. */
|
|
26
|
+
export function isFinalRestBatch(m) {
|
|
27
|
+
if (!isFinalRestClaim(m.finalRest) || !finalRestId(m.finalRest.transactionId) ||
|
|
28
|
+
m.moduleId !== m.finalRest.scope?.moduleId || !finalRestSequence(m.seq) || !Number.isFinite(m.tMs) ||
|
|
29
|
+
!Array.isArray(m.states) || m.states.length === 0)
|
|
30
|
+
return false;
|
|
31
|
+
return m.states.every(s => finalRestId(s.e) && Number.isSafeInteger(s.ep) && s.ep >= 0 &&
|
|
32
|
+
s.transactionId === m.finalRest.transactionId &&
|
|
33
|
+
[s.p, s.lv, s.av].every(v => Array.isArray(v) && v.length === 3 && v.every(Number.isFinite)) &&
|
|
34
|
+
s.lv.every(v => v === 0) && s.av.every(v => v === 0) &&
|
|
35
|
+
Array.isArray(s.q) && s.q.length === 4 && s.q.every(Number.isFinite) && Math.hypot(...s.q) > 1e-6 &&
|
|
36
|
+
s.v === undefined);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=final-rest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"final-rest.js","sourceRoot":"","sources":["../../src/multiplayer-contract/final-rest.ts"],"names":[],"mappings":"AAGA,uFAAuF;AACvF,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AACpD,8FAA8F;AAC9F,MAAM,CAAC,MAAM,0BAA0B,GAAG,iCAAiC,CAAC;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAC;AAI7C,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAuB,EAAE,CAAuB,EAAW,EAAE,CAC9F,CAAC,EAAE,QAAQ,KAAK,CAAC,EAAE,QAAQ,IAAI,CAAC,EAAE,UAAU,KAAK,CAAC,EAAE,UAAU,IAAI,CAAC,EAAE,eAAe,KAAK,CAAC,EAAE,eAAe,CAAC;AAC9G,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,KAAsB,EAAU,EAAE,CACjF,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE,CAAC;AAC/D,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,KAAK,KAAK,SAAS;QAAE,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
|
|
@@ -6,9 +6,15 @@
|
|
|
6
6
|
* does NOT reject. The SDK is frozen into each published bundle, so a newer room must keep admitting older
|
|
7
7
|
* builds; rejecting on mismatch would brick every published world on a bump. The detection is for
|
|
8
8
|
* cross-version diagnostics, and contract changes are kept additive/forward so older clients still play.
|
|
9
|
+
*
|
|
10
|
+
* That forward-compatibility is ONE-WAY: a NEWER client on an OLDER room is not safe when the bump added a
|
|
11
|
+
* client→server message type — Colyseus routes an unregistered type to __no_message_handler, which outside
|
|
12
|
+
* devMode leaves the sender (client.leave WITH_ERROR). Deploy the room BEFORE any world republishes on a
|
|
13
|
+
* newer SDK; a version whose bump is state/claims-only has no such ordering constraint.
|
|
9
14
|
*/
|
|
10
|
-
export declare const CONTRACT_VERSION:
|
|
11
|
-
export * from './state';
|
|
12
|
-
export * from './room';
|
|
13
|
-
export * from './messages';
|
|
14
|
-
export * from './credential';
|
|
15
|
+
export declare const CONTRACT_VERSION: 34;
|
|
16
|
+
export * from './state.js';
|
|
17
|
+
export * from './room.js';
|
|
18
|
+
export * from './messages.js';
|
|
19
|
+
export * from './credential.js';
|
|
20
|
+
export * from './final-rest.js';
|
|
@@ -21,10 +21,21 @@
|
|
|
21
21
|
* does NOT reject. The SDK is frozen into each published bundle, so a newer room must keep admitting older
|
|
22
22
|
* builds; rejecting on mismatch would brick every published world on a bump. The detection is for
|
|
23
23
|
* cross-version diagnostics, and contract changes are kept additive/forward so older clients still play.
|
|
24
|
+
*
|
|
25
|
+
* That forward-compatibility is ONE-WAY: a NEWER client on an OLDER room is not safe when the bump added a
|
|
26
|
+
* client→server message type — Colyseus routes an unregistered type to __no_message_handler, which outside
|
|
27
|
+
* devMode leaves the sender (client.leave WITH_ERROR). Deploy the room BEFORE any world republishes on a
|
|
28
|
+
* newer SDK; a version whose bump is state/claims-only has no such ordering constraint.
|
|
24
29
|
*/
|
|
25
|
-
export const CONTRACT_VERSION =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export
|
|
29
|
-
|
|
30
|
+
export const CONTRACT_VERSION = 34; // v34: PlayerState.locomotionPack — the equipped locomotion pack the seat MOVES on, as ONE servable pack-manifest base URL — a purely ADDITIVE optional field, appended beside `emotes` and renaming nothing that was already on the seat. It is resolved SERVER-SIDE from the account's equipped items at join and re-resolved on the existing 'avatarRefresh' hint (one wardrobe trip changes both the body and the way it moves, so the lane mints no message type of its own), which makes it the v17 avatarUrl trust shape: a client can never name the pack that lands on its own seat. The room holds the URL to the same SERVABLE-url rule as emote clips (https anywhere plus loopback http) with a length bound and replicates '' on anything else, so "carries no pack", "failed to resolve" and "unservable url" are deliberately one answer — all three mean the seat plays the platform locomotion. '' or missing on older rooms means the platform locomotion set. State-only and additive: no room-before-client ordering constraint.
|
|
31
|
+
/* Historical contract-version changelog (v33 and earlier):
|
|
32
|
+
v33: PlayerState.avatarRevision — room-owned uint32, appended after every existing seat field. It advances after each successful authoritative equipped-avatar read, including same-URL composition changes, so peers rebuild from the live equipped record. Missing on older rooms means 0. State-only and additive: no room-before-client ordering constraint.
|
|
33
|
+
export const CONTRACT_VERSION = 28 as const; // v28 (PROVISIONAL on the helix3 lane — renumbers at merge, contract-change-checklist §3): player-carried emote sets — PlayerState.emotes (EmoteEntry[]: slot 'r0'..'r7'|'sit'|'lie', itemId, clip URL, playback, plus the optional audio URL and display label the wheel's petals render) is RESOLVED SERVER-SIDE from the player's equipped items at join, so a client can never name a clip URL that lands on its own seat: the v17 avatarUrl trust shape wearing the v20 attachments array shape, and the distinction is the whole point. Synced as STATE (late joiners converge at replica spawn), EMOTE_LIMITS-bounded, with clip AND audio held to the same SERVABLE-url rule (https anywhere plus loopback http, mirroring the backend's isServableClipUrl), silently dropping any entry whose clip fails — an unservable audio or a label that sanitizes to nothing strips only that field, because the clip is the emote and the rest is garnish; a world may switch the lane off entirely with `emotes:{enabled:false}` in its multiplayer config (absent ⇒ enabled), which seats every player with an empty set. The client→server 'emoteRefresh' hint mirrors v23's 'avatarRefresh' exactly — EMPTY payload by design, per-seat cooldown, re-resolve + full-set replace — so a wheel change applies mid-session. AMENDED (same v28 line, still provisional): PAIRED emotes — an r-slot entry may carry `roles` (joinerClip + offerAtS + offsetX/offsetZ/offsetYawDeg, the joiner's placement in the INITIATOR-LOCAL frame, EMOTE_LIMITS.maxPairOffsetM-clamped and yaw-normalized by the room, stripped — never dropped — on a posture slot or an unservable joinerClip), and a joiner's seat carries the room-written PlayerState.pairInitiator/pairSlot/pairStartMs. The OFFER is an authored HELD POSE: `offerAtS` is the second in the INITIATOR's own clip the freeze sits at (the engine plays 0→offerAtS once as a wind-up, then holds until a joiner arrives or the initiator cancels; ≥ 0, EMOTE_LIMITS.maxOfferAtS-clamped by the room), so `playback` describes only the JOINED performance. The new 'emoteJoin' client message ({initiator} — '' leaves) is a REQUEST: the room refuses by writing nothing (initiator live, offering that r-slot right now, not the sender, both alive, sender unpaired, the initiator not already paired — a pair is strictly 1:1 — within reach) and owns every clear (the initiator's loopGesture changes, either side dies, the initiator teleports or leaves, the joiner drifts away), because pair state on the JOINER only is what keeps two clients from disagreeing about who is dancing with whom. AMENDED (same v28 line, still provisional): ENTER/EXIT transitions — an entry may carry the optional `intro`/`outro` clip urls (`intro` plays once and chains into `clip`; `outro` plays on a deliberate end and on a oneshot's natural completion), held to the same SERVABLE-url rule and the same EMOTE_LIMITS.maxClipUrlLength bound as `clip` and stripped — never dropped — when either fails it or when the entry kept `roles`, since a paired emote's two halves are choreographed against each other and carry no transitions. NO new message: the outro replicates through the v19 `gesture` relay under the suffixed name `emote.<slot>:outro`, which GESTURE_LIMITS.clipNamePattern already admits — the relay is name-opaque, so this adds no channel and no room-before-republish ordering of its own. RELEASE ORDER: the room deploys BEFORE any world republishes on this SDK — 'emoteRefresh' and 'emoteJoin' are NEW client→server types, so a pre-v28 room answers them with __no_message_handler and kicks the sender. v27 (PROVISIONAL on the helix3 lane — renumbers at merge, contract-change-checklist §3): teleport epoch fence — optional StateMessage.teleportSeq (SDK-stamped echo of the last StateAck-adopted epoch) + optional StateAckMessage.teleportSeq (the seat's current epoch, bumped on every rule teleport/respawn and carried by BOTH ack sites, proactive + reject). The room DROPS a state frame stamped strictly BELOW the seat's epoch: that frame was sampled before a teleport the client hadn't applied, and accepting it silently undoes the server's move — the in-flight-upload race behind the respawn ping-pong at real RTT. Strictly-below only (an unadopted higher stamp passes), adoption is ABSOLUTE (the epoch drops to 0 when a reconnect resets the seat), and the SDK clears its coalesced pending frame on adoption so a pre-snap position is never stamped with the new epoch. Fields-on-existing-messages only — no new message type, no room-before-republish ordering constraint; pre-v27 bundles omit the stamp and are covered by the room's teleport quarantine instead. v26 (PROVISIONAL on the helix3 lane — renumbers at merge, contract-change-checklist §3): ragdoll launch replication — optional StateMessage.ragdollLaunchX/Z + ragdollSpeedMps (unit horizontal direction × m/s, meaningful only while `ragdolled`) synced as PlayerState fields held stable for the ragdoll's lifetime, so a replica that observes the false→true `ragdolled` EDGE re-creates the sender's entry shove on its own corpse; late joiners read state (not the edge) and never re-apply it. State-only — no new message type, so no room-before-republish ordering constraint beyond the usual deploy order. v25: PlayerState.ragdolled — physics owns the body (death or manual ragdoll), client-authoritative like crouched. v24 (PROVISIONAL on character-shooter — renumbers at merge, contract-change-checklist §3): gun state — shotSeq/gunDrawn/aiming/reloading on the state upload. v23 (provisional on the helix3 lane — renumbers at the dev merge, contract-change-checklist §3): mid-session avatar refresh — client 'avatarRefresh' hint (EMPTY payload by design: the room re-resolves the equipped avatar server-side, so a client can never name the URL that lands on its seat) rewrites PlayerState.avatarUrl mid-session, which v17 fixed at join; clients observe other seats' changes through the SDK facade (onPlayerAvatarChanged) and the shell roster republish. RELEASE ORDER: the room deploys BEFORE any world republishes on this SDK — 'avatarRefresh' is a NEW client→server type, so a pre-v23 room answers it with __no_message_handler and kicks the sender. v22 (provisional on the helix3 lane — renumbers at the dev merge, contract-change-checklist §3): purchase receipts — client 'purchaseReceipt' message forwards the backend-minted HS384 receipt JWT verbatim; room verifies offline (aud helix-purchase-receipt), dedupes by purchaseId, fires the DSL purchase event + refreshes the buyer's entitlement snapshot. RELEASE ORDER: the room deploys BEFORE any world republishes on this SDK — 'purchaseReceipt' is a NEW client→server type, so a pre-v22 room answers it with __no_message_handler and kicks the sender, and the forward is automatic on settle (no world code), i.e. the buyer would be dropped the instant they pay. v21 (provisional on the helix3 lane — renumbers at the dev merge, contract-change-checklist §3): replicated live IK reach — optional StateMessage.reachLeft/reachRight/lookTarget world-space Vec3s ride the coalesced 10/20 Hz `state` upload (omitted = inactive; IK_LIMITS plausibility-bounds them against the same message's `position`), synced as PlayerState reachLeft/reachRight/lookTarget + *Active flags so late joiners converge; replicas feed the points into their OWN local arm/gaze solvers — no bone transforms on the wire, no new message channel (RESERVED_MESSAGE_TYPES unchanged), position-only v1 (no palm orientation — replicas take the natural solve). v20 (provisional on the helix3 lane — renumbers at the dev merge, contract-change-checklist §3): replicated prop attachments — client `attachments` full-set replace message (ATTACHMENT_LIMITS-bounded; asset URLs + preset names opaque, https-sanitized by the room), PlayerState.attachments (AttachmentEntry[]: id, asset, socket, sender-RESOLVED socket-local offsets, preset) synced as STATE so late joiners converge; no relay channel — schema sync fans out; props themselves never replicate (clients fetch the same CDN asset by URL). v19 (provisional on the helix3 lane — renumbers at the dev merge, contract-change-checklist §3): replicated gestures — client `gesture` message (oneshot|loop|stop, name-opaque, GESTURE_LIMITS-bounded), server `gesture` oneshot relay (broadcast except sender), PlayerState.loopGesture ('' = none) so late joiners see active loops; clips themselves never replicate (every client compiles the same world-registered pose-DSL JSON, only names cross the wire). v18: roster identity — PlayerState.userId (the credential `sub`, '' pre-v18): additive, copied once at join from the verified credential so roster UIs (the shell tablet's Server Details panel) can link seats to platform profiles; supersedes the §4 "sub never replicates" stance — user ids are public directory data (/api/v1/users batch lookup). v17: universal avatars — PlayerState.avatarUrl ('' = none) + RoomCredentialClaims.avatarUrl: each player's equipped, server-side-resolved avatar GLB URL, fixed at join, so clients render THEIR character for every seat. v16: networked physics — optional EntityState velocity/angularVelocity/orientation (+ EntityStateMessage/batch lv/av/q + ack lv/q) carry dynamic-body state for `physics` kinds; MOVEMENT_GATE.impulseMul/graceMs open a bounded collision-grace gate exception (plan Phase 0/3). v15: first-class elimination — PlayerState.active (boolean, default true); an eliminated-but-connected player drops out of the gameplay active set while staying connected + rendered + reachable by broadcast (Tier 2 P3-B2)
|
|
34
|
+
|
|
35
|
+
*/
|
|
36
|
+
export * from './state.js';
|
|
37
|
+
export * from './room.js';
|
|
38
|
+
export * from './messages.js';
|
|
39
|
+
export * from './credential.js';
|
|
40
|
+
export * from './final-rest.js';
|
|
30
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/multiplayer-contract/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,iGAAiG;AACjG,0FAA0F;AAC1F,oEAAoE;AACpE,wFAAwF;AACxF,8EAA8E;AAC9E,EAAE;AACF,mGAAmG;AACnG,+FAA+F;AAC/F,gDAAgD;AAChD,EAAE;AACF,uGAAuG;AACvG,qGAAqG;AACrG,iGAAiG;AAEjG
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/multiplayer-contract/index.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,EAAE;AACF,iGAAiG;AACjG,0FAA0F;AAC1F,oEAAoE;AACpE,wFAAwF;AACxF,8EAA8E;AAC9E,EAAE;AACF,mGAAmG;AACnG,+FAA+F;AAC/F,gDAAgD;AAChD,EAAE;AACF,uGAAuG;AACvG,qGAAqG;AACrG,iGAAiG;AAEjG;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAW,CAAC,CAAC,s/BAAs/B;AACniC;;;;EAIE;AACF,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAE7B,cAAc,cAAc,CAAC"}
|