@genex-ai/multiplayer 0.11.0 → 0.12.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/README.md CHANGED
@@ -65,6 +65,8 @@ for (const [id, p] of room.players) {
65
65
 
66
66
  Remote players glide instead of teleporting between network updates — see **[Smoothing remote players](#smoothing-remote-players)**.
67
67
 
68
+ Each player also carries `p.avatarUrl` — the VRM avatar that player picked on their genex profile (guests get a per-session pick), verified server-side from their identity token so it can't be spoofed. Render each player's own look with it (e.g. `loadVrm(p.avatarUrl || "./assets/avatar.vrm")` in a VRM-lane game); it's `''` when unknown (older relay/API), so always keep a bundled fallback. Don't put an avatar URL in your `me.set` state — this field replaces that.
69
+
68
70
  ## `shared` — shared room state
69
71
 
70
72
  A key/value store (any JSON) synced to everyone. Use for world state, scores, the current round, etc.
package/dist/index.d.ts CHANGED
@@ -37,6 +37,11 @@ type ConnectOptions = {
37
37
  type PlayerView<TState> = {
38
38
  id: string;
39
39
  name: string;
40
+ /** This player's verified VRM avatar URL (the avatar they picked on their
41
+ * genex profile; guests get a per-session pick). Server-set from the embed
42
+ * token — cannot be spoofed. `''` when unknown (old relay/API). Load it for
43
+ * the player's visual; fall back to your bundled model when empty. */
44
+ avatarUrl: string;
40
45
  /** Transport is live now. False while this reserved seat is inside reconnect grace. */
41
46
  connected: boolean;
42
47
  /** RENDER ONLY — for remote players this is **auto-smoothed** (interpolated) and delayed;
package/dist/index.js CHANGED
@@ -736,6 +736,8 @@ function attachSession(client, initialRoom) {
736
736
  out.set(id, {
737
737
  id,
738
738
  name: p.name,
739
+ avatarUrl: p.avatarUrl ?? "",
740
+ // old relay schemas did not carry the field
739
741
  connected: p.connected !== false,
740
742
  // old relay schemas did not carry the field
741
743
  state,
package/dist/schema.d.ts CHANGED
@@ -6,11 +6,13 @@ declare const PlayerState: _colyseus_schema.SchemaWithExtendsConstructor<{
6
6
  data: "string";
7
7
  epoch: "number";
8
8
  connected: "boolean";
9
+ avatarUrl: "string";
9
10
  }, _colyseus_schema.AssignableProps<_colyseus_schema.InferSchemaInstanceType<{
10
11
  name: "string";
11
12
  data: "string";
12
13
  epoch: "number";
13
14
  connected: "boolean";
15
+ avatarUrl: "string";
14
16
  }>>, typeof _colyseus_schema.Schema>;
15
17
  type PlayerState = SchemaType<typeof PlayerState>;
16
18
  declare const RoomState: _colyseus_schema.SchemaWithExtendsConstructor<{
@@ -20,17 +22,20 @@ declare const RoomState: _colyseus_schema.SchemaWithExtendsConstructor<{
20
22
  data: "string";
21
23
  epoch: "number";
22
24
  connected: "boolean";
25
+ avatarUrl: "string";
23
26
  }, _colyseus_schema.AssignableProps<_colyseus_schema.InferSchemaInstanceType<{
24
27
  name: "string";
25
28
  data: "string";
26
29
  epoch: "number";
27
30
  connected: "boolean";
31
+ avatarUrl: "string";
28
32
  }>>, typeof _colyseus_schema.Schema>;
29
33
  default: MapSchema<_colyseus_schema.InferSchemaInstanceType<{
30
34
  name: "string";
31
35
  data: "string";
32
36
  epoch: "number";
33
37
  connected: "boolean";
38
+ avatarUrl: "string";
34
39
  }>, string>;
35
40
  };
36
41
  shared: {
@@ -44,17 +49,20 @@ declare const RoomState: _colyseus_schema.SchemaWithExtendsConstructor<{
44
49
  data: "string";
45
50
  epoch: "number";
46
51
  connected: "boolean";
52
+ avatarUrl: "string";
47
53
  }, _colyseus_schema.AssignableProps<_colyseus_schema.InferSchemaInstanceType<{
48
54
  name: "string";
49
55
  data: "string";
50
56
  epoch: "number";
51
57
  connected: "boolean";
58
+ avatarUrl: "string";
52
59
  }>>, typeof _colyseus_schema.Schema>;
53
60
  default: MapSchema<_colyseus_schema.InferSchemaInstanceType<{
54
61
  name: "string";
55
62
  data: "string";
56
63
  epoch: "number";
57
64
  connected: "boolean";
65
+ avatarUrl: "string";
58
66
  }>, string>;
59
67
  };
60
68
  shared: {
package/dist/schema.js CHANGED
@@ -9,7 +9,12 @@ var PlayerState = schema(
9
9
  epoch: "number",
10
10
  // Seat presence is distinct from connectivity: a dropped player keeps the
11
11
  // seat during reconnection grace but flips connected=false immediately.
12
- connected: "boolean"
12
+ connected: "boolean",
13
+ // The player's verified VRM avatar URL (AG-804) — set by the relay from the
14
+ // embed token, never client-writable. '' = none (old API / empty library).
15
+ // NEW FIELDS GO AFTER THIS ONE: @colyseus/schema keeps old clients decoding
16
+ // only when fields are appended at the end, never inserted or reordered.
17
+ avatarUrl: "string"
13
18
  },
14
19
  "PlayerState"
15
20
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genex-ai/multiplayer",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "The multiplayer client wrapper + shared room schema for genex.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",