@indiegems/gem-web-sdk 7.9.0 → 7.9.1
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 +69 -0
- package/dist/gem-web-sdk.esm.js +1 -1
- package/dist/gem-web-sdk.function.js +1 -1
- package/dist/gem-web-sdk.game.js +1 -1
- package/dist/gem-web-sdk.min.js +2 -2
- package/dist/gem-web-sdk.sdk.js +1 -1
- package/dist/gem-web-sdk.server.js +1 -1
- package/docs/api/api-reference-game.md +12 -8
- package/docs/api/api-reference-server.md +1 -1
- package/docs/api/reference.json +3 -3
- package/docs/changelog.md +69 -0
- package/docs/getting-started.md +1 -1
- package/docs/manifest.json +8 -8
- package/docs/server-bundles.md +2 -2
- package/docs/what-a-game-must-do.md +94 -63
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,75 @@ Its entries are grouped under up to five headings:
|
|
|
16
16
|
- **Rebuild**: a type changed. Recompile against the new version; code that compiles today keeps compiling unless the entry says otherwise.
|
|
17
17
|
- **New capability**: something a game can now do. Nothing changes unless you use it.
|
|
18
18
|
|
|
19
|
+
## 7.9.1
|
|
20
|
+
|
|
21
|
+
Upgrading from 7.9.0. Impact: none.
|
|
22
|
+
|
|
23
|
+
Nothing in this release asks anything of a game.
|
|
24
|
+
|
|
25
|
+
## 7.9.0
|
|
26
|
+
|
|
27
|
+
Upgrading from 7.8.1. Impact: required.
|
|
28
|
+
|
|
29
|
+
### Must change
|
|
30
|
+
|
|
31
|
+
- A link your game shares can no longer carry a parameter named build. The Arcade now reads that key for itself and removes it before your game starts, so the share request refuses it with a TypeError that names the key. Rename the parameter if your game shares one by that name.
|
|
32
|
+
|
|
33
|
+
### Rebuild
|
|
34
|
+
|
|
35
|
+
- GemCapability gained gameMenu, and the bridge's message lists and unions in both directions gained the two new menu messages. A switch that assumes it knows every GemCapability value must handle the new one. Other code that compiles today keeps compiling.
|
|
36
|
+
|
|
37
|
+
### New capability
|
|
38
|
+
|
|
39
|
+
- gem.setMenu adds to the Arcade's menu, the one control the Arcade keeps over a game in its top right corner. Give onSettings and the menu gains a settings entry that opens your own settings screen, and give items for up to four entries of your own, each with an id, a label you have already translated and an onSelect handler. Each call is the whole answer and replaces the last, so call it again when the entries change. It returns true when the Arcade was told. After awaitBridge has settled, draw a settings button of your own only when it returns false. The Arcade pauses your game while its menu is open and resumes it before your handler runs.
|
|
40
|
+
|
|
41
|
+
## 7.8.1
|
|
42
|
+
|
|
43
|
+
Upgrading from 7.8.0. Impact: none.
|
|
44
|
+
|
|
45
|
+
Nothing in this release asks anything of a game.
|
|
46
|
+
|
|
47
|
+
## 7.8.0
|
|
48
|
+
|
|
49
|
+
Upgrading from 7.7.0. Impact: recommended.
|
|
50
|
+
|
|
51
|
+
### May stop
|
|
52
|
+
|
|
53
|
+
- The SDK now stops accidental text selection, the long-press copy menu and the tap highlight across your game's document, so a game can drop its own rules for that. Your own style rules always win, and inputs, text areas and editable content stay typeable and selectable. Text a player could select and copy before no longer is, unless your own styles make it selectable. Pass selectableText as true to createGem only if your game is mostly text a player should be able to copy.
|
|
54
|
+
|
|
55
|
+
### New capability
|
|
56
|
+
|
|
57
|
+
- A room says whether it is self-hosted in selfHosted: its dedicated server runs on the machine of the player who created it, as it does in the Gem editor. The SDK asks for such a room on your behalf where the embedder hosts locally, and there is no option for a game to set. It is false on every room a player in the Arcade is in.
|
|
58
|
+
|
|
59
|
+
## 7.7.0
|
|
60
|
+
|
|
61
|
+
Upgrading from 7.6.0. Impact: required.
|
|
62
|
+
|
|
63
|
+
### Must change
|
|
64
|
+
|
|
65
|
+
- In the server API types, occurred_at on a leaderboard row and on an entity leaderboard row is now optional and may be null. Code that assumes it is always a number must handle it missing. LeaderboardResponse and EntityLeaderboardResponse are now written as the shared LeaderboardPeriodFields joined with their own fields, so every field they had is still there.
|
|
66
|
+
|
|
67
|
+
### Rebuild
|
|
68
|
+
|
|
69
|
+
- Server API unions gained values. OrderSource has earning_reset, and InventoryChange has a new earning_limits_reset change. A switch that assumes it knows every OrderSource value or every InventoryChange type must handle the new one. Other code that compiles today keeps compiling.
|
|
70
|
+
- The server API reads getLeaderboard and getEntityLeaderboard accept three more options, periods_back, period and player_id, and the option types GetLeaderboardOptions and EntityLeaderboardOptions now extend the new PeriodOptions. Code that compiles today keeps compiling.
|
|
71
|
+
|
|
72
|
+
### New capability
|
|
73
|
+
|
|
74
|
+
- gem.leaderboards can read a board scoped to one period of a challenge, such as today's board or this week's. Every read takes periodsBack, where 0 is the current period and 1 is the one before, or period, the id of a period from an earlier result. Name at most one of them. A result from such a board carries period, which says which period it is, when it opens and closes, and whether it is final. A serverless function or a dedicated server passes playerId so the board answers for that player's own day. On a board that is not scoped to periods, both selectors are refused rather than ignored.
|
|
75
|
+
|
|
76
|
+
## 7.6.0
|
|
77
|
+
|
|
78
|
+
Upgrading from 7.5.0. Impact: required.
|
|
79
|
+
|
|
80
|
+
### Must change
|
|
81
|
+
|
|
82
|
+
- createGem now throws GemUnframedError when the page is opened on its own instead of inside a frame. Before, such a game constructed and then waited for a bridge that never came, with no player, no saves and no config. Run your game where it is framed and handed an identity: the Arcade, the Gem editor or the Gem dev host. A game that is only ever played there changes nothing. When the framing page is not one the game allows, the refusal is now final: awaitBridge, awaitIdentity, awaitPlayer and awaitCohorts answer at once instead of timing out.
|
|
83
|
+
|
|
84
|
+
### New capability
|
|
85
|
+
|
|
86
|
+
- A serverless function written in JavaScript can use the SDK through a new function entry of the package. createGem there returns the same platform-backed calls a browser game makes, bound to the player who called the function. Nothing is retried, a conditional save is refused before it is sent, and gem.functions and gem.gameConfig throw because a function has neither. This entry is in the package only.
|
|
87
|
+
|
|
19
88
|
## 7.5.0
|
|
20
89
|
|
|
21
90
|
Upgrading from 7.4.2. Impact: required.
|