Master Data Reference of GS2-Inventory
{
"version": "2019-02-05",
"inventoryModels": [
{
"name": "[string]Inventory Model Name",
"metadata": "[string?]Metadata",
"initialCapacity": "[int]Initial Capacity",
"maxCapacity": "[int]Maximum Capacity",
"protectReferencedItem": "[bool?]Item Sets with registered references cannot be deleted",
"itemModels": [
{
"itemModelId": "[string]Item Model GRN",
"name": "[string]Item Model Name",
"metadata": "[string?]Metadata",
"stackingLimit": "[long]Maximum stackable quantity",
"allowMultipleStacks": "[bool]Allow items to be stored in multiple slots when the maximum stackable quantity is exceeded",
"sortValue": "[int]Display order"
}
]
}
],
"simpleInventoryModels": [
{
"name": "[string]Simple Inventory Model Name",
"metadata": "[string?]Metadata",
"simpleItemModels": [
{
"itemModelId": "[string]Simple Item Model GRN",
"name": "[string]Simple Item Model Name",
"metadata": "[string?]Metadata"
}
]
}
],
"bigInventoryModels": [
{
"name": "[string]Big Inventory Model Name",
"metadata": "[string?]Metadata",
"bigItemModels": [
{
"itemModelId": "[string]Big Item Model GRN",
"name": "[string]Big Item Model Name",
"metadata": "[string?]Metadata"
}
]
}
]
}
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| version | ✓ | 2019-02-05 | Format version of master data | |||
| inventoryModels | List<InventoryModel> | ~ 50 items | 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. | |||
| simpleInventoryModels | List<SimpleInventoryModel> | ~ 50 items | 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 an API that can increase or decrease the number of items in a single process. | |||
| bigInventoryModels | List<BigInventoryModel> | ~ 50 items | 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 64bit integer values. 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. |
AcquireCount
Quantity of simple items obtained
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name | ||
| count | long | ✓ | 1 ~ 9223372036854775805 | Quantity to be obtained |
ConsumeCount
Consumption quantity of simple items
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name | ||
| count | long | ✓ | 1 ~ 9223372036854775805 | Quantity to be consumed |
HeldCount
Quantity of simple items in possession
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| itemName | string | ✓ | ~ 128 chars | Simple Item Model Name | ||
| count | long | ✓ | 0 ~ 9223372036854775805 | Number of items held |
InventoryModel
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 | |
|---|---|---|---|---|---|---|
| inventoryModelId | string | ✓ | ~ 1024 chars | Inventory model GRN | ||
| name | string | ✓ | ~ 128 chars | Inventory Model Name | ||
| metadata | string | ~ 2048 chars | Metadata | |||
| initialCapacity | int | ✓ | 0 ~ 2147483646 | Initial Capacity | ||
| maxCapacity | int | ✓ | 0 ~ 2147483646 | Maximum Capacity | ||
| protectReferencedItem | bool? | false | Item Sets with registered references cannot be deleted | |||
| itemModels | List<ItemModel> | ✓ | [] | 1 ~ 1000 items | List of item models that can be stored in inventory |
ItemModel
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 | |
|---|---|---|---|---|---|---|
| itemModelId | string | ✓ | ~ 1024 chars | Item Model GRN | ||
| name | string | ✓ | ~ 128 chars | Item Model Name | ||
| 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 | ||
| allowMultipleStacks | bool | ✓ | Allow items to be stored in multiple slots when the maximum stackable quantity is exceeded | |||
| sortValue | int | ✓ | 0 ~ 2147483646 | Display order |
SimpleInventoryModel
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 an API that can increase or decrease the number of items in a single process.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| inventoryModelId | string | ✓ | ~ 1024 chars | Inventory model GRN | ||
| name | string | ✓ | ~ 128 chars | Simple Inventory Model Name | ||
| metadata | string | ~ 2048 chars | Metadata | |||
| simpleItemModels | List<SimpleItemModel> | ✓ | [] | 1 ~ 1000 items | List of simple item models that can be stored in inventory |
SimpleItemModel
Simple ItemModel
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 | |
|---|---|---|---|---|---|---|
| itemModelId | string | ✓ | ~ 1024 chars | Simple Item Model GRN | ||
| name | string | ✓ | ~ 128 chars | Simple Item Model Name | ||
| metadata | string | ~ 2048 chars | Metadata |
BigInventoryModel
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 64bit integer values. 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 | |
|---|---|---|---|---|---|---|
| inventoryModelId | string | ✓ | ~ 1024 chars | Inventory model GRN | ||
| name | string | ✓ | ~ 128 chars | Big Inventory Model Name | ||
| metadata | string | ~ 2048 chars | Metadata | |||
| bigItemModels | List<BigItemModel> | ✓ | [] | 1 ~ 1000 items | List of big item models that can be stored in inventory |
BigItemModel
Big ItemModel
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 | |
|---|---|---|---|---|---|---|
| itemModelId | string | ✓ | ~ 1024 chars | Big Item Model GRN | ||
| name | string | ✓ | ~ 128 chars | Big Item Model Name | ||
| metadata | string | ~ 2048 chars | Metadata |