@indiegems/gem-web-sdk 10.4.0 → 11.1.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/CHANGELOG.md +26 -0
- package/dist/function.d.ts +3 -0
- package/dist/game.d.ts +29 -2
- package/dist/gem-web-sdk.bridge.js +1 -1
- package/dist/gem-web-sdk.esm.js +2 -2
- package/dist/gem-web-sdk.function.js +2 -2
- package/dist/gem-web-sdk.game.js +2 -2
- package/dist/gem-web-sdk.min.js +2 -2
- package/dist/gem-web-sdk.sdk.js +2 -2
- package/dist/gem-web-sdk.server.js +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/sdk.d.ts +35 -2
- package/dist/server-api.d.ts +6 -0
- package/dist/server.d.ts +6 -0
- package/docs/api/api-reference-game.md +423 -19
- package/docs/api/api-reference-server.md +1 -1
- package/docs/api/reference.json +392 -10
- package/docs/changelog.md +26 -0
- package/docs/getting-started.md +1 -1
- package/docs/manifest.json +10 -10
- package/docs/rooms-and-matches.md +43 -0
- package/docs/server-bundles.md +2 -2
- package/docs/what-a-game-must-do.md +69 -19
- package/package.json +1 -1
- package/schema/bridge.v1.json +79 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# The browser surface — API reference
|
|
2
2
|
|
|
3
|
-
Generated from `@indiegems/gem-web-sdk/sdk`
|
|
3
|
+
Generated from `@indiegems/gem-web-sdk/sdk` v11.1.0, the version of the package this file ships in. Every symbol below carries an explicit anchor, its `anchor` in `reference.json` beside this file.
|
|
4
4
|
|
|
5
5
|
`@indiegems/gem-web-sdk/sdk` is the one import a game writes, wherever its code runs. `@indiegems/gem-web-sdk/game` exports exactly the symbols on this page and nothing else, for a build that wants only this half.
|
|
6
6
|
|
|
@@ -5639,15 +5639,22 @@ arcade that handles share.
|
|
|
5639
5639
|
## GemFrame.requestAvatarPicker
|
|
5640
5640
|
|
|
5641
5641
|
```ts
|
|
5642
|
-
requestAvatarPicker(): boolean
|
|
5642
|
+
requestAvatarPicker(tab?: "2d" | "3d"): boolean
|
|
5643
5643
|
```
|
|
5644
5644
|
|
|
5645
5645
|
Ask the arcade to open its own avatar picker over your game. Nothing comes
|
|
5646
|
-
back: a changed portrait arrives as a new `gem.player`,
|
|
5646
|
+
back: a changed portrait or 3D character arrives as a new `gem.player`,
|
|
5647
|
+
through `onPlayer`.
|
|
5647
5648
|
|
|
5648
5649
|
Prefer `gem.openAvatarPicker`, which documents what a game does with the
|
|
5649
5650
|
change.
|
|
5650
5651
|
|
|
5652
|
+
| Parameter | Type | Description |
|
|
5653
|
+
| --- | --- | --- |
|
|
5654
|
+
| `tab` | `"2d" \| "3d"` | Which tab to open on — `'2d'` (the portrait) or `'3d'` (the 3D
|
|
5655
|
+
character). Omit it to let the arcade decide. Anything else is treated as
|
|
5656
|
+
omitted. An arcade older than the tabs ignores it. |
|
|
5657
|
+
|
|
5651
5658
|
**Returns.** whether the message left the frame — `false` before the bridge is
|
|
5652
5659
|
up, for an arcade that has no avatar picker here, and past this frame's
|
|
5653
5660
|
own limit of six a minute.
|
|
@@ -5803,6 +5810,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
|
|
|
5803
5810
|
draw your own placeholder rather than a broken image. Pass it through
|
|
5804
5811
|
[platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
5805
5812
|
|
|
5813
|
+
<a id="friend-avatar3did"></a>
|
|
5814
|
+
|
|
5815
|
+
## Friend.avatar3dId
|
|
5816
|
+
|
|
5817
|
+
```ts
|
|
5818
|
+
readonly avatar3dId?: string
|
|
5819
|
+
```
|
|
5820
|
+
|
|
5821
|
+
The id of the 3D character the player wears, when they wear one — an
|
|
5822
|
+
Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
|
|
5823
|
+
avatar picker. What a game that draws Arcade avatars keys its character
|
|
5824
|
+
on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
|
|
5825
|
+
to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
|
|
5826
|
+
absent.
|
|
5827
|
+
|
|
5828
|
+
Independent of the portrait: wearing a 3D character never changes
|
|
5829
|
+
`avatarIconId`, and the other way round. Absent means the game's default
|
|
5830
|
+
look. On `gem.player` it changes when the player wears another one, and
|
|
5831
|
+
`onPlayer` runs again; see `gem.openAvatarPicker`.
|
|
5832
|
+
|
|
5833
|
+
<a id="friend-avatar3dmodelurl"></a>
|
|
5834
|
+
|
|
5835
|
+
## Friend.avatar3dModelUrl
|
|
5836
|
+
|
|
5837
|
+
```ts
|
|
5838
|
+
readonly avatar3dModelUrl?: string
|
|
5839
|
+
```
|
|
5840
|
+
|
|
5841
|
+
The worn 3D character's model — a binary glTF (`.glb`) with one rig,
|
|
5842
|
+
`root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
|
|
5843
|
+
possibly animation clips. Load it with three.js's `GLTFLoader`, after
|
|
5844
|
+
passing it through [platformIconUrl](#platformiconurl), which pins models to the
|
|
5845
|
+
platform's item host exactly as it pins pictures. Absent when no 3D
|
|
5846
|
+
character is worn.
|
|
5847
|
+
|
|
5848
|
+
<a id="friend-avatar3diconurl"></a>
|
|
5849
|
+
|
|
5850
|
+
## Friend.avatar3dIconUrl
|
|
5851
|
+
|
|
5852
|
+
```ts
|
|
5853
|
+
readonly avatar3dIconUrl?: string
|
|
5854
|
+
```
|
|
5855
|
+
|
|
5856
|
+
A rendered portrait of the worn 3D character, for a roster or a menu where
|
|
5857
|
+
loading the model is too much. Not the 2D portrait
|
|
5858
|
+
([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
|
|
5859
|
+
through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
5860
|
+
|
|
5806
5861
|
<a id="friend-badges"></a>
|
|
5807
5862
|
|
|
5808
5863
|
## Friend.badges
|
|
@@ -7611,6 +7666,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
|
|
|
7611
7666
|
draw your own placeholder rather than a broken image. Pass it through
|
|
7612
7667
|
[platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
7613
7668
|
|
|
7669
|
+
<a id="gemplayer-avatar3did"></a>
|
|
7670
|
+
|
|
7671
|
+
## GemPlayer.avatar3dId
|
|
7672
|
+
|
|
7673
|
+
```ts
|
|
7674
|
+
readonly avatar3dId?: string
|
|
7675
|
+
```
|
|
7676
|
+
|
|
7677
|
+
The id of the 3D character the player wears, when they wear one — an
|
|
7678
|
+
Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
|
|
7679
|
+
avatar picker. What a game that draws Arcade avatars keys its character
|
|
7680
|
+
on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
|
|
7681
|
+
to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
|
|
7682
|
+
absent.
|
|
7683
|
+
|
|
7684
|
+
Independent of the portrait: wearing a 3D character never changes
|
|
7685
|
+
`avatarIconId`, and the other way round. Absent means the game's default
|
|
7686
|
+
look. On `gem.player` it changes when the player wears another one, and
|
|
7687
|
+
`onPlayer` runs again; see `gem.openAvatarPicker`.
|
|
7688
|
+
|
|
7689
|
+
<a id="gemplayer-avatar3dmodelurl"></a>
|
|
7690
|
+
|
|
7691
|
+
## GemPlayer.avatar3dModelUrl
|
|
7692
|
+
|
|
7693
|
+
```ts
|
|
7694
|
+
readonly avatar3dModelUrl?: string
|
|
7695
|
+
```
|
|
7696
|
+
|
|
7697
|
+
The worn 3D character's model — a binary glTF (`.glb`) with one rig,
|
|
7698
|
+
`root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
|
|
7699
|
+
possibly animation clips. Load it with three.js's `GLTFLoader`, after
|
|
7700
|
+
passing it through [platformIconUrl](#platformiconurl), which pins models to the
|
|
7701
|
+
platform's item host exactly as it pins pictures. Absent when no 3D
|
|
7702
|
+
character is worn.
|
|
7703
|
+
|
|
7704
|
+
<a id="gemplayer-avatar3diconurl"></a>
|
|
7705
|
+
|
|
7706
|
+
## GemPlayer.avatar3dIconUrl
|
|
7707
|
+
|
|
7708
|
+
```ts
|
|
7709
|
+
readonly avatar3dIconUrl?: string
|
|
7710
|
+
```
|
|
7711
|
+
|
|
7712
|
+
A rendered portrait of the worn 3D character, for a roster or a menu where
|
|
7713
|
+
loading the model is too much. Not the 2D portrait
|
|
7714
|
+
([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
|
|
7715
|
+
through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
7716
|
+
|
|
7614
7717
|
<a id="gemplayer-badges"></a>
|
|
7615
7718
|
|
|
7616
7719
|
## GemPlayer.badges
|
|
@@ -8669,7 +8772,7 @@ ends, and under an embedder that has no avatar picker.
|
|
|
8669
8772
|
## Gem.openAvatarPicker
|
|
8670
8773
|
|
|
8671
8774
|
```ts
|
|
8672
|
-
openAvatarPicker(): boolean
|
|
8775
|
+
openAvatarPicker(options?: { tab?: "2d" | "3d" }): boolean
|
|
8673
8776
|
```
|
|
8674
8777
|
|
|
8675
8778
|
Open the arcade's avatar picker over your game, so the player can change
|
|
@@ -8684,22 +8787,36 @@ changeAvatar.onclick = () => {
|
|
|
8684
8787
|
};
|
|
8685
8788
|
```
|
|
8686
8789
|
|
|
8790
|
+
**Two tabs: 2D and 3D.** The picker has a 2D tab — the portrait, a
|
|
8791
|
+
picture ([PlayerIdentity.avatarIconId](#playeridentity-avatariconid)) — and a 3D tab — a whole
|
|
8792
|
+
character with its own model ([PlayerIdentity.avatar3dId](#playeridentity-avatar3did),
|
|
8793
|
+
[PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl)). They are separate choices: wearing
|
|
8794
|
+
one never changes the other. Pass `{ tab: '3d' }` or `{ tab: '2d' }` to
|
|
8795
|
+
open on one; omit it and the arcade decides (a game that draws Arcade
|
|
8796
|
+
avatars gets the 3D tab). An arcade older than the tabs ignores it.
|
|
8797
|
+
|
|
8687
8798
|
**The change arrives as a new player, not as an answer.** Nothing comes
|
|
8688
8799
|
back from this call. When the player picks a different avatar, the arcade
|
|
8689
8800
|
pauses your game while the picker is open, then sends the player again —
|
|
8690
8801
|
your `onPlayer` callback runs and [Gem.player](#gem-player) holds the new
|
|
8691
|
-
[PlayerIdentity.avatarIconId](#playeridentity-avatariconid) —
|
|
8692
|
-
`onPlayer`, which also runs when the player
|
|
8693
|
-
arcade's own menu without your game asking.
|
|
8694
|
-
unchanged produces nothing at all.
|
|
8802
|
+
[PlayerIdentity.avatar3dId](#playeridentity-avatar3did) or [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) —
|
|
8803
|
+
and resumes it. Redraw from `onPlayer`, which also runs when the player
|
|
8804
|
+
changes their avatar from the arcade's own menu without your game asking.
|
|
8805
|
+
A player who closes the picker unchanged produces nothing at all.
|
|
8695
8806
|
|
|
8696
8807
|
**Your server learns it only when it reads the room again.** A
|
|
8697
|
-
server-authoritative game reads each member's `
|
|
8698
|
-
|
|
8699
|
-
`gem.room.get()`
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
trust the id the
|
|
8808
|
+
server-authoritative game reads each member's `avatar_3d_id` and
|
|
8809
|
+
`avatar_icon_id` from the room read
|
|
8810
|
+
(`GET /v1/games/{game_id}/game-rooms/{game_room_id}`, or `gem.room.get()`
|
|
8811
|
+
on a dedicated server); nothing tells the server the player changed. So
|
|
8812
|
+
when `onPlayer` brings a different avatar, have your client tell your
|
|
8813
|
+
server, and have the server re-read the room — never trust the id the
|
|
8814
|
+
client sends.
|
|
8815
|
+
|
|
8816
|
+
| Parameter | Type | Description |
|
|
8817
|
+
| --- | --- | --- |
|
|
8818
|
+
| `options` | `{ tab?: "2d" \| "3d" }` | `tab` — `'2d'` or `'3d'`, the tab to open on. Omit it to let
|
|
8819
|
+
the arcade decide; any other value is treated as omitted. |
|
|
8703
8820
|
|
|
8704
8821
|
**Returns.** `true` when the arcade was asked; `false` when it was not and
|
|
8705
8822
|
never will be for this call — outside the arcade, before the bridge is
|
|
@@ -10339,6 +10456,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
|
|
|
10339
10456
|
draw your own placeholder rather than a broken image. Pass it through
|
|
10340
10457
|
[platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
10341
10458
|
|
|
10459
|
+
<a id="playeridentity-avatar3did"></a>
|
|
10460
|
+
|
|
10461
|
+
## PlayerIdentity.avatar3dId
|
|
10462
|
+
|
|
10463
|
+
```ts
|
|
10464
|
+
readonly avatar3dId?: string
|
|
10465
|
+
```
|
|
10466
|
+
|
|
10467
|
+
The id of the 3D character the player wears, when they wear one — an
|
|
10468
|
+
Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
|
|
10469
|
+
avatar picker. What a game that draws Arcade avatars keys its character
|
|
10470
|
+
on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
|
|
10471
|
+
to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
|
|
10472
|
+
absent.
|
|
10473
|
+
|
|
10474
|
+
Independent of the portrait: wearing a 3D character never changes
|
|
10475
|
+
`avatarIconId`, and the other way round. Absent means the game's default
|
|
10476
|
+
look. On `gem.player` it changes when the player wears another one, and
|
|
10477
|
+
`onPlayer` runs again; see `gem.openAvatarPicker`.
|
|
10478
|
+
|
|
10479
|
+
<a id="playeridentity-avatar3dmodelurl"></a>
|
|
10480
|
+
|
|
10481
|
+
## PlayerIdentity.avatar3dModelUrl
|
|
10482
|
+
|
|
10483
|
+
```ts
|
|
10484
|
+
readonly avatar3dModelUrl?: string
|
|
10485
|
+
```
|
|
10486
|
+
|
|
10487
|
+
The worn 3D character's model — a binary glTF (`.glb`) with one rig,
|
|
10488
|
+
`root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
|
|
10489
|
+
possibly animation clips. Load it with three.js's `GLTFLoader`, after
|
|
10490
|
+
passing it through [platformIconUrl](#platformiconurl), which pins models to the
|
|
10491
|
+
platform's item host exactly as it pins pictures. Absent when no 3D
|
|
10492
|
+
character is worn.
|
|
10493
|
+
|
|
10494
|
+
<a id="playeridentity-avatar3diconurl"></a>
|
|
10495
|
+
|
|
10496
|
+
## PlayerIdentity.avatar3dIconUrl
|
|
10497
|
+
|
|
10498
|
+
```ts
|
|
10499
|
+
readonly avatar3dIconUrl?: string
|
|
10500
|
+
```
|
|
10501
|
+
|
|
10502
|
+
A rendered portrait of the worn 3D character, for a roster or a menu where
|
|
10503
|
+
loading the model is too much. Not the 2D portrait
|
|
10504
|
+
([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
|
|
10505
|
+
through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
10506
|
+
|
|
10342
10507
|
<a id="playeridentity-badges"></a>
|
|
10343
10508
|
|
|
10344
10509
|
## PlayerIdentity.badges
|
|
@@ -10377,8 +10542,8 @@ for (const row of opponents) {
|
|
|
10377
10542
|
```
|
|
10378
10543
|
|
|
10379
10544
|
Reads `player_id`, `display_name`, `discriminator`, `display_tag`,
|
|
10380
|
-
`avatar_icon_id`, `avatar_icon_url`
|
|
10381
|
-
row. Anything missing, empty or of the wrong type is absent in the result.
|
|
10545
|
+
`avatar_icon_id`, `avatar_icon_url`, `avatar_3d_id`, `avatar_3d_model_url`,
|
|
10546
|
+
`avatar_3d_icon_url` and `badges`, and nothing else from the row. Anything missing, empty or of the wrong type is absent in the result.
|
|
10382
10547
|
|
|
10383
10548
|
| Parameter | Type |
|
|
10384
10549
|
| --- | --- |
|
|
@@ -10394,9 +10559,10 @@ function platformIconUrl(url: string | undefined): string | undefined
|
|
|
10394
10559
|
|
|
10395
10560
|
The icon URL, if and only if the platform serves it — otherwise `undefined`.
|
|
10396
10561
|
|
|
10397
|
-
Use it on every [PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)
|
|
10398
|
-
[
|
|
10399
|
-
|
|
10562
|
+
Use it on every [PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl),
|
|
10563
|
+
[PlayerIdentity.avatar3dIconUrl](#playeridentity-avatar3diconurl), [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl)
|
|
10564
|
+
and [PlayerBadge.iconUrl](#playerbadge-iconurl) before it reaches an `<img src>`, a texture
|
|
10565
|
+
loader, a `GLTFLoader` or a `fetch`:
|
|
10400
10566
|
|
|
10401
10567
|
```js
|
|
10402
10568
|
import { platformIconUrl } from '@indiegems/gem-web-sdk/sdk';
|
|
@@ -12906,6 +13072,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
|
|
|
12906
13072
|
draw your own placeholder rather than a broken image. Pass it through
|
|
12907
13073
|
[platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
12908
13074
|
|
|
13075
|
+
<a id="leaderboardentry-avatar3did"></a>
|
|
13076
|
+
|
|
13077
|
+
## LeaderboardEntry.avatar3dId
|
|
13078
|
+
|
|
13079
|
+
```ts
|
|
13080
|
+
readonly avatar3dId?: string
|
|
13081
|
+
```
|
|
13082
|
+
|
|
13083
|
+
The id of the 3D character the player wears, when they wear one — an
|
|
13084
|
+
Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
|
|
13085
|
+
avatar picker. What a game that draws Arcade avatars keys its character
|
|
13086
|
+
on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
|
|
13087
|
+
to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
|
|
13088
|
+
absent.
|
|
13089
|
+
|
|
13090
|
+
Independent of the portrait: wearing a 3D character never changes
|
|
13091
|
+
`avatarIconId`, and the other way round. Absent means the game's default
|
|
13092
|
+
look. On `gem.player` it changes when the player wears another one, and
|
|
13093
|
+
`onPlayer` runs again; see `gem.openAvatarPicker`.
|
|
13094
|
+
|
|
13095
|
+
<a id="leaderboardentry-avatar3dmodelurl"></a>
|
|
13096
|
+
|
|
13097
|
+
## LeaderboardEntry.avatar3dModelUrl
|
|
13098
|
+
|
|
13099
|
+
```ts
|
|
13100
|
+
readonly avatar3dModelUrl?: string
|
|
13101
|
+
```
|
|
13102
|
+
|
|
13103
|
+
The worn 3D character's model — a binary glTF (`.glb`) with one rig,
|
|
13104
|
+
`root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
|
|
13105
|
+
possibly animation clips. Load it with three.js's `GLTFLoader`, after
|
|
13106
|
+
passing it through [platformIconUrl](#platformiconurl), which pins models to the
|
|
13107
|
+
platform's item host exactly as it pins pictures. Absent when no 3D
|
|
13108
|
+
character is worn.
|
|
13109
|
+
|
|
13110
|
+
<a id="leaderboardentry-avatar3diconurl"></a>
|
|
13111
|
+
|
|
13112
|
+
## LeaderboardEntry.avatar3dIconUrl
|
|
13113
|
+
|
|
13114
|
+
```ts
|
|
13115
|
+
readonly avatar3dIconUrl?: string
|
|
13116
|
+
```
|
|
13117
|
+
|
|
13118
|
+
A rendered portrait of the worn 3D character, for a roster or a menu where
|
|
13119
|
+
loading the model is too much. Not the 2D portrait
|
|
13120
|
+
([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
|
|
13121
|
+
through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
13122
|
+
|
|
12909
13123
|
<a id="leaderboardentry-badges"></a>
|
|
12910
13124
|
|
|
12911
13125
|
## LeaderboardEntry.badges
|
|
@@ -14351,6 +14565,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
|
|
|
14351
14565
|
draw your own placeholder rather than a broken image. Pass it through
|
|
14352
14566
|
[platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
14353
14567
|
|
|
14568
|
+
<a id="playerprofile-avatar3did"></a>
|
|
14569
|
+
|
|
14570
|
+
## PlayerProfile.avatar3dId
|
|
14571
|
+
|
|
14572
|
+
```ts
|
|
14573
|
+
readonly avatar3dId?: string
|
|
14574
|
+
```
|
|
14575
|
+
|
|
14576
|
+
The id of the 3D character the player wears, when they wear one — an
|
|
14577
|
+
Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
|
|
14578
|
+
avatar picker. What a game that draws Arcade avatars keys its character
|
|
14579
|
+
on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
|
|
14580
|
+
to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
|
|
14581
|
+
absent.
|
|
14582
|
+
|
|
14583
|
+
Independent of the portrait: wearing a 3D character never changes
|
|
14584
|
+
`avatarIconId`, and the other way round. Absent means the game's default
|
|
14585
|
+
look. On `gem.player` it changes when the player wears another one, and
|
|
14586
|
+
`onPlayer` runs again; see `gem.openAvatarPicker`.
|
|
14587
|
+
|
|
14588
|
+
<a id="playerprofile-avatar3dmodelurl"></a>
|
|
14589
|
+
|
|
14590
|
+
## PlayerProfile.avatar3dModelUrl
|
|
14591
|
+
|
|
14592
|
+
```ts
|
|
14593
|
+
readonly avatar3dModelUrl?: string
|
|
14594
|
+
```
|
|
14595
|
+
|
|
14596
|
+
The worn 3D character's model — a binary glTF (`.glb`) with one rig,
|
|
14597
|
+
`root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
|
|
14598
|
+
possibly animation clips. Load it with three.js's `GLTFLoader`, after
|
|
14599
|
+
passing it through [platformIconUrl](#platformiconurl), which pins models to the
|
|
14600
|
+
platform's item host exactly as it pins pictures. Absent when no 3D
|
|
14601
|
+
character is worn.
|
|
14602
|
+
|
|
14603
|
+
<a id="playerprofile-avatar3diconurl"></a>
|
|
14604
|
+
|
|
14605
|
+
## PlayerProfile.avatar3dIconUrl
|
|
14606
|
+
|
|
14607
|
+
```ts
|
|
14608
|
+
readonly avatar3dIconUrl?: string
|
|
14609
|
+
```
|
|
14610
|
+
|
|
14611
|
+
A rendered portrait of the worn 3D character, for a roster or a menu where
|
|
14612
|
+
loading the model is too much. Not the 2D portrait
|
|
14613
|
+
([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
|
|
14614
|
+
through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
14615
|
+
|
|
14354
14616
|
<a id="playerprofile-badges"></a>
|
|
14355
14617
|
|
|
14356
14618
|
## PlayerProfile.badges
|
|
@@ -14697,6 +14959,31 @@ Which template to match, by slug. See
|
|
|
14697
14959
|
[CreateRoomOptions.templateSlug](#createroomoptions-templateslug) for where a slug comes from, and why
|
|
14698
14960
|
`'standard'` resolves even before you have authored any config.
|
|
14699
14961
|
|
|
14962
|
+
<a id="quickjoinoptions-templateslugs"></a>
|
|
14963
|
+
|
|
14964
|
+
## QuickJoinOptions.templateSlugs
|
|
14965
|
+
|
|
14966
|
+
```ts
|
|
14967
|
+
readonly templateSlugs?: readonly string[]
|
|
14968
|
+
```
|
|
14969
|
+
|
|
14970
|
+
Several templates this player accepts, by slug — one to eight of them, for
|
|
14971
|
+
a game that offers "any of these modes". Pass it INSTEAD of
|
|
14972
|
+
[QuickJoinOptions.templateSlug](#quickjoinoptions-templateslug), never beside it.
|
|
14973
|
+
|
|
14974
|
+
Open rooms of every listed template are candidates together, and the
|
|
14975
|
+
fullest one is joined. **The order matters only when there is none:** the
|
|
14976
|
+
room that gets created is made from the first slug listed. Read
|
|
14977
|
+
`room.templateSlug` to learn which mode the player landed in.
|
|
14978
|
+
|
|
14979
|
+
Every listed template must be one players can quick-join; one that is not
|
|
14980
|
+
refuses the whole call rather than being skipped.
|
|
14981
|
+
|
|
14982
|
+
```ts
|
|
14983
|
+
const room = await gem.rooms.quickJoin({ templateSlugs: ['duel', 'brawl'] });
|
|
14984
|
+
startMode(room.templateSlug);
|
|
14985
|
+
```
|
|
14986
|
+
|
|
14700
14987
|
<a id="quickjoinoptions-templateid"></a>
|
|
14701
14988
|
|
|
14702
14989
|
## QuickJoinOptions.templateId
|
|
@@ -15476,6 +15763,13 @@ on a ticket, possibly in another tab or another game — and
|
|
|
15476
15763
|
answering. Tell the player; do not loop on it, and do not quietly
|
|
15477
15764
|
substitute `quickJoin`, which puts them in a different kind of room.
|
|
15478
15765
|
|
|
15766
|
+
A party leader can meet three more, when the party could not be seated
|
|
15767
|
+
together: `version_data_required` — the party did not launch this game
|
|
15768
|
+
together; `party_versions_incomplete` — a member's game has not finished
|
|
15769
|
+
starting, so wait a moment and queue again; and `party_version_mismatch`
|
|
15770
|
+
— a member is on a build that cannot play with the leader's, so everyone
|
|
15771
|
+
reloads the game. No ticket was made in any of the three.
|
|
15772
|
+
|
|
15479
15773
|
<a id="roommanager-list"></a>
|
|
15480
15774
|
|
|
15481
15775
|
## RoomManager.list
|
|
@@ -16669,6 +16963,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
|
|
|
16669
16963
|
draw your own placeholder rather than a broken image. Pass it through
|
|
16670
16964
|
[platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
16671
16965
|
|
|
16966
|
+
<a id="roommember-avatar3did"></a>
|
|
16967
|
+
|
|
16968
|
+
## RoomMember.avatar3dId
|
|
16969
|
+
|
|
16970
|
+
```ts
|
|
16971
|
+
readonly avatar3dId?: string
|
|
16972
|
+
```
|
|
16973
|
+
|
|
16974
|
+
The id of the 3D character the player wears, when they wear one — an
|
|
16975
|
+
Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
|
|
16976
|
+
avatar picker. What a game that draws Arcade avatars keys its character
|
|
16977
|
+
on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
|
|
16978
|
+
to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
|
|
16979
|
+
absent.
|
|
16980
|
+
|
|
16981
|
+
Independent of the portrait: wearing a 3D character never changes
|
|
16982
|
+
`avatarIconId`, and the other way round. Absent means the game's default
|
|
16983
|
+
look. On `gem.player` it changes when the player wears another one, and
|
|
16984
|
+
`onPlayer` runs again; see `gem.openAvatarPicker`.
|
|
16985
|
+
|
|
16986
|
+
<a id="roommember-avatar3dmodelurl"></a>
|
|
16987
|
+
|
|
16988
|
+
## RoomMember.avatar3dModelUrl
|
|
16989
|
+
|
|
16990
|
+
```ts
|
|
16991
|
+
readonly avatar3dModelUrl?: string
|
|
16992
|
+
```
|
|
16993
|
+
|
|
16994
|
+
The worn 3D character's model — a binary glTF (`.glb`) with one rig,
|
|
16995
|
+
`root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
|
|
16996
|
+
possibly animation clips. Load it with three.js's `GLTFLoader`, after
|
|
16997
|
+
passing it through [platformIconUrl](#platformiconurl), which pins models to the
|
|
16998
|
+
platform's item host exactly as it pins pictures. Absent when no 3D
|
|
16999
|
+
character is worn.
|
|
17000
|
+
|
|
17001
|
+
<a id="roommember-avatar3diconurl"></a>
|
|
17002
|
+
|
|
17003
|
+
## RoomMember.avatar3dIconUrl
|
|
17004
|
+
|
|
17005
|
+
```ts
|
|
17006
|
+
readonly avatar3dIconUrl?: string
|
|
17007
|
+
```
|
|
17008
|
+
|
|
17009
|
+
A rendered portrait of the worn 3D character, for a roster or a menu where
|
|
17010
|
+
loading the model is too much. Not the 2D portrait
|
|
17011
|
+
([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
|
|
17012
|
+
through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
17013
|
+
|
|
16672
17014
|
<a id="roommember-badges"></a>
|
|
16673
17015
|
|
|
16674
17016
|
## RoomMember.badges
|
|
@@ -17008,6 +17350,20 @@ readonly templateId?: string
|
|
|
17008
17350
|
|
|
17009
17351
|
Which room template from your game config this room was made from.
|
|
17010
17352
|
|
|
17353
|
+
<a id="room-templateslug"></a>
|
|
17354
|
+
|
|
17355
|
+
## Room.templateSlug
|
|
17356
|
+
|
|
17357
|
+
```ts
|
|
17358
|
+
readonly templateSlug?: string
|
|
17359
|
+
```
|
|
17360
|
+
|
|
17361
|
+
The slug of the template this room was made from — the same slug you pass
|
|
17362
|
+
as `templateSlug`. After a `quickJoin` naming several templates, this is
|
|
17363
|
+
how a game learns which mode the player landed in.
|
|
17364
|
+
|
|
17365
|
+
Absent for a room made without a template.
|
|
17366
|
+
|
|
17011
17367
|
<a id="room-roomtype"></a>
|
|
17012
17368
|
|
|
17013
17369
|
## Room.roomType
|
|
@@ -17437,6 +17793,54 @@ The portrait's thumbnail, when there is one. Absent means no portrait —
|
|
|
17437
17793
|
draw your own placeholder rather than a broken image. Pass it through
|
|
17438
17794
|
[platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
17439
17795
|
|
|
17796
|
+
<a id="showcasefriendentry-avatar3did"></a>
|
|
17797
|
+
|
|
17798
|
+
## ShowcaseFriendEntry.avatar3dId
|
|
17799
|
+
|
|
17800
|
+
```ts
|
|
17801
|
+
readonly avatar3dId?: string
|
|
17802
|
+
```
|
|
17803
|
+
|
|
17804
|
+
The id of the 3D character the player wears, when they wear one — an
|
|
17805
|
+
Arcade item of type `avatar_3d`, chosen on the 3D tab of the Arcade's
|
|
17806
|
+
avatar picker. What a game that draws Arcade avatars keys its character
|
|
17807
|
+
on: prefer it, load [PlayerIdentity.avatar3dModelUrl](#playeridentity-avatar3dmodelurl), and fall back
|
|
17808
|
+
to your own mapping of [PlayerIdentity.avatarIconId](#playeridentity-avatariconid) when it is
|
|
17809
|
+
absent.
|
|
17810
|
+
|
|
17811
|
+
Independent of the portrait: wearing a 3D character never changes
|
|
17812
|
+
`avatarIconId`, and the other way round. Absent means the game's default
|
|
17813
|
+
look. On `gem.player` it changes when the player wears another one, and
|
|
17814
|
+
`onPlayer` runs again; see `gem.openAvatarPicker`.
|
|
17815
|
+
|
|
17816
|
+
<a id="showcasefriendentry-avatar3dmodelurl"></a>
|
|
17817
|
+
|
|
17818
|
+
## ShowcaseFriendEntry.avatar3dModelUrl
|
|
17819
|
+
|
|
17820
|
+
```ts
|
|
17821
|
+
readonly avatar3dModelUrl?: string
|
|
17822
|
+
```
|
|
17823
|
+
|
|
17824
|
+
The worn 3D character's model — a binary glTF (`.glb`) with one rig,
|
|
17825
|
+
`root > body > (head, arm_l, arm_r > hand_socket, leg_l, leg_r)`, and
|
|
17826
|
+
possibly animation clips. Load it with three.js's `GLTFLoader`, after
|
|
17827
|
+
passing it through [platformIconUrl](#platformiconurl), which pins models to the
|
|
17828
|
+
platform's item host exactly as it pins pictures. Absent when no 3D
|
|
17829
|
+
character is worn.
|
|
17830
|
+
|
|
17831
|
+
<a id="showcasefriendentry-avatar3diconurl"></a>
|
|
17832
|
+
|
|
17833
|
+
## ShowcaseFriendEntry.avatar3dIconUrl
|
|
17834
|
+
|
|
17835
|
+
```ts
|
|
17836
|
+
readonly avatar3dIconUrl?: string
|
|
17837
|
+
```
|
|
17838
|
+
|
|
17839
|
+
A rendered portrait of the worn 3D character, for a roster or a menu where
|
|
17840
|
+
loading the model is too much. Not the 2D portrait
|
|
17841
|
+
([PlayerIdentity.avatarIconUrl](#playeridentity-avatariconurl)), which is a separate choice. Pass it
|
|
17842
|
+
through [platformIconUrl](#platformiconurl) before putting it in an `<img src>`.
|
|
17843
|
+
|
|
17440
17844
|
<a id="showcasefriendentry-badges"></a>
|
|
17441
17845
|
|
|
17442
17846
|
## ShowcaseFriendEntry.badges
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# The server surface — API reference
|
|
2
2
|
|
|
3
|
-
Generated from `@indiegems/gem-web-sdk/sdk`
|
|
3
|
+
Generated from `@indiegems/gem-web-sdk/sdk` v11.1.0, the version of the package this file ships in. Every symbol below carries an explicit anchor, its `anchor` in `reference.json` beside this file.
|
|
4
4
|
|
|
5
5
|
`@indiegems/gem-web-sdk/sdk` is the one import a game writes, wherever its code runs. `@indiegems/gem-web-sdk/server` exports exactly the symbols on this page and nothing else, for a build that wants only this half.
|
|
6
6
|
|