@idosgames/core 0.10.1 → 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/CHANGELOG.md CHANGED
@@ -14,6 +14,131 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht
14
14
 
15
15
  ## [Unreleased]
16
16
 
17
+ ## [0.12.0] - 2026-09-12
18
+
19
+ Character skins, level-aware crafting, and an exact inventory cache: every response that carries an
20
+ instance delta is now applied in one step, so an unstackable grant no longer shows up twice.
21
+ Breaking — see below.
22
+
23
+ ### Breaking
24
+
25
+ - **Item `CustomData` is a string map, not a string.** `ItemDefinition.CustomData` and the
26
+ unstackable instance's `CustomData` are now `Record<string, string>` — the shape the engine
27
+ actually sends. Read the keys directly instead of parsing a string.
28
+
29
+ ### Added
30
+
31
+ - **Character skins** — `client.character.unlockSkin(characterID, skinID, { selectedOptionID,
32
+ payment, autoEquip })`, `equipSkin`, `unequipSkin`, `getCharacterSkins`; exports `SKIN_SLOT`,
33
+ `isReservedSlot`, `SKIN_ALREADY_OWNED`; events `character:skinUnlocked` / `skinEquipped` /
34
+ `skinUnequipped`. A skin is an item equipped in `Equipment[SKIN_SLOT]` — hide `@` keys from slot
35
+ UIs with `isReservedSlot`, but keep them in Power. Draw the "Buy" button from
36
+ `getCharacterSkins().Purchasable`, not from config. `SKIN_ALREADY_OWNED` is a normal outcome,
37
+ not an error. Skill `character-system` (section "Skins").
38
+ - **Craft output level** — `CraftDefinition.OutputLevelMode` / `InputSelection` /
39
+ `OutputLevelOverflow` (string enums exported as `CraftOutputLevelMode`,
40
+ `CraftInputSelectionMode`, `CraftOutputLevelOverflow`), `CraftSingleResult.OutputLevel` /
41
+ `BurnedInstances`, and `craft(…, inputInstanceIDs?)` for `ClientSelected` recipes. ⚠
42
+ `inputItemIDs` are catalog `ItemID`s, never instances. An unknown setting value from a newer
43
+ engine falls back to its default instead of failing the whole definitions parse.
44
+ - **`Inventory` instance delta** on every response that carries one (and on `zBatchResponse`),
45
+ applied through `UserData.applyResourcesWithDelta`.
46
+
47
+ ### Fixed
48
+
49
+ - An unstackable grant (lootbox, skin purchase, …) no longer appears twice in the cache, and a
50
+ spend no longer drops an extra copy: the delta now reconciles the cache's guesses instead of
51
+ being applied on top of them.
52
+ - `purchase.validatePurchasesBatch` now applies every granted receipt to the cache — it applied
53
+ nothing before.
54
+
55
+ ## [0.11.0] - 2026-09-10
56
+
57
+ Player chat, the creator reward programme, and push notifications all land at once, alongside a
58
+ from-scratch Store rewrite and the removal of DealOffer's pre-`Purchase`-module legacy. Breaking —
59
+ see below.
60
+
61
+ ### Breaking
62
+
63
+ - **DealOffer sheds its pricing/ads legacy and moves to blocks.** `DealOfferGraphMode`/
64
+ `DealOfferDefinition.GraphMode` are gone — the graph's shape is now derived from
65
+ `RootNodeIDs`/`NextNodeIDs`/`ChoiceGroupID`, never declared, so it cannot disagree with how the
66
+ offer actually plays. `DealPurchaseActionDefinition`/`DealNodeActionDefinition.Purchase` are
67
+ gone — a node's price is `DealNodeDefinition.PriceOptions` like everywhere else on the platform,
68
+ and a node with a price and no options no longer silently charges nothing. Rewarded-video
69
+ `AdPlacementID`/`RequireServerVerification` are gone — a video watch is now an ordinary
70
+ `RewardedVideoCredit` price, verified structurally by `Advertising`, not by a flag nobody read.
71
+ `DealOfferDefinition`'s flat fields (`Name`, `Description`, `Milestones` as a dict,
72
+ `MilestoneClaimMode`, `MilestoneToken`, `AssetPaths`, `Metadata`) are replaced by
73
+ `Identity`/`Availability`/`Behaviour`/`Graph`/`Milestones`/`Pricing`/`Reward` blocks plus
74
+ `PresetBindings` — same shape as `Character`/`Store`. Read node/offer pricing and milestone
75
+ settings from the blocks; the server resolves "not set" (inherit the preset) vs. "set" (final,
76
+ including empty) — there is no client-side default to fall back on.
77
+ - **`CurrencyConversion.FeePercent` is now `Fee`, and it is a FRACTION** — `0.05` means 5%, not
78
+ `5`. Same platform-wide `Percent` → `Rate`-family rename as `SpendRewardDefinition.Rate` in
79
+ 0.10.0; render a percentage if you like, but keep the wire value a fraction.
80
+ - **`CryptoNetworkBinding.MinDeposit` and `.WithdrawFee` are gone.** Dropped on the server; nothing
81
+ here read them, so there is no replacement to reach for.
82
+
83
+ ### Added
84
+
85
+ - **`client.chat`** (`ChatService`) — title channels and 1-on-1 conversations: `getChatDefinitions`,
86
+ `getChannels`, `poll`, `getHistory`, `sendMessage`, `sendDirect`, `openDirectChannel`,
87
+ `getConversations`, `markRead`, `joinChannel`, `leaveChannel`, `reportMessage`, `ignoreUser`,
88
+ `unignoreUser`, plus `chat:*` events. ⚠ One `poll()` covers ALL rooms and never marks anything
89
+ read — looping per channel or per tick multiplies the publisher's API bill for nothing. Port of
90
+ the engine's `Chat` module. Skill `chat-system`.
91
+ - **`client.communityMarketing`** (`CommunityMarketingService`) — the game's half of the creator
92
+ reward programme: `getState`, `getEarnings`, `claim`, `withdrawCryptoReward`,
93
+ `checkJoinEligibility` (only meaningful for `Automatic` participation mode), plus
94
+ `communityMarketing:*` events. ⚠⚠ `Granted` is the promise, `Earned`/`Mature` are estimates that
95
+ can fall as a platform scrubs fake engagement — `Claimable` is derived from `Granted`, never
96
+ `Mature`. A crypto reward never touches the in-game balance (`withdrawCryptoReward`, not
97
+ `claim`) and debits the programme pool the moment the voucher is issued, before anything reaches
98
+ the chain — an interrupted withdrawal is finished by `TitleTransactionID`, never retried as a
99
+ fresh request. Port of the engine's `CommunityMarketing` module. Skill
100
+ `community-marketing-system`.
101
+ - **`client.push`** (`PushService`) — `getConfig`, `getState`, `subscribe`, `unsubscribe`,
102
+ `unsubscribeByHash`, `getSubscriptions`, plus the `push:configLoaded` / `push:subscribed` /
103
+ `push:unsubscribed` events. Port of the engine's `Push` module.
104
+ - **`templates/host-starter/public/sw.js`** — a service worker the game OWNS, shipped in the seed.
105
+ ⚠ It has no `fetch` handler and must never get one: a cached `index.html` points at
106
+ content-hashed chunks the next deploy deletes, and the player gets a white screen from inside
107
+ their own browser, where neither a CDN purge nor Ctrl+F5 reaches.
108
+ - Skill `push-notifications`.
109
+ - **`client.store.getStorefront()`** (`StoreService`) — the shop as this player sees it right now:
110
+ resolved rotation, per-slot refresh timers, first-purchase/sold-out badges and remaining limits.
111
+ ⚠ Draw this, not `getDefinitions()` — rotation is recomputed by the server on every read and
112
+ nothing here can be derived on the client. Also `cachedStorefront`, `nextRefreshAtUtc()`, and a
113
+ new `store:storefrontLoaded` event. `StoreService.purchase()` gains an optional `slot` (
114
+ `storeID`/`sectionID`/`slotID`) so a pooled product's per-window cap applies unambiguously; the
115
+ server re-checks the roll either way and answers a stale card with `OFFER_NOT_IN_ROTATION` —
116
+ reload the shop on that code, do not show it as an error. Full model surface for the new
117
+ `Stores -> Layout.Sections -> Slots` tree and the `StoreOffers` catalog (`StoreDefinition`,
118
+ `StoreSlotDefinition`, `StorefrontView` and friends) is now exported from the package root.
119
+ Rewritten skill `store-system`.
120
+
121
+ ### Changed
122
+
123
+ - **`PlaytimeTracker`'s idle threshold is now 30 minutes, not 5** — matches the server's session
124
+ boundary (`Usage.SessionIdleTimeoutMinutes`, the same rule Firebase/GA4 use) and the Unity SDK.
125
+ The server decides session COUNT from the gap in the player's own activity and ignores the
126
+ client's flag either way; the constant still matters for `SessionDurationSeconds`, so web and
127
+ mobile numbers stay comparable.
128
+
129
+ ### Notes
130
+
131
+ - ⚠⚠ **`subscribe()` must run from a real tap.** Browsers reject the permission prompt outside a
132
+ user gesture, and Chrome permanently blocks an origin after a few dismissals — an automatic
133
+ prompt does not merely fail, it removes the player's ability to ever say yes.
134
+ - ⚠⚠ **Inside the portal iframe the browser blocks the prompt outright**, so `subscribe()` asks
135
+ the website to subscribe on its own top-level document; the engine still does the sending.
136
+ `PushSubscribeResult.Where` says which path ran.
137
+ - The VAPID public key arrives from the server, never baked into the build; `EndpointHash` comes
138
+ from the server and is never computed on the client.
139
+ - ⚠ **Chat's cloned/group channel type is scaffolded but has no provider yet** — the engine has no
140
+ concept of clans, so a `Group` channel is hidden rather than shown empty until one exists.
141
+
17
142
  ## [0.10.0] - 2026-08-31
18
143
 
19
144
  Where a player came from is now captured and delivered automatically, and playtime finally reaches