GS2-Inventory Script トリガーリファレンス
acquire
アイテム入手実行前にGS2-Scriptを呼び出すイベントトリガー
Request
型 | 説明 | |
---|
namespace | Namespace | ネームスペース |
inventory | Inventory | インベントリ |
itemSets | ItemSet[] | 有効期限ごとのアイテム所持数量のリスト |
acquireItemName | string | 入手したアイテムモデル名 |
userId | string | ユーザーID |
acquireCount | long | 入手数量 |
expiresAt | long | 有効期限 |
Result
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|
permit | bool | ✓ | | | アイテム入手を許可するか |
overrideAcquireCount | int | | | ~ 2147483645 | 実際に適用する入手量 |
実装例
namespace = args.namespace
inventory = args.inventory
itemSets = args.itemSets
acquireItemName = args.acquireItemName
userId = args.userId
acquireCount = args.acquireCount
expiresAt = args.expiresAt
result = {
permit=permit,
overrideAcquireCount=overrideAcquireCount
}
acquireDone
アイテム入手実行後にGS2-Scriptを呼び出すイベントトリガー
Request
型 | 説明 | |
---|
namespace | Namespace | ネームスペース |
oldInventory | Inventory | 更新前のインベントリ |
oldItemSets | ItemSet[] | 更新前の有効期限ごとのアイテム所持数量リスト |
newInventory | Inventory | 更新後のインベントリ |
newItemSets | ItemSet[] | 更新後の有効期限ごとのアイテム所持数量のリスト |
acquireItemName | string | 入手したアイテムモデル名 |
userId | string | ユーザーID |
acquireCount | long | 入手数量 |
overflowValue | long | 溢れた量 |
expiresAt | long | 有効期限 |
Result
実装例
namespace = args.namespace
oldInventory = args.oldInventory
oldItemSets = args.oldItemSets
newInventory = args.newInventory
newItemSets = args.newItemSets
acquireItemName = args.acquireItemName
userId = args.userId
acquireCount = args.acquireCount
overflowValue = args.overflowValue
expiresAt = args.expiresAt
result = {
}
overflowDone
アイテム数が入手上限に当たり、入手できなかった数量の通知完了実行時にGS2-Scriptを呼び出すイベントトリガー
Request
型 | 説明 | |
---|
namespace | Namespace | ネームスペース |
inventory | Inventory | インベントリ |
itemModel | ItemModel | アイテムモデル |
userId | string | ユーザーID |
overflowValue | long | 溢れた量 |
Result
実装例
namespace = args.namespace
inventory = args.inventory
itemModel = args.itemModel
userId = args.userId
overflowValue = args.overflowValue
result = {
}
consume
アイテム消費実行前にGS2-Scriptを呼び出すイベントトリガー
Request
型 | 説明 | |
---|
namespace | Namespace | ネームスペース |
inventory | Inventory | インベントリ |
itemSets | ItemSet[] | 有効期限ごとのアイテム所持数量のリスト |
consumeItemName | string | 消費したアイテムモデル名 |
userId | string | ユーザーID |
consumeCount | long | 消費数量 |
Result
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|
permit | bool | ✓ | | | アイテム消費を許可するか |
overrideConsumeCount | int | | | ~ 2147483645 | 実際に適用する消費量 |
実装例
namespace = args.namespace
inventory = args.inventory
itemSets = args.itemSets
consumeItemName = args.consumeItemName
userId = args.userId
consumeCount = args.consumeCount
result = {
permit=permit,
overrideConsumeCount=overrideConsumeCount
}
consumeDone
アイテム消費実行後にGS2-Scriptを呼び出すイベントトリガー
Request
型 | 説明 | |
---|
namespace | Namespace | ネームスペース |
oldInventory | Inventory | 消費前のインベントリ |
oldItemSets | ItemSet[] | 消費前の有効期限ごとのアイテム所持数量のリスト |
newInventory | Inventory | 消費後のインベントリ |
newItemSets | ItemSet[] | 消費後の有効期限ごとのアイテム所持数量のリスト |
consumeItemName | string | 消費したアイテムモデル名 |
userId | string | ユーザーID |
consumeCount | long | 消費数量 |
Result
実装例
namespace = args.namespace
oldInventory = args.oldInventory
oldItemSets = args.oldItemSets
newInventory = args.newInventory
newItemSets = args.newItemSets
consumeItemName = args.consumeItemName
userId = args.userId
consumeCount = args.consumeCount
result = {
}