GS2-Inventory SDK for Game Engine API Reference
Model
EzInventory
Inventory
Inventory is like a bag that stores items owned by game players. The bag has a capacity, and the capacity can be expanded by each player.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryId | string | * | ~ 1024 chars | Inventory GRN * Set automatically by the server | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits. | ||
| currentInventoryCapacityUsage | int | 0 | 0 ~ 2147483646 | Capacity Usage The number of inventory slots currently occupied by item sets. Incremented when a new item stack is added (e.g., when allowMultipleStacks creates a new slot) and decremented when an item set is fully consumed or deleted. Cannot exceed currentInventoryMaxCapacity. | ||
| currentInventoryMaxCapacity | int | ✓ | 1 ~ 2147483646 | Maximum Capacity The current maximum number of inventory slots available to this user. Initialized from the inventory model’s initialCapacity and can be expanded up to the model’s maxCapacity through acquire actions or direct API calls. |
EzItemSet
Item Set
Item Set represents the possessions stored in the game player’s inventory. Item Set holds the Inventory Model name, Item Model name, quantity held, expiration time, and other details.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemSetId | string | * | ~ 1024 chars | Item Set GRN * Set automatically by the server | ||
| name | string | ✓ | UUID | ~ 36 chars | Name identifying the Item Set Maintains a unique name for each item set. Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set. | |
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| count | long | ✓ | 1 ~ 9223372036854775805 | Quantity in Possession The number of items in this stack. Ranges from 1 to the item model’s stacking limit. When items are acquired, this count increases up to the stacking limit; when consumed, it decreases. If count reaches 0, the item set is deleted and the inventory slot is freed. | ||
| sortValue | int | ✓ | 0 ~ 2147483646 | Display Order A numeric value copied from the item model’s sortValue, used to sort item sets within the inventory for display purposes. Lower values are displayed first. | ||
| expiresAt | long | 0 | Expiration time Unix time, milliseconds | |||
| referenceOf | List<string> | [] | 0 ~ 24 items | List of References The external references registered on this item set. Used to track which systems are using this item (e.g., equipped as weapon, assigned to formation). Up to 24 references per item set. |
EzSimpleItem
Simple Item
Simple Item represents a possession stored in the game player’s inventory. Simple Item has a model name and the quantity possessed.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemId | string | * | ~ 1024 chars | Simple Item GRN * Set automatically by the server | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| count | long | ✓ | 0 ~ 9223372036854775805 | Quantity in Possession The number of this item type held by the user. Unlike standard inventory items, simple items have no stacking limit and the count can be any value within the int64 range. Can be increased or decreased through batch operations along with other simple items. |
EzBigItem
Big Item
Big item represents possessions stored in the game player’s Big Inventory. Big Items can hold quantities beyond the range of int64.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemId | string | * | ~ 1024 chars | Big Item GRN * Set automatically by the server | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model Name The name of the big item model that defines the type of item stored in this record. Used to identify which item definition this big item possession corresponds to. | ||
| count | string BigInteger (Unity) | ✓ | ~ 1024 chars | Quantity in possession Integer value strings up to 1024 digits |
EzInventoryModel
Inventory Model
Inventory is like a bag that stores items owned by game players. Inventory can have a set capacity and cannot be owned beyond its capacity.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| initialCapacity | int | ✓ | 0 ~ 2147483646 | Initial Capacity The number of inventory slots available to a user when the inventory is first created. Each slot can hold one item stack. Users can expand their capacity up to maxCapacity through gameplay actions. | ||
| maxCapacity | int | ✓ | 0 ~ 2147483646 | Maximum Capacity The upper limit of inventory slots that a user can expand to. Capacity cannot be increased beyond this value. When all slots are occupied and items cannot be stacked further, acquisition attempts will fail unless the overflow script handles the excess. |
EzItemModel
Item Model
Items can be held in groups within a single inventory slot, such as Potion ×99. This grouping of multiple items into one slot is called “stacking,” and a maximum stack size can be set for each item.
The behavior when the stack limit is reached can also be set for each item. Specifically, you can choose one of the following:
- Add a new inventory slot to allow further acquisition
- Prevent further acquisition once the limit is reached
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Item Model name Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata GS2-Enhance features a mechanism that works in conjunction with GS2-Inventory to perform enhancements. It sets the experience value when used as enhancement material in JSON format within the ItemModel metadata. Details are explained in the Microservices Introduction / GS2-Enhance section. | |||
| stackingLimit | long | ✓ | 1 ~ 9223372036854775805 | Maximum Stackable Quantity The maximum number of this item that can be held in a single inventory slot (stack). When this limit is reached, the behavior depends on the allowMultipleStacks setting: either a new slot is allocated or further acquisition is blocked. | ||
| allowMultipleStacks | bool | ✓ | Allow Multiple Stacks When enabled, if the stacking limit is reached, a new inventory slot is automatically allocated to store additional quantities of this item (consuming additional capacity). When disabled, acquisition is blocked once the stacking limit is reached in the existing slot. | |||
| sortValue | int | ✓ | 0 ~ 2147483646 | Display Order A numeric value used to sort items within the inventory for display purposes. Lower values are displayed first. This value is also copied to ItemSet records to enable consistent ordering of possessed items. |
EzSimpleInventoryModel
Simple Inventory Model
In a normal InventoryModel, you could limit the amount of items that could be stored in your inventory. Simple Inventory, however, has no such functionality and simply stores the number of items in the inventory.
However, the Simple Inventory provides APIs that allow increasing or decreasing multiple items in a single operation.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
EzSimpleItemModel
Simple Item Model
ItemModel allowed setting a maximum stackable quantity, enabling implementation where items exceeding a certain number could be split into multiple stacks. SimpleItem does not have such a function and simply stores the number of items in the possession of the item.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Simple Item Model name Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
EzBigInventoryModel
Big Inventory Model
In the normal InventoryModel and SimpleInventoryModel, the number of items that can be stored in the inventory is limited to the range of int64. In inflationary games, you may need a wider range of values.
In the Big Inventory Model, the number of items that can be stored in the inventory can have an integer value of 1024 digits.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
EzBigItemModel
Big Item Model
The Big Item Model defines items stored in a Big Inventory Model. Big Items can hold quantities that exceed the range of int64.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. |
EzConsumeCount
Consumption quantity of Simple Item
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| count | long | ✓ | 1 ~ 9223372036854775805 | Consumption quantity |
EzAcquireCount
Acquisition quantity of Simple Item
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| count | long | ✓ | 1 ~ 9223372036854775805 | Acquisition quantity |
Methods
getInventoryModel
Get a specific inventory type definition by name
Retrieves a single inventory model by specifying its name. The returned information includes the initial and maximum capacity, item protection settings, and all item models that belong to this inventory. Use this to display the details of a specific inventory type — for example, showing “Equipment Bag — Capacity: 50/100 — Items: Iron Sword, Steel Shield, Leather Armor, …”.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzInventoryModel | Inventory Model |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
);
var item = await domain.ModelAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->InventoryModel(
"item" // inventoryName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->InventoryModel(
"item" // inventoryName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Inventory::Model::FInventoryModel> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listInventoryModels
Get a list of inventory type definitions
Retrieves all inventory models registered in this namespace. An inventory model defines a container type for items — such as “Equipment Bag”, “Material Pouch”, or “Consumable Box”. Each model sets the initial and maximum capacity (how many different item types it can hold), and includes the list of item models (what items can be stored in it). Use this to display what kinds of inventories the player has — for example, showing tabs like “Equipment (50/100 slots)”, “Materials (30/200 slots)”.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<EzInventoryModel> | List of Inventory Models |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.InventoryModelsAsync(
).ToListAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.InventoryModels(
);
List<EzInventoryModel> items = new List<EzInventoryModel>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->InventoryModels(
);
TArray<Gs2::UE5::Inventory::Model::FEzInventoryModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeInventoryModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeInventoryModels(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeInventoryModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeInventoryModels(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeInventoryModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeInventoryModels(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getItemModel
Get a specific item definition by name
Retrieves a single item model by specifying the inventory name and item name. The returned information includes the maximum stack size, whether the item supports multiple stacks (e.g., items with different expiration dates are stored in separate stacks), and the sort order. Use this to display item rules — for example, showing “Healing Potion — Max per stack: 99 — Can have multiple stacks with different expiration dates”.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Item Model name Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzItemModel |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
).ItemModel(
itemName: "item-master-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
).ItemModel(
itemName: "item-master-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->InventoryModel(
"item" // inventoryName
)->ItemModel(
"item-master-0001" // itemName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
).ItemModel(
itemName: "item-master-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
).ItemModel(
itemName: "item-master-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->InventoryModel(
"item" // inventoryName
)->ItemModel(
"item-master-0001" // itemName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Inventory::Model::FItemModel> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listItemModels
Get a list of item definitions in an inventory
Retrieves all item models that belong to the specified inventory. An item model defines the rules for a specific item type — such as the maximum stack size (e.g., potions stack up to 99), whether items can be split into multiple stacks, and the sort order for display. Use this to show what types of items can exist in an inventory — for example, listing all equipment types in the “Equipment Bag” or all materials in the “Material Pouch”.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<EzItemModel> | List of Item Model |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
);
var items = await domain.ItemModelsAsync(
).ToListAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
);
var it = domain.ItemModels(
);
List<EzItemModel> items = new List<EzItemModel>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->InventoryModel(
"item" // inventoryName
);
const auto It = Domain->ItemModels(
);
TArray<Gs2::UE5::Inventory::Model::FEzItemModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeItemModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeItemModels(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).InventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeItemModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeItemModels(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->InventoryModel(
"item" // inventoryName
);
// Start event handling
const auto CallbackId = Domain->SubscribeItemModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeItemModels(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getInventory
Get a specific inventory’s details
Retrieves the details of a specific inventory by name, including the current capacity usage (used slots / max slots). Use this to display a specific inventory’s status — for example, showing “Equipment Bag — 45 / 100 slots used” at the top of the equipment inventory screen.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits. | ||
| gameSession | GameSession | ✓ | GameSession |
Result
| Type | Description | |
|---|---|---|
| item | EzInventory | Inventory |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "inventory-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "inventory-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Inventory(
"inventory-0001" // inventoryName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "inventory-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "inventory-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Inventory(
"inventory-0001" // inventoryName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Inventory::Model::FInventory> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listInventories
Get a list of the player’s inventories
Retrieves all inventories that belong to the player. Each inventory shows its current capacity usage — how many item types (slots) are currently used out of the maximum capacity. Use this to build an inventory overview screen — for example, showing “Equipment Bag: 45/100 slots used”, “Material Pouch: 120/200 slots used” as a list of the player’s item containers.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<EzInventory> | List of Inventories |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.InventoriesAsync(
).ToListAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.Inventories(
);
List<EzInventory> items = new List<EzInventory>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto It = Domain->Inventories(
);
TArray<Gs2::UE5::Inventory::Model::FEzInventoryPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeInventories(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeInventories(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeInventories(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeInventories(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
// Start event handling
const auto CallbackId = Domain->SubscribeInventories(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeInventories(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
consume
Use (consume) items from the player’s inventory
Reduces the quantity of a specific item in the player’s inventory. Use this when the player uses or spends items through game-specific logic. For example, use this when the player uses a healing potion in battle, consumes crafting materials, or spends items on a custom game feature. Note: if items are consumed as a cost for purchasing products (GS2-Showcase) or starting quests (GS2-Quest), those systems handle item consumption automatically — you don’t need to call this API for those cases. You can optionally specify which stack (itemSetName) to consume from. If omitted, items are consumed from the oldest stack first.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| gameSession | GameSession | ✓ | GameSession | |||
| consumeCount | long | ✓ | 1 ~ 9223372036854775805 | Consumption quantity | ||
| itemSetName | string | ~ 36 chars | Name identifying the Item Set |
Result
| Type | Description | |
|---|---|---|
| items | List<EzItemSet> | List of Item Sets per post-consumption |
| itemModel | EzItemModel | Item Model |
| inventory | EzInventory | Inventory |
Error
Special exceptions are defined in this API. GS2-SDK for GameEngine provides specialized exceptions derived from general exceptions to facilitate handling of errors that may need to be handled in games. Please refer to the documentation here for more information on common error types and handling methods.
| Type | Base Type | Description |
|---|---|---|
| ConflictException | ConflictException | Item manipulation process conflicted. Retry required. |
| InsufficientException | BadRequestException | Insufficient quantity of items in your possession. |
Implementation Example
try {
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "inventory-0001"
).ItemSet(
itemName: "item-0001",
itemSetName: null
);
var result = await domain.ConsumeAsync(
consumeCount: 1L
);
var item = await result.ModelAsync();
} catch(Gs2.Gs2Inventory.Exception.ConflictException e) {
// Item manipulation process conflicted. Retry required.
} catch(Gs2.Gs2Inventory.Exception.InsufficientException e) {
// Insufficient quantity of items in your possession.
} var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "inventory-0001"
).ItemSet(
itemName: "item-0001",
itemSetName: null
);
var future = domain.ConsumeFuture(
consumeCount: 1L
);
yield return future;
if (future.Error != null)
{
if (future.Error is Gs2.Gs2Inventory.Exception.ConflictException)
{
// Item manipulation process conflicted. Retry required.
}
if (future.Error is Gs2.Gs2Inventory.Exception.InsufficientException)
{
// Insufficient quantity of items in your possession.
}
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Inventory(
"inventory-0001" // inventoryName
)->ItemSet(
"item-0001", // itemName
nullptr // itemSetName
);
const auto Future = Domain->Consume(
1L // consumeCount
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
auto e = Future->GetTask().Error();
if (e->IsChildOf(Gs2::Inventory::Error::FConflictError::Class))
{
// Item manipulation process conflicted. Retry required.
}
if (e->IsChildOf(Gs2::Inventory::Error::FInsufficientError::Class))
{
// Insufficient quantity of items in your possession.
}
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();getItem
Get a specific item by inventory name and item name
Retrieves all stacks of a specific item type that the player owns in the specified inventory. The response may contain multiple stacks (item sets) for the same item — items with different expiration dates are always in separate stacks. For example, requesting “Healing Potion” might return two stacks: one with 50 potions expiring soon and another with 30 potions expiring later. Use this to display an item detail screen — for example, showing “Healing Potion — Total: 80 — Stack 1: 50 (expires 2024-03-01), Stack 2: 30 (expires 2024-03-15)”.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| gameSession | GameSession | ✓ | GameSession |
Result
| Type | Description | |
|---|---|---|
| items | List<EzItemSet> | List of Item Sets |
| itemModel | EzItemModel | Item Model |
| inventory | EzInventory | inventory |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "item"
).ItemSet(
itemName: "item-0001",
itemSetName: "itemSet-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "item"
).ItemSet(
itemName: "item-0001",
itemSetName: "itemSet-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Inventory(
"item" // inventoryName
)->ItemSet(
"item-0001", // itemName
"itemSet-0001" // itemSetName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "item"
).ItemSet(
itemName: "item-0001",
itemSetName: "itemSet-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "item"
).ItemSet(
itemName: "item-0001",
itemSetName: "itemSet-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Inventory(
"item" // inventoryName
)->ItemSet(
"item-0001", // itemName
"itemSet-0001" // itemSetName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Inventory::Model::FItemSet> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getItemWithSignature
Get an item with a cryptographic signature proving ownership
Retrieves an item set along with a server-signed signature that proves the player owned this item at the time of the API call. This is useful when you need to verify item ownership on an external server or another system — the signature serves as tamper-proof evidence. For example, you can use this to verify that a player actually owns a specific weapon before allowing them to enter a special dungeon.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model Name The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to. | ||
| itemName | string | ✓ | ~ 128 chars | Item Model Name The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set. | ||
| gameSession | GameSession | ✓ | GameSession | |||
| itemSetName | string | ~ 36 chars | Name identifying the Item Set | |||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN |
Result
| Type | Description | |
|---|---|---|
| items | List<EzItemSet> | List of Item Sets |
| itemModel | EzItemModel | Item Model |
| inventory | EzInventory | Inventory |
| body | string | Item Set Information for Signature Subject |
| signature | string | Signature |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "inventory-0001"
).ItemSet(
itemName: "item-0001",
itemSetName: null
);
var result = await domain.GetItemWithSignatureAsync(
keyId: "key-0001"
);
var item = await result.ModelAsync();
var body = result.Body;
var signature = result.Signature; var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "inventory-0001"
).ItemSet(
itemName: "item-0001",
itemSetName: null
);
var future = domain.GetItemWithSignatureFuture(
keyId: "key-0001"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result;
var body = future.Result.Body;
var signature = future.Result.Signature; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Inventory(
"inventory-0001" // inventoryName
)->ItemSet(
"item-0001", // itemName
nullptr // itemSetName
);
const auto Future = Domain->GetItemWithSignature(
"key-0001" // keyId
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();
const auto Body = Result->Body;
const auto Signature = Result->Signature;listItems
Get a list of items the player owns in an inventory
Retrieves all items that the player currently owns in the specified inventory. Each entry is an “item set” — a stack of items with a quantity and optionally an expiration date. The same item type can appear as multiple stacks if it has different expiration dates. For example, “Healing Potion” might show up as two entries: “Healing Potion x50 (expires in 3 days)” and “Healing Potion x30 (expires in 7 days)”. Use this to build the main item list screen for an inventory — showing all owned items with their quantities.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Inventory Model name Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<EzItemSet> | List of Item Sets |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "item"
);
var items = await domain.ItemSetsAsync(
).ToListAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "item"
);
var it = domain.ItemSets(
);
List<EzItemSet> items = new List<EzItemSet>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Inventory(
"item" // inventoryName
);
const auto It = Domain->ItemSets(
);
TArray<Gs2::UE5::Inventory::Model::FEzItemSetPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeItemSets(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeItemSets(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Inventory(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeItemSets(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeItemSets(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Inventory(
"item" // inventoryName
);
// Start event handling
const auto CallbackId = Domain->SubscribeItemSets(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeItemSets(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getSimpleInventoryModel
Get a specific simple inventory type definition by name
Retrieves a single simple inventory model by specifying its name. The returned information includes the list of simple item models that belong to this inventory — defining what items can be stored and their properties. Use this to display what a specific simple inventory contains — for example, showing the item types in a “Currency” or “Materials” inventory.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzSimpleInventoryModel | Simple Inventory Model |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
);
var item = await domain.ModelAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->SimpleInventoryModel(
"item" // inventoryName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->SimpleInventoryModel(
"item" // inventoryName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Inventory::Model::FSimpleInventoryModel> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listSimpleInventoryModels
Get a list of simple inventory type definitions
Retrieves all simple inventory models registered in this namespace. A simple inventory is a lightweight version of the standard inventory — it stores items as simple name-and-count pairs without stacking, expiration dates, or capacity limits. Simple inventories are ideal for resources like currencies, crafting materials, or any item that just needs a count — for example, “Gold: 5000”, “Iron Ore: 150”, “Stamina Potion: 12”. Use this to see what types of simple inventories are available in the game.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<EzSimpleInventoryModel> | List of Simple Inventory Models |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.SimpleInventoryModelsAsync(
).ToListAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.SimpleInventoryModels(
);
List<EzSimpleInventoryModel> items = new List<EzSimpleInventoryModel>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->SimpleInventoryModels(
);
TArray<Gs2::UE5::Inventory::Model::FEzSimpleInventoryModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeSimpleInventoryModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeSimpleInventoryModels(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeSimpleInventoryModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeSimpleInventoryModels(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeSimpleInventoryModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeSimpleInventoryModels(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getSimpleItemModel
Get a specific simple item definition by name
Retrieves a single simple item model by specifying the inventory name and item name. Use this to display the definition of a specific simple item type — for example, to show the properties of “Gold” or “Iron Ore” in the game UI.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model name Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzSimpleItemModel |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
).SimpleItemModel(
itemName: "item-master-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
).SimpleItemModel(
itemName: "item-master-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->SimpleInventoryModel(
"item" // inventoryName
)->SimpleItemModel(
"item-master-0001" // itemName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
).SimpleItemModel(
itemName: "item-master-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
).SimpleItemModel(
itemName: "item-master-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->SimpleInventoryModel(
"item" // inventoryName
)->SimpleItemModel(
"item-master-0001" // itemName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Inventory::Model::FSimpleItemModel> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listSimpleItemModels
Get a list of simple item definitions in an inventory
Retrieves all simple item models that belong to the specified simple inventory. A simple item model defines a single item type that is tracked by count only — no stacking rules, no expiration, just a name and a number. Use this to see what items can exist in a simple inventory — for example, listing “Gold”, “Gems”, “Iron Ore”, “Wood” in the “Materials” inventory.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<EzSimpleItemModel> | List of Simple Item Model |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
);
var items = await domain.SimpleItemModelsAsync(
).ToListAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
);
var it = domain.SimpleItemModels(
);
List<EzSimpleItemModel> items = new List<EzSimpleItemModel>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->SimpleInventoryModel(
"item" // inventoryName
);
const auto It = Domain->SimpleItemModels(
);
TArray<Gs2::UE5::Inventory::Model::FEzSimpleItemModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeSimpleItemModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeSimpleItemModels(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).SimpleInventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeSimpleItemModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeSimpleItemModels(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->SimpleInventoryModel(
"item" // inventoryName
);
// Start event handling
const auto CallbackId = Domain->SubscribeSimpleItemModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeSimpleItemModels(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
consumeSimpleItems
Use (consume) simple items from the player’s inventory
Reduces the quantity of one or more simple items in the player’s inventory. You can consume multiple item types at once in a single call. Use this when the player spends resources through game-specific logic — for example, spending crafting materials to forge a weapon, or using consumable items in battle. Note: if items are consumed as a cost for purchasing products (GS2-Showcase) or starting quests (GS2-Quest), those systems handle item consumption automatically — you don’t need to call this API for those cases.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| consumeCounts | List<EzConsumeCount> | ✓ | 1 ~ 100 items | List of consumption quantities of Simple Items |
Result
| Type | Description | |
|---|---|---|
| items | List<EzSimpleItem> | List of Simple Items per post-consumption |
Error
Special exceptions are defined in this API. GS2-SDK for GameEngine provides specialized exceptions derived from general exceptions to facilitate handling of errors that may need to be handled in games. Please refer to the documentation here for more information on common error types and handling methods.
| Type | Base Type | Description |
|---|---|---|
| ConflictException | ConflictException | Item manipulation process conflicted. Retry required. |
| InsufficientException | BadRequestException | Insufficient quantity of items in your possession. |
Implementation Example
try {
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "inventory-0001"
);
var result = await domain.ConsumeSimpleItemsAsync(
consumeCounts: new List<Gs2.Unity.Gs2Inventory.Model.EzConsumeCount> {
new Gs2.Unity.Gs2Inventory.Model.EzConsumeCount() {
ItemName = "item-0001",
Count = 5,
},
new Gs2.Unity.Gs2Inventory.Model.EzConsumeCount() {
ItemName = "item-0002",
Count = 3,
},
}
);
var item = await result.ModelAsync();
} catch(Gs2.Gs2Inventory.Exception.ConflictException e) {
// Item manipulation process conflicted. Retry required.
} catch(Gs2.Gs2Inventory.Exception.InsufficientException e) {
// Insufficient quantity of items in your possession.
} var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "inventory-0001"
);
var future = domain.ConsumeSimpleItemsFuture(
consumeCounts: new List<Gs2.Unity.Gs2Inventory.Model.EzConsumeCount> {
new Gs2.Unity.Gs2Inventory.Model.EzConsumeCount() {
ItemName = "item-0001",
Count = 5,
},
new Gs2.Unity.Gs2Inventory.Model.EzConsumeCount() {
ItemName = "item-0002",
Count = 3,
},
}
);
yield return future;
if (future.Error != null)
{
if (future.Error is Gs2.Gs2Inventory.Exception.ConflictException)
{
// Item manipulation process conflicted. Retry required.
}
if (future.Error is Gs2.Gs2Inventory.Exception.InsufficientException)
{
// Insufficient quantity of items in your possession.
}
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->SimpleInventory(
"inventory-0001" // inventoryName
);
const auto Future = Domain->ConsumeSimpleItems(
[]
{
auto v = MakeShared<TArray<TSharedPtr<Gs2::UE5::Inventory::Model::FEzConsumeCount>>>();
v->Add(
MakeShared<Gs2::UE5::Inventory::Model::FEzConsumeCount>()
->WithItemName(TOptional<FString>("item-0001"))
->WithCount(TOptional<int32>(5))
);
v->Add(
MakeShared<Gs2::UE5::Inventory::Model::FEzConsumeCount>()
->WithItemName(TOptional<FString>("item-0002"))
->WithCount(TOptional<int32>(3))
);
return v;
}() // consumeCounts
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
auto e = Future->GetTask().Error();
if (e->IsChildOf(Gs2::Inventory::Error::FConflictError::Class))
{
// Item manipulation process conflicted. Retry required.
}
if (e->IsChildOf(Gs2::Inventory::Error::FInsufficientError::Class))
{
// Insufficient quantity of items in your possession.
}
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();getSimpleItem
Get the count of a specific simple item
Retrieves how many of a specific simple item the player currently owns. Use this to check a specific resource amount — for example, displaying “Gold: 5,000” on the shop screen before a purchase, or “Iron Ore: 150/200 needed” on the crafting screen.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| gameSession | GameSession | ✓ | GameSession |
Result
| Type | Description | |
|---|---|---|
| item | EzSimpleItem | Simple Item |
| itemModel | EzSimpleItemModel | Simple Item Model |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "item"
).SimpleItem(
itemName: "item-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "item"
).SimpleItem(
itemName: "item-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->SimpleInventory(
"item" // inventoryName
)->SimpleItem(
"item-0001" // itemName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "item"
).SimpleItem(
itemName: "item-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "item"
).SimpleItem(
itemName: "item-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->SimpleInventory(
"item" // inventoryName
)->SimpleItem(
"item-0001" // itemName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Inventory::Model::FSimpleItem> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getSimpleItemWithSignature
Get a simple item with a cryptographic signature proving ownership
Retrieves a simple item along with a server-signed signature that proves the player owned this item at the time of the API call. This is useful when you need to verify item ownership on an external server or another system — the signature serves as tamper-proof evidence. For example, you can use this to verify that a player has enough currency or materials before processing a trade on an external marketplace.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to. | ||
| gameSession | GameSession | ✓ | GameSession | |||
| keyId | string | “grn:gs2:{region}:{ownerId}:key:default:key:default” | ~ 1024 chars | Encryption Key GRN |
Result
| Type | Description | |
|---|---|---|
| item | EzSimpleItem | Simple Item |
| simpleItemModel | EzSimpleItemModel | Simple Item Model |
| body | string | Simple Item Information for Signature Subject |
| signature | string | Signature |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "inventory-0001"
).SimpleItem(
itemName: "item-0001"
);
var result = await domain.GetSimpleItemWithSignatureAsync(
keyId: "key-0001"
);
var item = await result.ModelAsync();
var body = result.Body;
var signature = result.Signature; var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "inventory-0001"
).SimpleItem(
itemName: "item-0001"
);
var future = domain.GetSimpleItemWithSignatureFuture(
keyId: "key-0001"
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result;
var body = future.Result.Body;
var signature = future.Result.Signature; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->SimpleInventory(
"inventory-0001" // inventoryName
)->SimpleItem(
"item-0001" // itemName
);
const auto Future = Domain->GetSimpleItemWithSignature(
"key-0001" // keyId
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();
const auto Body = Result->Body;
const auto Signature = Result->Signature;listSimpleItems
Get a list of simple items the player owns in an inventory
Retrieves all simple items that the player currently owns in the specified simple inventory. Each item is a simple name-and-count pair — for example, “Gold: 5000”, “Iron Ore: 150”. Unlike standard inventory items, simple items have no stacking, expiration, or slot limits. Use this to display a resource or material list — for example, showing the player’s currency balance, crafting materials, or consumable counts.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Simple Inventory Model name Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<EzSimpleItem> | List of Simple Items |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "item"
);
var items = await domain.SimpleItemsAsync(
).ToListAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "item"
);
var it = domain.SimpleItems(
);
List<EzSimpleItem> items = new List<EzSimpleItem>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->SimpleInventory(
"item" // inventoryName
);
const auto It = Domain->SimpleItems(
);
TArray<Gs2::UE5::Inventory::Model::FEzSimpleItemPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeSimpleItems(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeSimpleItems(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).SimpleInventory(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeSimpleItems(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeSimpleItems(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->SimpleInventory(
"item" // inventoryName
);
// Start event handling
const auto CallbackId = Domain->SubscribeSimpleItems(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeSimpleItems(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getBigInventoryModel
Get a specific big inventory type definition by name
Retrieves a single big inventory model by specifying its name. The returned information includes the list of big item models that belong to this inventory. Use this to display the details of a specific big inventory type — for example, showing what items are tracked in the “Mega Currency” or “Accumulated Points” inventory.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzBigInventoryModel | Big Inventory Model |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
);
var item = await domain.ModelAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->BigInventoryModel(
"item" // inventoryName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->BigInventoryModel(
"item" // inventoryName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Inventory::Model::FBigInventoryModel> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listBigInventoryModels
Get a list of big inventory type definitions
Retrieves all big inventory models registered in this namespace. A big inventory is designed for items that can have extremely large quantities — beyond what normal integers can handle (e.g., billions or trillions). This is useful for idle/incremental game currencies, accumulated points, or any resource that can grow to very large numbers. Use this to see what types of big inventories are available in the game.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<EzBigInventoryModel> | List of Big Inventory Models |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.BigInventoryModelsAsync(
).ToListAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.BigInventoryModels(
);
List<EzBigInventoryModel> items = new List<EzBigInventoryModel>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->BigInventoryModels(
);
TArray<Gs2::UE5::Inventory::Model::FEzBigInventoryModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeBigInventoryModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeBigInventoryModels(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeBigInventoryModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeBigInventoryModels(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeBigInventoryModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeBigInventoryModels(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getBigItemModel
Get a specific big item definition by name
Retrieves a single big item model by specifying the inventory name and item name. Use this to display the definition of a specific big item type — for example, to show the properties of “Mega Gold” or “Lifetime XP” in the game UI.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzBigItemModel |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
).BigItemModel(
itemName: "item-master-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
).BigItemModel(
itemName: "item-master-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->BigInventoryModel(
"item" // inventoryName
)->BigItemModel(
"item-master-0001" // itemName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
).BigItemModel(
itemName: "item-master-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
).BigItemModel(
itemName: "item-master-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->BigInventoryModel(
"item" // inventoryName
)->BigItemModel(
"item-master-0001" // itemName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Inventory::Model::FBigItemModel> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listBigItemModels
Get a list of big item definitions in an inventory
Retrieves all big item models that belong to the specified big inventory. A big item model defines an item type that can hold extremely large quantities using arbitrary-precision numbers (stored as strings instead of integers). Use this to see what items can exist in a big inventory — for example, listing “Mega Gold”, “Lifetime XP”, “Total Damage Dealt” in the game.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<EzBigItemModel> | List of Big Item Model |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
);
var items = await domain.BigItemModelsAsync(
).ToListAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
);
var it = domain.BigItemModels(
);
List<EzBigItemModel> items = new List<EzBigItemModel>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->BigInventoryModel(
"item" // inventoryName
);
const auto It = Domain->BigItemModels(
);
TArray<Gs2::UE5::Inventory::Model::FEzBigItemModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeBigItemModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeBigItemModels(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).BigInventoryModel(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeBigItemModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeBigItemModels(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->BigInventoryModel(
"item" // inventoryName
);
// Start event handling
const auto CallbackId = Domain->SubscribeBigItemModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeBigItemModels(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
consumeBigItem
Use (consume) a big item from the player’s inventory
Reduces the quantity of a specific big item in the player’s inventory. The consume count is specified as a string to support extremely large values. Use this when the player spends big-number resources through game-specific logic — for example, spending “1,000,000,000 Mega Gold” on a prestige upgrade or consuming accumulated points. Note: if items are consumed as a cost for purchasing products (GS2-Showcase) or starting quests (GS2-Quest), those systems handle item consumption automatically — you don’t need to call this API for those cases.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model name Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| consumeCount | string | ✓ | ~ 1024 chars | Consumption quantity of a Big Item Integer value strings up to 1024 digits |
Result
| Type | Description | |
|---|---|---|
| item | EzBigItem | Big Item per post-consumption |
Error
Special exceptions are defined in this API. GS2-SDK for GameEngine provides specialized exceptions derived from general exceptions to facilitate handling of errors that may need to be handled in games. Please refer to the documentation here for more information on common error types and handling methods.
| Type | Base Type | Description |
|---|---|---|
| ConflictException | ConflictException | Item manipulation process conflicted. Retry required. |
| InsufficientException | BadRequestException | Insufficient quantity of items in your possession. |
Implementation Example
try {
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BigInventory(
inventoryName: "inventory-0001"
).BigItem(
itemName: "item-0001"
);
var result = await domain.ConsumeBigItemAsync(
consumeCount: "1234567890123456789012345678901234567890"
);
var item = await result.ModelAsync();
} catch(Gs2.Gs2Inventory.Exception.ConflictException e) {
// Item manipulation process conflicted. Retry required.
} catch(Gs2.Gs2Inventory.Exception.InsufficientException e) {
// Insufficient quantity of items in your possession.
} var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BigInventory(
inventoryName: "inventory-0001"
).BigItem(
itemName: "item-0001"
);
var future = domain.ConsumeBigItemFuture(
consumeCount: "1234567890123456789012345678901234567890"
);
yield return future;
if (future.Error != null)
{
if (future.Error is Gs2.Gs2Inventory.Exception.ConflictException)
{
// Item manipulation process conflicted. Retry required.
}
if (future.Error is Gs2.Gs2Inventory.Exception.InsufficientException)
{
// Insufficient quantity of items in your possession.
}
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->BigInventory(
"inventory-0001" // inventoryName
)->BigItem(
"item-0001" // itemName
);
const auto Future = Domain->ConsumeBigItem(
"1234567890123456789012345678901234567890" // consumeCount
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
auto e = Future->GetTask().Error();
if (e->IsChildOf(Gs2::Inventory::Error::FConflictError::Class))
{
// Item manipulation process conflicted. Retry required.
}
if (e->IsChildOf(Gs2::Inventory::Error::FInsufficientError::Class))
{
// Insufficient quantity of items in your possession.
}
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();getBigItem
Get the count of a specific big item
Retrieves the current count of a specific big item the player owns. The count is returned as a string to support extremely large values. Use this to check a specific big-number resource — for example, displaying “Mega Gold: 1,234,567,890” on the game’s main screen or “Lifetime XP: 9,876,543,210” on the player profile.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| itemName | string | ✓ | ~ 128 chars | Big Item Model Name The name of the big item model that defines the type of item stored in this record. Used to identify which item definition this big item possession corresponds to. | ||
| gameSession | GameSession | ✓ | GameSession |
Result
| Type | Description | |
|---|---|---|
| item | EzBigItem | Big Item |
| itemModel | EzBigItemModel | Big Item Model |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BigInventory(
inventoryName: "item"
).BigItem(
itemName: "item-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BigInventory(
inventoryName: "item"
).BigItem(
itemName: "item-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->BigInventory(
"item" // inventoryName
)->BigItem(
"item-0001" // itemName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BigInventory(
inventoryName: "item"
).BigItem(
itemName: "item-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BigInventory(
inventoryName: "item"
).BigItem(
itemName: "item-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->BigInventory(
"item" // inventoryName
)->BigItem(
"item-0001" // itemName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Inventory::Model::FBigItem> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listBigItems
Get a list of big items the player owns in an inventory
Retrieves all big items that the player currently owns in the specified big inventory. Each item has a count stored as a string to support extremely large numbers (e.g., “1234567890123456789”). Items that have never been acquired will not appear in the results. Use this to display the player’s big-number resources — for example, showing “Mega Gold: 1,234,567,890” or “Total Damage: 9,876,543,210,000”.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| inventoryName | string | ✓ | ~ 128 chars | Big Inventory Model name Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<EzBigItem> | List of Quantity of Big Items |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BigInventory(
inventoryName: "item"
);
var items = await domain.BigItemsAsync(
).ToListAsync(); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BigInventory(
inventoryName: "item"
);
var it = domain.BigItems(
);
List<EzBigItem> items = new List<EzBigItem>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->BigInventory(
"item" // inventoryName
);
const auto It = Domain->BigItems(
);
TArray<Gs2::UE5::Inventory::Model::FEzBigItemPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BigInventory(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeBigItems(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeBigItems(callbackId); var domain = gs2.Inventory.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BigInventory(
inventoryName: "item"
);
// Start event handling
var callbackId = domain.SubscribeBigItems(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeBigItems(callbackId); const auto Domain = Gs2->Inventory->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->BigInventory(
"item" // inventoryName
);
// Start event handling
const auto CallbackId = Domain->SubscribeBigItems(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeBigItems(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.