Every purchase creates its own entry, so buying the same item twice gives you two. Each entry carries a
server-set status (unused, used, or revoked after a refund) and used_at. Using an item, which
the SDKs call consuming it, marks its entry used.A purchase is never charged twice, and never queued offline. Inventory is always fetched fresh; the
catalog is cached and served offline, so treat a displayed price as advisory until the purchase succeeds.Items can also cost real money, paid through the App Store or Google Play on a phone: see
In-App Purchases. On Windows, macOS, Linux and WebGL they are paid
through a web checkout: see Web Payments.
A purchase names a shop item by its id: the id of the item inside its shop. It is not the
item’s name, and it is not the shop’s id. Read it from the shop rather than typing it in: the SDK
lists the shops of the Game Version your build runs, each with its items. Unreal’s generated shop
items carry the id already.A shop belongs to one Game Version, so a shop made under another version is not listed and cannot be
found by name. If the list comes back empty, check the dashboard shows the shop under the Game Version
your build runs.
A wallet is made when the player registers. The server builds each player’s wallet from the
Game Version’s currency template at registration, with every currency starting at zero. Create the
currency template before your test player registers; a player who registered before it existed has no
wallet to pay from. A player whose wallet was made under another Game Version keeps it: at sign-in the
server moves it to this version’s currency template, balances kept and new currencies at zero. See
Currencies and Wallets.
When a call fails, the SDK’s text says what is wrong and how to fix it. A purchase given the item’s
name instead of its id reads:
Shop item with ID 'GoldItem' not found [shop_item.shop_item_not_found, HTTP 404]Fix: ... take the shop item's Id ..., not the item's name or the shop's id.
A request.not_found 404 whose reason is a bare Not Found means the request reached no route at all (any other
reason names a record the route did not find): the API URL must be the Flock
server’s address alone, with no /v1 or other path after it.
Purchases grant their contents server-side. Give a shop item a type of Currency pack or
Consumable and attach rewards to it, and the server credits the player as part of the same
transaction that debits the price. Neither half can happen without the other, and the client never
decides what was granted — so a modified client cannot award itself anything, and a dropped
connection cannot leave a player charged with nothing to show for it.A Standard item is the older behaviour and still the default: it debits the price and records
an inventory entry your game interprets however it likes. The wallet sells a standard item again
on every purchase, so before offering one, check the player does not hold it already. (A store
sells it only once: see In-App Purchases.)
Dashboard
Unity
Unreal
An item is priced in a currency, so first create the currency config of this Game Version (see
Currencies and Wallets). Without one, the shop’s items say Add a
currency config to enable item creation, with Go to Currencies.
In the menu at the top of the page, choose your game and the Game Version your build runs. A shop
belongs to that one version.
Open Monetization → Shops. Under Your Shops, press New.
Type the Shop Name, leave Status at Active, and press Create Shop. Success: the
page says Shop created. Add your first item. and the shop is listed under Your Shops.
With the shop selected, open its Items tab and press Add Item.
In New Item, fill in:
Item Name, and Status (Active to sell it).
Item type, which decides what the player gets:
Standard adds an entry to the player’s inventory and grants nothing more; your game decides
what it means. A wallet sells it again on every purchase.
Currency pack pays its rewards straight into the player’s wallet when bought, with no
inventory entry.
Consumable sits unused in the player’s inventory and pays its rewards when your game
consumes it.
Price and Currency. In a game currency the price is a whole number, such as 50. In a
real currency, type it as the player sees it, such as 4.99: the server keeps it in the
currency’s smallest unit, so the SDK reads 499.
Store product IDs (App Store, Google Play): only for an item sold inside a mobile app
(see In-App Purchases).
Rewards, for a currency pack or a consumable: press Add reward, pick a currency other than
the price’s, and enter a whole Amount above zero. A pack needs a second currency in the
currency config.
Press Add Item. Success: the item shows in Shop Items with its price and currency, its
rewards, and Real money when a real currency prices it.
Preview as player shows the shop as a player sees it. A version deployed to Production is
locked: its shops and items are read-only there and change only through a patch.
Monetization → Shops: a shop's Items tab, with Add Item.
One call buys any item: Shop.PurchaseAsync(item.Id). An item priced in a game currency is paid
from the wallet; a real-money item goes through the store (see
In-App Purchases). Every example below is the signed-in
player’s and runs inside an async method; "Main Shop" stands for your shop’s name.The player needs a wallet to pay from. A test player made in the Quickstart before
your currency template existed has none: call FlockClient.Instance.Authentication.Logout() once,
then delete the device ID the SDK keeps (the file Flock/device_id.txt under
Application.persistentDataPath) or pass a new device ID of your own, such as
Guid.NewGuid().ToString(), and press Play again to register a new player. Then give it currency
with AddGameFundsAsync; Currencies and Wallets has both steps in
full.Show the shop. Read the items, the wallet and what the player owns once, then draw each item.
using System.Collections.Generic;using Flock;using Flock.Models;// The shop item's id from its shop: not the item's name, and not the shop's id.Shop shop = await FlockClient.Instance.Shop.GetByNameAsync("Main Shop");FlockWallet wallet = await FlockClient.Instance.Player.GetWalletAsync();IReadOnlyDictionary<string, int> owned = await FlockClient.Instance.Shop.GetOwnedItemCountsAsync();foreach (ShopItem item in shop.ShopItems){ owned.TryGetValue(item.Id, out int count); string price = $"{item.Price} {item.Currency}"; // e.g. "20 Gold" bool canPay = item.IsRealMoney || wallet.CanAfford(item); // grey out what the wallet cannot pay for bool alreadyHeld = item.Type == ShopItemTypes.Standard && count > 0; // the wallet would sell it again}
In the examples below, item, potion and sword are ShopItems read from the shop as above.Buy an item. The answer says what was granted and the wallet afterwards.
using Flock;using Flock.Models;using UnityEngine;PurchaseResult bought = await FlockClient.Instance.Shop.PurchaseAsync(item.Id);foreach (ShopItemReward reward in bought.Granted) Debug.Log($"+{reward.Amount} {reward.Code}"); // e.g. +500 Goldlong gold = bought.Balances?.BalanceOf("Gold") ?? 0; // null when no currency movedPlayerInventory entry = bought.Inventory; // null for a currency pack
When the purchase does not go through. A purchase that buys nothing throws. Three cases cover a
shop screen:
using Flock;using Flock.Exceptions;using UnityEngine;try{ await FlockClient.Instance.Shop.PurchaseAsync(item.Id);}catch (FlockException e) when (e.ErrorCode == FlockErrorCode.ShopInsufficientFunds){ // Not enough of the item's currency: nothing was bought. Tell the player.}catch (FlockException e) when (e.OutcomeUnknown){ // No answer said whether it went through, so it may have. Read the wallet and // the inventory again before offering it again.}catch (FlockException e){ Debug.LogWarning(e.Message); // what went wrong, then a "Fix:" line saying how to fix it}
A purchase whose answer never came (a dropped connection, a timeout, a server error) is sent again
by itself, under one key the server uses to answer a repeat with the first purchase, so the player
pays once. A new PurchaseAsync call is a new purchase. OutcomeUnknown is true when no answer
said whether it went through.Use a consumable.ConsumeOneAsync uses one of a shop item the player holds and grants what it
holds.
using Flock;using Flock.Exceptions;using Flock.Models;using UnityEngine;try{ ConsumeResult used = await FlockClient.Instance.Shop.ConsumeOneAsync(potion.Id); foreach (ShopItemReward reward in used.Granted) Debug.Log($"+{reward.Amount} {reward.Code}");}catch (FlockValidationException){ // The player holds none (it may have been used on another device).}catch (FlockException e) when (e.OutcomeUnknown){ // No answer came, so it may have been used: read the inventory again.}
Using an item is never sent twice by itself. To use one particular entry, pass its id:
ConsumeAsync(entry.Id).Does the player own it?
using Flock;bool hasSword = await FlockClient.Instance.Shop.OwnsAsync(sword.Id); // an unused entry of the item
With generated code. After Sync Schemas (the Code Generation tab of Flock → Settings),
every item has a typed id in FlockShopItemId, named after the item. These names exist only once you
have synced, and only for the items of your own shops: GoldPack, Potion and Sword here are
examples.
using Flock;using Flock.Generated.Shops;await FlockClient.Instance.Shop.PurchaseAsync(FlockShopItemId.GoldPack);await FlockClient.Instance.Shop.ConsumeOneAsync(FlockShopItemId.Potion);bool hasSword = await FlockClient.Instance.Shop.OwnsAsync(FlockShopItemId.Sword.ShopItemId());
A purchase or a use that reports a wallet also writes it into the cached player data, so the next
wallet read shows the new balance. To show what an item will give before the player buys it, read
ShopItem.Rewards; Granted and Rewards are never null.
Code
What happened
What to do
ShopInsufficientFunds
The player cannot afford the item
Read the wallet before offering it
ShopCurrencyNotHeld
The wallet has no balance in the item’s currency
Price it in a currency of the wallet’s template
ShopWalletNotFound
The player has no wallet in this Game Version
Create the currency template, then register the player
ShopItemShopItemNotFound
No item has that id
Pass ShopItem.Id from its shop
ShopItemNotForSale
The item, or its shop, is set to Inactive in the dashboard
Read the shop again, which leaves it out; set it back to Active to sell it
PlayerInventoryAlreadyUsed
That entry was used already
Read the inventory again
Browse with the Flock | Shop nodes, or the shop provider in C++. An item’s free-form data and
stats read by dotted path, so no JSON parsing node is needed.Purchase completes with everything the purchase produced — what was granted, the wallet
afterwards, and the inventory entry if the item created one.An item priced in a game currency is paid from the player’s wallet at once. An item priced in a
currency your currency config lists as real money (for the Game Version the game sends) goes through the store the game connected with
UFlockStore::Connect (Flock Connect Store in Blueprint): the phone’s store (see In-App Purchases),
or a web checkout on Windows, macOS and Linux (see Web Payments). With no
store connected, it is refused and nothing is charged.
Purchase by picking a generated item — the ID is baked in and cannot be mistyped.
Read the shop. In C++, read the shop item’s id from its shop: Purchase takes
FFlockShopItem::Id, not the item’s name and not the shop’s id.
#include "FlockSubsystem.h"#include "Providers/FlockPlayerProvider.h"#include "Providers/FlockShopProvider.h"UFlockSubsystem* Sdk = UFlockSubsystem::Get(this); // this: any object in the game's worldSdk->GetShopProvider()->GetByName(TEXT("Main Shop"), [](TFlockResult<FFlockShop> Shop) { for (const FFlockShopItem& Item : Shop.Value.ShopItems) { // Item.Id is what Purchase takes; Item.Name is for showing the player. } });
Read a shop by its name and walk its items: each item's Id is what Flock Purchase takes.
Show the shop. Read the wallet and what the player holds once, then decide per item. The wallet
comes from the player-data cache, which purchases keep current; the inventory is read from the server
on every call, so read the counts once for a whole screen.
// Items: the shop items the screen shows, read from their shop as above.const TWeakObjectPtr<UFlockSubsystem> Flock = Sdk;Sdk->GetPlayerProvider()->GetWallet([Flock, Items](TFlockResult<FFlockWallet> Wallet){ if (!Wallet.bSuccess || !Flock.IsValid()) { return; } Flock->GetShopProvider()->GetOwnedItemCounts([Balances = Wallet.Value, Items](TFlockResult<FFlockOwnedItemCounts> Owned) { if (!Owned.bSuccess) { return; } for (const FFlockShopItem& Item : Items) { const int32 Held = Owned.Value.CountOf(Item.Id); // unused entries the player holds const bool bCanBuy = Balances.CanAfford(Item); // false for a real-money item // The wallet sells a standard item again on every purchase: offer it only while Held is 0. } });});
Buy.
// ItemId: the Id of an item read from its shop, as above.Sdk->GetShopProvider()->Purchase(ItemId, [](TFlockResult<FFlockPurchaseResult> Bought) { if (!Bought.bSuccess) { if (Bought.Error.ErrorCode == EFlockErrorCode::ShopInsufficientFunds) { // The server declined — show the player, don't retry. } else if (Bought.Error.bOutcomeUnknown) { // No answer said whether it was bought: read the wallet and inventory before offering it again. } // What went wrong, then a "Fix:" line saying how to fix it. UE_LOG(LogTemp, Warning, TEXT("%s"), *Bought.Error.ToDisplayText()); return; } for (const FFlockShopItemReward& Reward : Bought.Value.Granted) { // e.g. +500 GOLD. Ask the reward, never compare Type to a typed-out "currency": // the server owns that set and can add kinds. if (Reward.IsCurrency()) { /* Reward.Code, Reward.Amount */ } } // Both may legitimately be absent, so ask rather than testing the Id yourself. if (Bought.Value.HasWallet()) { /* Bought.Value.Wallet — balances after the grant */ } if (Bought.Value.HasInventoryRow()) { /* Bought.Value.Inventory — the row the player owns */ } });
A currency pack pays straight into the wallet and creates no inventory entry — HasInventoryRow()
is false, which is the legitimate no-row case rather than an error. A Consumable does the
opposite: it lands in the inventory and grants when the player spends it.
// InventoryId: an entry's Id from GetPlayerInventory.Sdk->GetShopProvider()->Consume(InventoryId, [](TFlockResult<FFlockConsumeResult> Consumed) { for (const FFlockShopItemReward& Reward : Consumed.Value.Granted) { /* +Amount Code */ } });// Or use up one entry of a shop item the player holds, without reading the inventory yourself.Sdk->GetShopProvider()->ConsumeOne(PotionItemId, [](TFlockResult<FFlockConsumeResult> Used) { /* Used.Value.Granted */ });// Whether the player holds one: a standard item bought and not used up.Sdk->GetShopProvider()->Owns(PotionItemId, [](TFlockResult<bool> Holds) { /* Holds.Value */ });
PotionItemId is a shop item’s Id. ConsumeOne reads the inventory and uses the first unused
entry of that item, passing over one used meanwhile on another device; any other failure stops it, so
one call never uses two. It fails (Validation) when the player holds none. Owns reads the whole
inventory. With nobody signed in, ConsumeOne fails (Auth) and Owns fails (Validation, saying
to sign in first). Consume is not refused by the SDK: it is sent as it is, so call it only while a
player is signed in.In Blueprint these are Flock Purchase, Flock Consume Inventory Item, Flock Consume One,
Flock Owns Shop Item and Flock Get Owned Item Counts. For a shop screen, read the wallet with
Flock Get Wallet (under Flock | Player) and the owned counts once, then ask per item Can
Afford (wallet, item) and Owned Count Of (counts, item id). Break the purchase result for
Inventory, Granted and Wallet, and use the nodes that have no execution pins rather than testing fields yourself: Has
Inventory Row before reading the row, and Is Currency Reward to branch on a reward kind. Comparing
a reward’s Type to a hand-typed string is the one mistake worth guarding against — a typo reads as
“not a currency reward” and silently skips the grant. A purchase or consume that reports a wallet also
writes it into the cached player data.Granted is never null — an item that grants nothing returns an empty list. To show what an item
will give before the player buys it, read Rewards from the catalog item.A declined purchase fails the result rather than throwing — check Error.ErrorCode for
EFlockErrorCode::ShopInsufficientFunds to tell “can’t afford it” apart from a network failure.A purchase is never bought twice. Every attempt of one Purchase call carries the same key, so
an answer that never came is sent again and the server answers the repeat with the first purchase. A
second Purchase call is a second purchase. When no answer said whether it went through, the failure
has bOutcomeUnknown set (Outcome Unknown on the Blueprint error): read the wallet and inventory
before offering the item again. That is for an item paid from the wallet; a real-money item whose
outcome is unknown is handled as In-App Purchases says.
A consume is never sent again after an ambiguous failure, since it
carries no key and a repeat would grant twice; it reports bOutcomeUnknown the same way.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Qwacks","description":"Developer documentation for the Qwacks platform — Flock, Protokite, and Data Duck.","colors":{"primary":"#0099FF","light":"#33ADFF","dark":"#0077CC"},"logo":{"light":"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9","dark":"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9"},"favicon":"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9","appearance":{"default":"dark","strict":true},"background":{"image":{"light":"https://mintcdn.com/qwacks/YCE61raZ52-QoE_F/officalbg.jpg?fit=max\u0026auto=format\u0026n=YCE61raZ52-QoE_F\u0026q=85\u0026s=5be5500ff5788565cf90d6a3e2111d47","dark":"https://mintcdn.com/qwacks/YCE61raZ52-QoE_F/officalbg.jpg?fit=max\u0026auto=format\u0026n=YCE61raZ52-QoE_F\u0026q=85\u0026s=5be5500ff5788565cf90d6a3e2111d47"},"color":{"light":"#FFFFFF","dark":"#181E2E"}},"navbar":{"links":[{"href":"https://www.qwacks.com/pricing","label":"Pricing"},{"href":"https://github.com/QwackStack/FlockUnitySdk/releases","label":"Unity SDK"},{"href":"https://github.com/QwackStack/FlockUnrealSdk/releases","label":"Unreal SDK"}],"primary":{"type":"button","label":"Dashboard","href":"https://flock-saas.qwacks.com"}},"fonts":{"heading":{"family":"Readex Pro"},"body":{"family":"Inter"}},"styling":{"latex":false},"navigation":{"languages":[{"language":"en","default":true,"href":"welcome"},{"language":"ar","navbar":{"links":[{"href":"https://www.qwacks.com/pricing","label":"الأسعار"},{"href":"https://github.com/QwackStack/FlockUnitySdk/releases","label":"حزمة Unity"},{"href":"https://github.com/QwackStack/FlockUnrealSdk/releases","label":"حزمة Unreal"}],"primary":{"type":"button","label":"لوحة التحكم","href":"https://flock-saas.qwacks.com"}},"href":"ar/welcome"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"qwacks","hasAudioNarration":false,"actualSubdomain":"qwacks","customDomains":["docs.qwacks.com"],"gitSource":{"type":"github","owner":"qwackstack","repo":"qwacksdocs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6af5a22514affe1bdef08994","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"ar","tag":"Flock","count":32},{"language":"en","tag":"Flock","count":32},{"language":"ar","tag":"الميزات","count":23},{"language":"en","tag":"Features","count":23},{"language":"ar","tag":"Qwacks","count":12},{"language":"en","tag":"Qwacks","count":12},{"language":"ar","tag":"بدء الاستخدام","count":11},{"language":"en","tag":"Getting Started","count":11},{"language":"ar","tag":"اللعب الجماعي","count":5},{"language":"ar","tag":"Protokite","count":5},{"language":"ar","tag":"المدفوعات والفوترة","count":5},{"language":"en","tag":"Multiplayer","count":5},{"language":"en","tag":"Protokite","count":5},{"language":"en","tag":"Payments \u0026 Billing","count":5},{"language":"ar","tag":"اللاعبون","count":4},{"language":"ar","tag":"الاقتصاد والمدفوعات","count":4},{"language":"en","tag":"Players","count":4},{"language":"en","tag":"Economy and Payments","count":4},{"language":"ar","tag":"المفاهيم","count":3},{"language":"en","tag":"Concepts","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":".nav-logo{height:2.5rem!important;max-width:none!important}#topbar-cta-button .bg-primary-dark{background-color:#feca13!important}#topbar-cta-button:hover .bg-primary-dark{background-color:#f89c1c!important}#topbar-cta-button a,#topbar-cta-button a *{color:#1a1206!important}.qwacks-lang-toggle{display:inline-flex;align-items:center;align-self:center;gap:0.5rem;padding:0.25rem 1rem;border:1px solid rgba(255, 255, 255, 0.1);border-radius:56px;background:transparent;color:#fafafa;font-family:\"Readex Pro\", sans-serif;font-size:0.875rem;line-height:1.25rem;white-space:nowrap;margin-inline-start:auto;margin-inline-end:1rem}.qwacks-lang-toggle__option{color:inherit;text-decoration:none;font-weight:400;opacity:0.3}.qwacks-lang-toggle__option:hover{opacity:0.7}.qwacks-lang-toggle__option.is-active{font-weight:700;opacity:1}@media (min-width: 1024px){#localization-select-trigger{display:none!important}}:is(h1,h2,h3,h4){position:relative}:is(h1,h2,h3,h4)>div.absolute{left:auto;right:auto;inset-inline-end:0}:is(h1,h2,h3,h4)>div.absolute>a{margin-inline:0!important}"},{"filePath":"rtl.css","content":"html[data-current-path^=\"/ar\"]{direction:rtl}[dir=\"rtl\"]{direction:rtl}html[lang=\"ar\"]{direction:rtl}@media (min-width: 1024px){html[lang=\"ar\"] .lg\\:-ml-12{margin-left:0;margin-right:-3rem}html[lang=\"ar\"] .lg\\:pl-\\[5\\.7rem\\]{padding-left:0.25rem;padding-right:5.7rem}html[lang=\"ar\"] .lg\\:pl-\\[23\\.7rem\\]{padding-left:0.25rem;padding-right:23.7rem}}[dir=\"rtl\"] :is(pre,code,kbd,samp){direction:ltr;text-align:left}[dir=\"rtl\"] :not(pre)>code{unicode-bidi:isolate}[dir=\"rtl\"] pre>*{direction:ltr}[dir=\"rtl\"] .pl-3\\.5{padding-left:0;padding-right:0.875rem}[dir=\"rtl\"] .pl-3{padding-left:0;padding-right:0.75rem}[dir=\"rtl\"] .pl-4{padding-left:0;padding-right:1rem}[dir=\"rtl\"] .pr-3{padding-right:0;padding-left:0.75rem}[dir=\"rtl\"] .pr-4{padding-right:0;padding-left:1rem}[dir=\"rtl\"] .pr-8{padding-right:0;padding-left:2rem}[dir=\"rtl\"] .ml-2{margin-left:0;margin-right:0.5rem}[dir=\"rtl\"] .ml-4{margin-left:0;margin-right:1rem}[dir=\"rtl\"] .-ml-4{margin-left:0;margin-right:-1rem}[dir=\"rtl\"] .-ml-10{margin-left:0;margin-right:-2.5rem}[dir=\"rtl\"] .mr-2{margin-right:0;margin-left:0.5rem}[dir=\"rtl\"] .mr-4{margin-right:0;margin-left:1rem}[dir=\"rtl\"] .text-left{text-align:right}[dir=\"rtl\"] .text-right{text-align:left}[dir=\"rtl\"] .left-0{left:auto;right:0}[dir=\"rtl\"] .right-0{right:auto;left:0}[dir=\"rtl\"] .space-x-2>:not([hidden])~:not([hidden]),[dir=\"rtl\"] .space-x-3>:not([hidden])~:not([hidden]),[dir=\"rtl\"] .space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 1}[dir=\"rtl\"] .border-l{border-left-width:0;border-right-width:1px}[dir=\"rtl\"] .border-r{border-right-width:0;border-left-width:1px}@media (min-width: 1024px){[dir=\"rtl\"] .lg\\:-ml-12{margin-left:0;margin-right:-3rem}}[dir=\"rtl\"] :is(ul,ol){padding-left:0;padding-right:1.5rem}[dir=\"rtl\"] blockquote{border-left:0;border-right:4px solid currentColor;padding-left:0;padding-right:1rem}[dir=\"rtl\"] :is(th,td){text-align:right}[dir=\"rtl\"] .steps{margin-left:0;margin-right:0.875rem}[dir=\"rtl\"] .step>.absolute:not(.w-px){margin-left:0;margin-right:-13px}[dir=\"rtl\"] .step>:not(.absolute){padding-left:1px;padding-right:2rem}[dir=\"rtl\"] #table-of-contents{padding-inline-start:0.75rem;scrollbar-gutter:stable}[dir=\"rtl\"] #sidebar-content a[style*=\"padding-left\"]{padding-left:0!important;padding-right:1rem!important}[dir=\"rtl\"] .card .absolute{right:auto;left:1.25rem}[dir=\"rtl\"] .card .absolute svg{transform:scaleX(-1)}[dir=\"rtl\"] :is(.qwacks-flip-icon,[data-flip-rtl]) svg{transform:scaleX(-1)}[dir=\"rtl\"] #topbar-cta-button svg{transform:scaleX(-1)}[dir=\"rtl\"] .qwacks-lang-toggle svg{transform:none}[dir=\"rtl\"],[dir=\"rtl\"] body{font-family:\"Readex Pro\", system-ui, sans-serif;letter-spacing:normal;line-height:1.85}[dir=\"rtl\"] :is(h1,h2,h3,h4,h5,h6){font-family:\"Readex Pro\", system-ui, sans-serif;letter-spacing:normal;line-height:1.5}[dir=\"rtl\"] :is(pre,code,kbd,samp){font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;line-height:1.6}[dir=\"rtl\"]{font-variant-numeric:lining-nums}"}],"page":{"pagePath":"guides/shops-and-inventory","slug":"/guides/shops-and-inventory","pageMetadata":{"title":"Shops and Inventory","description":"Sell items and track what each player owns.","href":"/guides/shops-and-inventory"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Sell items and track what each player owns.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];const Scope=({children})=>{const{Info}=_provideComponents()||{};if(!Info)_missingMdxReference(`Info`,true);return _jsxs(Info,{children:[_jsx(`b`,{children:`Scope:`}),` `,children]})};function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Frame,Heading,Note,OptimizedImage,Tab,Table,Tabs,_MdxComponentBoundary}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Frame)_missingMdxReference(`Frame`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!OptimizedImage)_missingMdxReference(`OptimizedImage`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);if(!_MdxComponentBoundary)_missingMdxReference(`_MdxComponentBoundary`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Flock’s economy has three pieces:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Shops`}),` — collections of purchasable items.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Shop items`}),` — individual offers with a price and currency.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Inventory`}),` — a record of what each player has purchased.`]}),`\n`]}),`\n`,_jsx(_MdxComponentBoundary,{name:`Scope`,children:_jsxs(Scope,{children:[`shops and items are defined per `,_jsx(_components.strong,{children:`game version`}),`; inventory is per player.`]})}),`\n`,_jsx(_components.p,{children:`A purchase debits the player’s wallet and records an inventory entry:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Shop item ──purchase──▶ wallet debit ──▶ inventory entry`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Every purchase creates its own entry, so buying the same item twice gives you two. Each entry carries a\nserver-set `,_jsx(_components.code,{children:`status`}),` (`,_jsx(_components.code,{children:`unused`}),`, `,_jsx(_components.code,{children:`used`}),`, or `,_jsx(_components.code,{children:`revoked`}),` after a refund) and `,_jsx(_components.code,{children:`used_at`}),`. Using an item, which\nthe SDKs call consuming it, marks its entry used.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`A purchase is never charged twice, and never queued offline.`}),` Inventory is always fetched fresh; the\ncatalog is cached and served offline, so treat a displayed price as advisory until the purchase succeeds.`]}),`\n`,_jsxs(_components.p,{children:[`Items can also cost real money, paid through the App Store or Google Play on a phone: see\n`,_jsx(_components.a,{href:`/guides/real-money-purchases`,children:`In-App Purchases`}),`. On Windows, macOS, Linux and WebGL they are paid\nthrough a web checkout: see `,_jsx(_components.a,{href:`/guides/web-checkout`,children:`Web Payments`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-id-a-purchase-takes`,children:`The id a purchase takes`}),`\n`,_jsxs(_components.p,{children:[`A purchase names a `,_jsx(_components.strong,{children:`shop item`}),` by its id: the `,_jsx(_components.code,{children:`id`}),` of the item inside its shop. It is not the\nitem’s name, and it is not the shop’s id. Read it from the shop rather than typing it in: the SDK\nlists the shops of the Game Version your build runs, each with its items. Unreal’s generated shop\nitems carry the id already.`]}),`\n`,_jsx(_components.p,{children:`A shop belongs to one Game Version, so a shop made under another version is not listed and cannot be\nfound by name. If the list comes back empty, check the dashboard shows the shop under the Game Version\nyour build runs.`}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`A wallet is made when the player registers.`}),` The server builds each player’s wallet from the\nGame Version’s currency template at registration, with every currency starting at zero. Create the\ncurrency template before your test player registers; a player who registered before it existed has no\nwallet to pay from. A player whose wallet was made under another Game Version keeps it: at sign-in the\nserver moves it to this version’s currency template, balances kept and new currencies at zero. See\n`,_jsx(_components.a,{href:`/guides/currencies-and-wallets`,children:`Currencies and Wallets`}),`.`]})}),`\n`,_jsx(_components.p,{children:`When a call fails, the SDK’s text says what is wrong and how to fix it. A purchase given the item’s\nname instead of its id reads:`}),`\n`,_jsx(CodeBlock,{numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Shop item with ID 'GoldItem' not found [shop_item.shop_item_not_found, HTTP 404]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`Fix: ... take the shop item's Id ..., not the item's name or the shop's id.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`request.not_found`}),` 404 whose reason is a bare `,_jsx(_components.code,{children:`Not Found`}),` means the request reached no route at all (any other\nreason names a record the route did not find): the API URL must be the Flock\nserver’s address alone, with no `,_jsx(_components.code,{children:`/v1`}),` or other path after it.`]}),`\n`,_jsxs(Note,{children:[_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Purchases grant their contents server-side.`}),` Give a shop item a type of `,_jsx(_components.strong,{children:`Currency pack`}),` or\n`,_jsx(_components.strong,{children:`Consumable`}),` and attach rewards to it, and the server credits the player as part of the same\ntransaction that debits the price. Neither half can happen without the other, and the client never\ndecides what was granted — so a modified client cannot award itself anything, and a dropped\nconnection cannot leave a player charged with nothing to show for it.`]}),_jsxs(_components.p,{children:[`A `,_jsx(_components.strong,{children:`Standard`}),` item is the older behaviour and still the default: it debits the price and records\nan inventory entry your game interprets however it likes. `,_jsx(_components.strong,{children:`The wallet sells a standard item again\non every purchase`}),`, so before offering one, check the player does not hold it already. (A store\nsells it only once: see `,_jsx(_components.a,{href:`/guides/real-money-purchases`,children:`In-App Purchases`}),`.)`]})]}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Dashboard`,id:`dashboard`,children:[_jsxs(_components.p,{children:[`An item is priced in a currency, so first create the currency config of this Game Version (see\n`,_jsx(_components.a,{href:`/guides/currencies-and-wallets`,children:`Currencies and Wallets`}),`). Without one, the shop’s items say `,_jsx(_components.strong,{children:`Add a\ncurrency config to enable item creation`}),`, with `,_jsx(_components.strong,{children:`Go to Currencies`}),`.`]}),_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`In the menu at the top of the page, choose your game and the Game Version your build runs. A shop\nbelongs to that one version.`}),`\n`,_jsxs(_components.li,{children:[`Open `,_jsx(_components.strong,{children:`Monetization → Shops`}),`. Under `,_jsx(_components.strong,{children:`Your Shops`}),`, press `,_jsx(_components.strong,{children:`New`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`Type the `,_jsx(_components.strong,{children:`Shop Name`}),`, leave `,_jsx(_components.strong,{children:`Status`}),` at `,_jsx(_components.strong,{children:`Active`}),`, and press `,_jsx(_components.strong,{children:`Create Shop`}),`. `,_jsx(_components.strong,{children:`Success:`}),` the\npage says `,_jsx(_components.strong,{children:`Shop created. Add your first item.`}),` and the shop is listed under `,_jsx(_components.strong,{children:`Your Shops`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`With the shop selected, open its `,_jsx(_components.strong,{children:`Items`}),` tab and press `,_jsx(_components.strong,{children:`Add Item`}),`.`]}),`\n`,_jsxs(_components.li,{children:[`In `,_jsx(_components.strong,{children:`New Item`}),`, fill in:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Item Name`}),`, and `,_jsx(_components.strong,{children:`Status`}),` (`,_jsx(_components.strong,{children:`Active`}),` to sell it).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Item type`}),`, which decides what the player gets:`,`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Standard`}),` adds an entry to the player’s inventory and grants nothing more; your game decides\nwhat it means. A wallet sells it again on every purchase.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Currency pack`}),` pays its rewards straight into the player’s wallet when bought, with no\ninventory entry.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Consumable`}),` sits unused in the player’s inventory and pays its rewards when your game\nconsumes it.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Price`}),` and `,_jsx(_components.strong,{children:`Currency`}),`. In a game currency the price is a whole number, such as `,_jsx(_components.code,{children:`50`}),`. In a\nreal currency, type it as the player sees it, such as `,_jsx(_components.code,{children:`4.99`}),`: the server keeps it in the\ncurrency’s smallest unit, so the SDK reads `,_jsx(_components.code,{children:`499`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Store product IDs`}),` (`,_jsx(_components.strong,{children:`App Store`}),`, `,_jsx(_components.strong,{children:`Google Play`}),`): only for an item sold inside a mobile app\n(see `,_jsx(_components.a,{href:`/guides/real-money-purchases`,children:`In-App Purchases`}),`).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Rewards`}),`, for a currency pack or a consumable: press `,_jsx(_components.strong,{children:`Add reward`}),`, pick a currency other than\nthe price’s, and enter a whole `,_jsx(_components.strong,{children:`Amount`}),` above zero. A pack needs a second currency in the\ncurrency config.`]}),`\n`]}),`\n`]}),`\n`,_jsxs(_components.li,{children:[`Press `,_jsx(_components.strong,{children:`Add Item`}),`. `,_jsx(_components.strong,{children:`Success:`}),` the item shows in `,_jsx(_components.strong,{children:`Shop Items`}),` with its price and currency, its\nrewards, and `,_jsx(_components.strong,{children:`Real money`}),` when a real currency prices it.`]}),`\n`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Preview as player`}),` shows the shop as a player sees it. A version deployed to `,_jsx(_components.strong,{children:`Production`}),` is\nlocked: its shops and items are read-only there and change only through a patch.`]}),_jsx(Frame,{caption:`Monetization → Shops: a shop's Items tab, with Add Item.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/images/guides/shops.png?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=fc1fed5840b96a664392783492a37847`,alt:`The Shops page with two shops under Your Shops and the selected shop's items`,\"data-og-width\":`1440`,width:`1440`,\"data-og-height\":`866`,height:`866`,\"data-path\":`images/guides/shops.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/images/guides/shops.png?w=280\u0026fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=3f9a065d142f21c4ecd3910ee02481ec 280w, https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/images/guides/shops.png?w=560\u0026fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=dea1a63a5ae584045f1fa63e5c88b594 560w, https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/images/guides/shops.png?w=840\u0026fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=4c3170d102769ac08b8fc81834460830 840w, https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/images/guides/shops.png?w=1100\u0026fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=7460b6779e38f6698c76c3fbe3cbfe1d 1100w, https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/images/guides/shops.png?w=1650\u0026fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=46b7f43a70b78e29fe0c2d5af149ec61 1650w, https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/images/guides/shops.png?w=2500\u0026fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=a5b5c4b0b2ddede2bc7d21e5ffffb17f 2500w`})})]}),_jsxs(Tab,{title:`Unity`,id:`unity`,children:[_jsxs(_components.p,{children:[`One call buys any item: `,_jsx(_components.code,{children:`Shop.PurchaseAsync(item.Id)`}),`. An item priced in a game currency is paid\nfrom the wallet; a real-money item goes through the store (see\n`,_jsx(_components.a,{href:`/guides/real-money-purchases`,children:`In-App Purchases`}),`). Every example below is the signed-in\nplayer’s and runs inside an `,_jsx(_components.code,{children:`async`}),` method; `,_jsx(_components.code,{children:`\"Main Shop\"`}),` stands for your shop’s name.`]}),_jsxs(_components.p,{children:[`The player needs a wallet to pay from. A test player made in the `,_jsx(_components.a,{href:`/quickstart`,children:`Quickstart`}),` before\nyour currency template existed has none: call `,_jsx(_components.code,{children:`FlockClient.Instance.Authentication.Logout()`}),` once,\nthen delete the device ID the SDK keeps (the file `,_jsx(_components.code,{children:`Flock/device_id.txt`}),` under\n`,_jsx(_components.code,{children:`Application.persistentDataPath`}),`) or pass a new device ID of your own, such as\n`,_jsx(_components.code,{children:`Guid.NewGuid().ToString()`}),`, and press Play again to register a new player. Then give it currency\nwith `,_jsx(_components.code,{children:`AddGameFundsAsync`}),`; `,_jsx(_components.a,{href:`/guides/currencies-and-wallets`,children:`Currencies and Wallets`}),` has both steps in\nfull.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Show the shop.`}),` Read the items, the wallet and what the player owns once, then draw each item.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` System`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Collections`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Generic`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Models`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// The shop item's id from its shop: not the item's name, and not the shop's id.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Shop`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` shop`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetByNameAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Main Shop\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockWallet`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` wallet`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Player`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetWalletAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`IReadOnlyDictionary`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`int`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`owned`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetOwnedItemCountsAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`foreach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`ShopItem`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` item`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ShopItems`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` owned`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TryGetValue`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`out`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` int`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` count`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` string`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` price`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` $\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Price`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Currency`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// e.g. \"20 Gold\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` bool`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` canPay`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`IsRealMoney`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`CanAfford`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// grey out what the wallet cannot pay for`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` bool`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` alreadyHeld`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Type`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` ShopItemTypes`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Standard`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` count`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` >`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// the wallet would sell it again`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`In the examples below, `,_jsx(_components.code,{children:`item`}),`, `,_jsx(_components.code,{children:`potion`}),` and `,_jsx(_components.code,{children:`sword`}),` are `,_jsx(_components.code,{children:`ShopItem`}),`s read from the shop as above.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Buy an item.`}),` The answer says what was granted and the wallet afterwards.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Models`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` UnityEngine`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`PurchaseResult`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` bought`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`PurchaseAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`foreach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`ShopItemReward`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` reward`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Granted`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Debug`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`$\"+`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reward`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Amount`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reward`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Code`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// e.g. +500 Gold`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`long`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` gold`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Balances`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`BalanceOf`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Gold\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`??`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:` 0`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// null when no currency moved`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`PlayerInventory`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` entry`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Inventory`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`; `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// null for a currency pack`})]}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`When the purchase does not go through.`}),` A purchase that buys nothing throws. Three cases cover a\nshop screen:`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Exceptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` UnityEngine`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`try`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`PurchaseAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockException`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`when`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ErrorCode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockErrorCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ShopInsufficientFunds`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Not enough of the item's currency: nothing was bought. Tell the player.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockException`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`when`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`OutcomeUnknown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // No answer said whether it went through, so it may have. Read the wallet and`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // the inventory again before offering it again.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockException`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Debug`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`LogWarning`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Message`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// what went wrong, then a \"Fix:\" line saying how to fix it`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`A purchase whose answer never came (a dropped connection, a timeout, a server error) is sent again\nby itself, under one key the server uses to answer a repeat with the first purchase, so the player\npays once. A new `,_jsx(_components.code,{children:`PurchaseAsync`}),` call is a new purchase. `,_jsx(_components.code,{children:`OutcomeUnknown`}),` is true when no answer\nsaid whether it went through.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Use a consumable.`}),` `,_jsx(_components.code,{children:`ConsumeOneAsync`}),` uses one of a shop item the player holds and grants what it\nholds.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Exceptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Models`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` UnityEngine`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`try`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` ConsumeResult`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` used`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`ConsumeOneAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`potion`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` foreach`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`ShopItemReward`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` reward`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` used`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Granted`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Debug`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`$\"+`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reward`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Amount`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`reward`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Code`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockValidationException`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // The player holds none (it may have been used on another device).`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`catch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FlockException`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`when`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`e`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`OutcomeUnknown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // No answer came, so it may have been used: read the inventory again.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`Using an item is never sent twice by itself. To use one particular entry, pass its id:\n`,_jsx(_components.code,{children:`ConsumeAsync(entry.Id)`}),`.`]}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Does the player own it?`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`bool`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` hasSword`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`OwnsAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`sword`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`); `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// an unused entry of the item`})]}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`With generated code.`}),` After `,_jsx(_components.strong,{children:`Sync Schemas`}),` (the `,_jsx(_components.strong,{children:`Code Generation`}),` tab of `,_jsx(_components.strong,{children:`Flock → Settings`}),`),\nevery item has a typed id in `,_jsx(_components.code,{children:`FlockShopItemId`}),`, named after the item. These names exist only once you\nhave synced, and only for the items of your own shops: `,_jsx(_components.code,{children:`GoldPack`}),`, `,_jsx(_components.code,{children:`Potion`}),` and `,_jsx(_components.code,{children:`Sword`}),` here are\nexamples.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`csharp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`csharp`,children:_jsxs(_components.code,{language:`csharp`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`using`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Generated`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Shops`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`PurchaseAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`FlockShopItemId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`GoldPack`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`ConsumeOneAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`FlockShopItemId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Potion`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`bool`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` hasSword`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` FlockClient`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`OwnsAsync`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`FlockShopItemId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Sword`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`ShopItemId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`]})})}),_jsxs(_components.p,{children:[`A purchase or a use that reports a wallet also writes it into the cached player data, so the next\nwallet read shows the new balance. To show what an item will give before the player buys it, read\n`,_jsx(_components.code,{children:`ShopItem.Rewards`}),`; `,_jsx(_components.code,{children:`Granted`}),` and `,_jsx(_components.code,{children:`Rewards`}),` are never null.`]}),_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Code`}),_jsx(_components.th,{children:`What happened`}),_jsx(_components.th,{children:`What to do`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ShopInsufficientFunds`})}),_jsx(_components.td,{children:`The player cannot afford the item`}),_jsx(_components.td,{children:`Read the wallet before offering it`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ShopCurrencyNotHeld`})}),_jsx(_components.td,{children:`The wallet has no balance in the item’s currency`}),_jsx(_components.td,{children:`Price it in a currency of the wallet’s template`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ShopWalletNotFound`})}),_jsx(_components.td,{children:`The player has no wallet in this Game Version`}),_jsx(_components.td,{children:`Create the currency template, then register the player`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ShopItemShopItemNotFound`})}),_jsx(_components.td,{children:`No item has that id`}),_jsxs(_components.td,{children:[`Pass `,_jsx(_components.code,{children:`ShopItem.Id`}),` from its shop`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`ShopItemNotForSale`})}),_jsxs(_components.td,{children:[`The item, or its shop, is set to `,_jsx(_components.strong,{children:`Inactive`}),` in the dashboard`]}),_jsxs(_components.td,{children:[`Read the shop again, which leaves it out; set it back to `,_jsx(_components.strong,{children:`Active`}),` to sell it`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PlayerInventoryAlreadyUsed`})}),_jsx(_components.td,{children:`That entry was used already`}),_jsx(_components.td,{children:`Read the inventory again`})]})]})]})]}),_jsxs(Tab,{title:`Unreal`,id:`unreal`,children:[_jsxs(_components.p,{children:[`Browse with the `,_jsx(_components.em,{children:`Flock | Shop`}),` nodes, or the shop provider in C++. An item’s free-form `,_jsx(_components.code,{children:`data`}),` and\n`,_jsx(_components.code,{children:`stats`}),` read by dotted path, so no JSON parsing node is needed.`]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`Purchase`}),` completes with everything the purchase produced — what was granted, the wallet\nafterwards, and the inventory entry if the item created one.`]}),_jsxs(_components.p,{children:[`An item priced in a game currency is paid from the player’s wallet at once. An item priced in a\ncurrency your currency config lists as real money (for the Game Version the game sends) goes through the store the game connected with\n`,_jsx(_components.code,{children:`UFlockStore::Connect`}),` (`,_jsx(_components.strong,{children:`Flock Connect Store`}),` in Blueprint): the phone’s store (see `,_jsx(_components.a,{href:`/guides/real-money-purchases`,children:`In-App Purchases`}),`),\nor a web checkout on Windows, macOS and Linux (see `,_jsx(_components.a,{href:`/guides/web-checkout`,children:`Web Payments`}),`). With no\nstore connected, it is refused and nothing is charged.`]}),_jsx(Frame,{caption:`Purchase by picking a generated item — the ID is baked in and cannot be mistyped.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-purchase.png?fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=7d62008138e464eab95c97c1be0943a7`,alt:`A Flock Purchase node in a Blueprint graph`,\"data-og-width\":`333`,width:`333`,\"data-og-height\":`237`,height:`237`,\"data-path\":`images/sdk/unreal/shop-purchase.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-purchase.png?w=280\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=95a24f58076f55b879b952a101386a78 280w, https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-purchase.png?w=560\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=50c1d126e0f052dce492945298f792dc 560w, https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-purchase.png?w=840\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=81c5acdb745b833c402d7aaded97c9c9 840w, https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-purchase.png?w=1100\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=a7ab6e21659adedfdaef20d6f4c1bb0e 1100w, https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-purchase.png?w=1650\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=077b108daa33bd92893cb6e4ff5fee7e 1650w, https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-purchase.png?w=2500\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=9a13830be95b21deb0315032e77fe93f 2500w`})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Read the shop.`}),` In C++, read the shop item’s id from its shop: `,_jsx(_components.code,{children:`Purchase`}),` takes\n`,_jsx(_components.code,{children:`FFlockShopItem::Id`}),`, not the item’s name and not the shop’s id.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`14`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`14`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`#include`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"FlockSubsystem.h\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`#include`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Providers/FlockPlayerProvider.h\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`#include`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Providers/FlockShopProvider.h\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`UFlockSubsystem`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Sdk `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` UFlockSubsystem`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Get`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`this`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // this: any object in the game's world`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetShopProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetByName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TEXT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Main Shop\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockShop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FFlockShopItem`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Item : `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Shop`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ShopItems`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Item.Id is what Purchase takes; Item.Name is for showing the player.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`]})})}),_jsx(Frame,{caption:`Read a shop by its name and walk its items: each item's Id is what Flock Purchase takes.`,children:_jsx(OptimizedImage,{src:`https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-browse.png?fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=b858e971cdc334aeb049b60da281492f`,alt:`Flock Get Shop By Name into Break Flock Shop, whose Shop Items drive a ForEach Loop into Break Flock Shop Item`,\"data-og-width\":`680`,width:`680`,\"data-og-height\":`340`,height:`340`,\"data-path\":`images/sdk/unreal/shop-browse.png`,\"data-optimize\":`true`,\"data-opv\":`3`,srcset:`https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-browse.png?w=280\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=e1664d213bad9d19f02e79efed96fff1 280w, https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-browse.png?w=560\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=0b9e5d01758d4b710ae9a78ecee54dd8 560w, https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-browse.png?w=840\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=020524b4e4d989de84a984a3ff5f828b 840w, https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-browse.png?w=1100\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=b37d2c6ef7082fd0c330f01a61c86704 1100w, https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-browse.png?w=1650\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=9c84e55b866d5e4af8eda0c04300307a 1650w, https://mintcdn.com/qwacks/xJEjgQCFVIWLhvHB/images/sdk/unreal/shop-browse.png?w=2500\u0026fit=max\u0026auto=format\u0026n=xJEjgQCFVIWLhvHB\u0026q=85\u0026s=6b8fd984ef48e082248ad948bf6c32e3 2500w`})}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Show the shop.`}),` Read the wallet and what the player holds once, then decide per item. The wallet\ncomes from the player-data cache, which purchases keep current; the inventory is read from the server\non every call, so read the counts once for a whole screen.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`22`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`22`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Items: the shop items the screen shows, read from their shop as above.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` TWeakObjectPtr`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`UFlockSubsystem`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Flock `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Sdk;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetPlayerProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Items`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bSuccess`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ||`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` !`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsValid`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`())`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Flock`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetShopProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetOwnedItemCounts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`([`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Balances`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Wallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Items`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockOwnedItemCounts`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Owned`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Owned`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bSuccess`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FFlockShopItem`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Item : Items)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` int32 Held `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Owned`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`CountOf`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Item`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Id`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // unused entries the player holds`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` bool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` bCanBuy `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` Balances`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`CanAfford`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(Item);`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // false for a real-money item`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // The wallet sells a standard item again on every purchase: offer it only while Held is 0.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),_jsx(_components.p,{children:_jsx(_components.strong,{children:`Buy.`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`30`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`30`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// ItemId: the Id of an item read from its shop, as above.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetShopProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Purchase`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(ItemId,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockPurchaseResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`!`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bSuccess`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`ErrorCode`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ==`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` EFlockErrorCode`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`::ShopInsufficientFunds)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // The server declined — show the player, don't retry.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` else`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`bOutcomeUnknown`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // No answer said whether it was bought: read the wallet and inventory before offering it again.`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // What went wrong, then a \"Fix:\" line saying how to fix it.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` UE_LOG`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(LogTemp, Warning, `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`TEXT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#9CDCFE`},children:`%s`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Error`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`ToDisplayText`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`());`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FFlockShopItemReward`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Reward : `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Granted`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // e.g. +500 GOLD. Ask the reward, never compare Type to a typed-out \"currency\":`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // the server owns that set and can add kinds.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Reward`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`IsCurrency`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()) {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* Reward.Code, Reward.Amount */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Both may legitimately be absent, so ask rather than testing the Id yourself.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`HasWallet`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()) {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* Bought.Value.Wallet — balances after the grant */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Bought`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`HasInventoryRow`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()) {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* Bought.Value.Inventory — the row the player owns */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`]})})}),_jsxs(_components.p,{children:[`A currency pack pays straight into the wallet and creates no inventory entry — `,_jsx(_components.code,{children:`HasInventoryRow()`}),`\nis false, which is the legitimate no-row case rather than an error. A `,_jsx(_components.strong,{children:`Consumable`}),` does the\nopposite: it lands in the inventory and grants when the player spends it.`]}),_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`cpp`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cpp`,children:_jsxs(_components.code,{language:`cpp`,numberOfLines:`13`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// InventoryId: an entry's Id from GetPlayerInventory.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetShopProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Consume`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(InventoryId,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockConsumeResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Consumed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` FFlockShopItemReward`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`\u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Reward : `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Consumed`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Value`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Granted`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* +Amount Code */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Or use up one entry of a shop item the player holds, without reading the inventory yourself.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetShopProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`ConsumeOne`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(PotionItemId,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`FFlockConsumeResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Used`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* Used.Value.Granted */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Whether the player holds one: a standard item bought and not used up.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`Sdk`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`GetShopProvider`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()->`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`Owns`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(PotionItemId, [](`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`TFlockResult`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`bool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`Holds`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) {`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` /* Holds.Value */`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})]}),`\n`]})})}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`PotionItemId`}),` is a shop item’s `,_jsx(_components.code,{children:`Id`}),`. `,_jsx(_components.code,{children:`ConsumeOne`}),` reads the inventory and uses the first unused\nentry of that item, passing over one used meanwhile on another device; any other failure stops it, so\none call never uses two. It fails (`,_jsx(_components.code,{children:`Validation`}),`) when the player holds none. `,_jsx(_components.code,{children:`Owns`}),` reads the whole\ninventory. With nobody signed in, `,_jsx(_components.code,{children:`ConsumeOne`}),` fails (`,_jsx(_components.code,{children:`Auth`}),`) and `,_jsx(_components.code,{children:`Owns`}),` fails (`,_jsx(_components.code,{children:`Validation`}),`, saying\nto sign in first). `,_jsx(_components.code,{children:`Consume`}),` is not refused by the SDK: it is sent as it is, so call it only while a\nplayer is signed in.`]}),_jsxs(_components.p,{children:[`In Blueprint these are `,_jsx(_components.strong,{children:`Flock Purchase`}),`, `,_jsx(_components.strong,{children:`Flock Consume Inventory Item`}),`, `,_jsx(_components.strong,{children:`Flock Consume One`}),`,\n`,_jsx(_components.strong,{children:`Flock Owns Shop Item`}),` and `,_jsx(_components.strong,{children:`Flock Get Owned Item Counts`}),`. For a shop screen, read the wallet with\n`,_jsx(_components.strong,{children:`Flock Get Wallet`}),` (under `,_jsx(_components.em,{children:`Flock | Player`}),`) and the owned counts once, then ask per item `,_jsx(_components.strong,{children:`Can\nAfford`}),` (wallet, item) and `,_jsx(_components.strong,{children:`Owned Count Of`}),` (counts, item id). Break the purchase result for\n`,_jsx(_components.code,{children:`Inventory`}),`, `,_jsx(_components.code,{children:`Granted`}),` and `,_jsx(_components.code,{children:`Wallet`}),`, and use the nodes that have no execution pins rather than testing fields yourself: `,_jsx(_components.em,{children:`Has\nInventory Row`}),` before reading the row, and `,_jsx(_components.em,{children:`Is Currency Reward`}),` to branch on a reward kind. Comparing\na reward’s `,_jsx(_components.code,{children:`Type`}),` to a hand-typed string is the one mistake worth guarding against — a typo reads as\n“not a currency reward” and silently skips the grant. A purchase or consume that reports a wallet also\nwrites it into the cached player data.`]}),_jsxs(_components.p,{children:[_jsx(_components.code,{children:`Granted`}),` is never null — an item that grants nothing returns an empty list. To show what an item\nwill give before the player buys it, read `,_jsx(_components.code,{children:`Rewards`}),` from the catalog item.`]}),_jsxs(_components.p,{children:[`A declined purchase fails the result rather than throwing — check `,_jsx(_components.code,{children:`Error.ErrorCode`}),` for\n`,_jsx(_components.code,{children:`EFlockErrorCode::ShopInsufficientFunds`}),` to tell “can’t afford it” apart from a network failure.`]}),_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`A purchase is never bought twice.`}),` Every attempt of one `,_jsx(_components.code,{children:`Purchase`}),` call carries the same key, so\nan answer that never came is sent again and the server answers the repeat with the first purchase. A\nsecond `,_jsx(_components.code,{children:`Purchase`}),` call is a second purchase. When no answer said whether it went through, the failure\nhas `,_jsx(_components.code,{children:`bOutcomeUnknown`}),` set (`,_jsx(_components.em,{children:`Outcome Unknown`}),` on the Blueprint error): read the wallet and inventory\nbefore offering the item again. That is for an item paid from the wallet; a real-money item whose\noutcome is unknown is handled as `,_jsx(_components.a,{href:`/guides/real-money-purchases#buy`,children:`In-App Purchases`}),` says.\n`,_jsx(_components.strong,{children:`A consume is never sent again`}),` after an ambiguous failure, since it\ncarries no key and a repeat would grant twice; it reports `,_jsx(_components.code,{children:`bOutcomeUnknown`}),` the same way.`]})]})]}),`\n`,_jsxs(_components.p,{children:[`See `,_jsx(_components.a,{href:`/guides/currencies-and-wallets`,children:`Currencies and Wallets`}),` for the balances that back purchases.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{Scope,default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Shops and Inventory","description":"Sell items and track what each player owns.","href":"/guides/shops-and-inventory"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"The id a purchase takes","slug":"the-id-a-purchase-takes","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/qwacks/05763fd4e1d53e37/lang-toggle.js"],"subdomain":"qwacks","siteName":"Qwacks","title":"Shops and Inventory - Qwacks","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"en":{"href":"/guides/shops-and-inventory","matchLevel":0},"ar":{"href":"/ar/guides/shops-and-inventory","matchLevel":1}}},"lastModified":"2026-11-11T19:01:52.255Z","originalFileLocation":"guides/shops-and-inventory.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"dark\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"dark\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Sell items and track what each player owns.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Qwacks\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Shops and Inventory - Qwacks\">\u003cmeta data-mint-head property=\"og:description\" content=\"Sell items and track what each player owns.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Qwacks\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.qwacks.com/guides/shops-and-inventory\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://qwacks.mintlify.site/_mintlify/api/og/v2?division=Economy+and+Payments\u0026amp;title=Shops+and+Inventory\u0026amp;description=Sell+items+and+track+what+each+player+owns.\u0026amp;theme=7cf102a658812adb3feebdf0\u0026amp;signature=e26ded439c42dbbfa15d351174cf7af9e94c8ba11d2ccf9823a7c195c9dd43f5\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Shops and Inventory - Qwacks\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Sell items and track what each player owns.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://qwacks.mintlify.site/_mintlify/api/og/v2?division=Economy+and+Payments\u0026amp;title=Shops+and+Inventory\u0026amp;description=Sell+items+and+track+what+each+player+owns.\u0026amp;theme=7cf102a658812adb3feebdf0\u0026amp;signature=e26ded439c42dbbfa15d351174cf7af9e94c8ba11d2ccf9823a7c195c9dd43f5\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/qwacks/UqcSWN8cDTjx2Nmd/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Qwacks\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0099FF\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.qwacks.com/guides/shops-and-inventory\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/guides/shops-and-inventory.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.qwacks.com/guides/shops-and-inventory\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ar\" href=\"https://docs.qwacks.com/ar/guides/shops-and-inventory\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.qwacks.com/guides/shops-and-inventory\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.qwacks.com/#organization\",\"name\":\"Qwacks\",\"url\":\"https://docs.qwacks.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/icons/qwacks.svg?fit=max\u0026auto=format\u0026n=TGGmq_oWzDacAqHl\u0026q=85\u0026s=2023abb340d6ec576975601525ab2ce9\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.qwacks.com#website\",\"name\":\"Qwacks\",\"url\":\"https://docs.qwacks.com\",\"publisher\":{\"@id\":\"https://docs.qwacks.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.qwacks.com/guides/shops-and-inventory#webpage\",\"url\":\"https://docs.qwacks.com/guides/shops-and-inventory\",\"name\":\"Shops and Inventory\",\"description\":\"Sell items and track what each player owns.\",\"dateModified\":\"2026-11-11T19:01:52.255Z\",\"isPartOf\":{\"@id\":\"https://docs.qwacks.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.qwacks.com/guides/shops-and-inventory#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.qwacks.com/guides/shops-and-inventory#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Features\",\"item\":\"https://docs.qwacks.com/guides/players-and-auth\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Economy and Payments\",\"item\":\"https://docs.qwacks.com/guides/currencies-and-wallets\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Shops and Inventory\",\"item\":\"https://docs.qwacks.com/guides/shops-and-inventory\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.qwacks.com/guides/shops-and-inventory#article\",\"headline\":\"Shops and Inventory\",\"name\":\"Shops and Inventory\",\"description\":\"Sell items and track what each player owns.\",\"url\":\"https://docs.qwacks.com/guides/shops-and-inventory\",\"mainEntityOfPage\":{\"@id\":\"https://docs.qwacks.com/guides/shops-and-inventory#webpage\"},\"dateModified\":\"2026-11-11T19:01:52.255Z\",\"publisher\":{\"@id\":\"https://docs.qwacks.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.qwacks.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Qwacks\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Qwacks\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/guides/shops-and-inventory.md","siteName":"Qwacks","nav":{"global":null,"languages":[{"language":"en","default":true,"tabs":[{"tab":"Qwacks","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/qwacks.svg","pages":[{"title":"Qwacks","href":"/welcome"}]},{"tab":"Flock","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/flock.svg","groups":[{"group":"Getting Started","pages":[{"title":"Flock","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"},{"title":"Authentication","href":"/authentication"},{"title":"Unity SDK","href":"/sdk/unity"},{"title":"Unreal SDK","href":"/sdk/unreal"}]},{"group":"Concepts","pages":[{"title":"Studios \u0026 Games","href":"/concepts/studios-and-games"},{"title":"Versions","href":"/concepts/versions"},{"title":"Players","href":"/concepts/players"}]},{"group":"Features","pages":[{"group":"Players","pages":[{"title":"Sign-in","href":"/guides/players-and-auth"},{"title":"Linking Accounts","href":"/guides/account-linking"},{"title":"Player Data","href":"/guides/player-data"},{"title":"Bans","href":"/guides/bans"}]},{"group":"Progress","pages":[{"title":"Achievements","href":"/guides/achievements"},{"title":"Leaderboards","href":"/guides/leaderboards"}]},{"group":"Economy and Payments","pages":[{"title":"Currencies and Wallets","description":"Define soft and hard currencies and track player balances.","href":"/guides/currencies-and-wallets"},{"title":"Shops and Inventory","href":"/guides/shops-and-inventory"},{"title":"In-App Purchases","description":"Sell shop items for real money through the App Store and Google Play.","href":"/guides/real-money-purchases"},{"title":"Web Payments","href":"/guides/web-checkout"}]},{"group":"Game Content","pages":[{"title":"Remote Config","href":"/guides/remote-config"},{"title":"Game Patches","href":"/guides/game-patches"},{"title":"Game Files","href":"/guides/assets"}]},{"group":"Reaching Players","pages":[{"title":"Player Segments","href":"/guides/segments"},{"title":"Notifications","href":"/guides/notifications"}]},{"group":"Insights","pages":[{"title":"Analytics and Events","href":"/guides/analytics-and-events"},{"title":"Metric Definitions","href":"/guides/metric-definitions"},{"title":"Developer Alerts","href":"/guides/developer-alerts"}]},{"group":"Multiplayer","pages":[{"title":"Multiplayer","sidebarTitle":"Overview","href":"/guides/multiplayer"},{"title":"Parties","href":"/guides/parties"},{"title":"Matchmaking","href":"/guides/matchmaking"},{"title":"Sessions","href":"/guides/sessions"},{"title":"Connecting Players","href":"/guides/connecting-players"}]}]},{"group":"Reference","pages":[{"title":"Changelog","href":"/changelog"}]}]},{"tab":"Protokite","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/protokite.svg","pages":[{"title":"Protokite","href":"/protokite/getting-started"}]},{"tab":"Data Duck","icon":"https://mintlify.s3.us-west-1.amazonaws.com/qwacks/icons/data-duck.svg","pages":[{"title":"Data Duck","href":"/data-duck/getting-started"}]}]},{"language":"ar","navbar":{"links":[{"href":"https://www.qwacks.com/pricing","label":"الأسعار"},{"href":"https://github.com/QwackStack/FlockUnitySdk/releases","label":"حزمة Unity"},{"href":"https://github.com/QwackStack/FlockUnrealSdk/releases","label":"حزمة Unreal"}],"primary":{"type":"button","label":"لوحة التحكم","href":"https://flock-saas.qwacks.com"}},"pages":[{"title":"ar","href":"/ar/guides/shops-and-inventory"}]}]},"basePath":"","title":"Shops and Inventory - Qwacks","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":["07c022d89b","a74be98ba7"],"chunks":["Frame-u3J1-UOn.js","DynamicMarkdown-B-f2cqXQ.js","zoom-image-lightbox-DTFzvaXJ.js","lightbox-handle-r17bVUz3.js"]}