GS2-Inventory Script トリガーリファレンス
拡張スクリプトを呼び出す イベントトリガー のリファレンス
トリガー
acquire
アイテム入手
同期実行スクリプト
スクリプト、アイテム入手の順に同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| inventory | Inventory | インベントリ |
| itemSets | ItemSet[] | 有効期限ごとのアイテム所持数量のリスト |
| acquireItemName | string | 入手したアイテムモデル名 |
| userId | string | ユーザーID |
| acquireCount | long | 入手数量 |
| expiresAt | long | 有効期限 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | アイテム入手を許可するか | ||
| overrideAcquireCount | int | 0 ~ 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
}非同期実行スクリプト
アイテム入手の実行後にスクリプトが非同期実行されます。
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
アイテム数が入手上限に当たり、入手できなかった数量の通知完了
同期実行スクリプト
スクリプト、アイテム数が入手上限に当たり、入手できなかった数量の通知完了の順に同期実行されます。
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
アイテム消費
同期実行スクリプト
スクリプト、アイテム消費の順に同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| inventory | Inventory | インベントリ |
| itemSets | ItemSet[] | 有効期限ごとのアイテム所持数量のリスト |
| consumeItemName | string | 消費したアイテムモデル名 |
| userId | string | ユーザーID |
| consumeCount | long | 消費数量 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | アイテム消費を許可するか | ||
| overrideConsumeCount | int | 0 ~ 2147483645 | 実際に適用する消費量 |
実装例
namespace = args.namespace
inventory = args.inventory
itemSets = args.itemSets
consumeItemName = args.consumeItemName
userId = args.userId
consumeCount = args.consumeCount
result = {
permit=permit,
overrideConsumeCount=overrideConsumeCount
}非同期実行スクリプト
アイテム消費の実行後にスクリプトが非同期実行されます。
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 = {
}simpleItemAcquire
シンプルアイテム入手
同期実行スクリプト
スクリプト、シンプルアイテム入手の順に同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| inventoryName | string | シンプルインベントリモデル名 |
| simpleItems | SimpleItem[] | 有効期限ごとのシンプルアイテム所持数量のリスト |
| userId | string | ユーザーID |
| acquireCounts | AcquireCount[] | シンプルアイテムの入手数量リスト |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | シンプルアイテム入手を許可するか | ||
| overrideAcquireCounts | AcquireCount[] | 0 ~ 100 items | シンプルアイテムの入手数量リスト |
実装例
namespace = args.namespace
inventoryName = args.inventoryName
simpleItems = args.simpleItems
userId = args.userId
acquireCounts = args.acquireCounts
result = {
permit=permit,
overrideAcquireCounts=overrideAcquireCounts
}非同期実行スクリプト
シンプルアイテム入手の実行後にスクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| inventoryName | string | シンプルインベントリモデル名 |
| oldSimpleItems | SimpleItem[] | 有効期限ごとのシンプルアイテム所持数量のリスト |
| newSimpleItems | SimpleItem[] | 有効期限ごとのシンプルアイテム所持数量のリスト |
| userId | string | ユーザーID |
| acquireCounts | AcquireCount[] | シンプルアイテムの入手数量リスト |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 |
|---|
実装例
namespace = args.namespace
inventoryName = args.inventoryName
oldSimpleItems = args.oldSimpleItems
newSimpleItems = args.newSimpleItems
userId = args.userId
acquireCounts = args.acquireCounts
result = {
}simpleItemConsume
シンプルアイテム消費
同期実行スクリプト
スクリプト、シンプルアイテム消費の順に同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| inventoryName | string | シンプルインベントリモデル名 |
| simpleItems | SimpleItem[] | シンプルアイテム一覧 |
| userId | string | ユーザーID |
| consumeCounts | ConsumeCount[] | シンプルアイテムの消費数量リスト |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | シンプルアイテム消費を許可するか | ||
| overrideConsumeCounts | ConsumeCount[] | 0 ~ 100 items | シンプルアイテムの消費数量リスト |
実装例
namespace = args.namespace
inventoryName = args.inventoryName
simpleItems = args.simpleItems
userId = args.userId
consumeCounts = args.consumeCounts
result = {
permit=permit,
overrideConsumeCounts=overrideConsumeCounts
}非同期実行スクリプト
シンプルアイテム消費の実行後にスクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| inventoryName | string | シンプルインベントリモデル名 |
| oldSimpleItems | SimpleItem[] | 更新前のシンプルアイテム一覧 |
| newSimpleItems | SimpleItem[] | 更新後のシンプルアイテム一覧 |
| userId | string | ユーザーID |
| consumeCounts | ConsumeCount[] | シンプルアイテムの消費数量リスト |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 |
|---|
実装例
namespace = args.namespace
inventoryName = args.inventoryName
oldSimpleItems = args.oldSimpleItems
newSimpleItems = args.newSimpleItems
userId = args.userId
consumeCounts = args.consumeCounts
result = {
}bigItemAcquire
巨大アイテム入手
同期実行スクリプト
スクリプト、巨大アイテム入手の順に同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| inventoryName | string | 巨大インベントリモデル名 |
| itemName | string | 巨大アイテムモデル名 |
| item | BigItem | 巨大アイテム |
| userId | string | ユーザーID |
| acquireCount | string | 巨大アイテムの入手数量リスト |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 巨大アイテム入手を許可するか | ||
| rate | float | 1.0 | 0 ~ 1000 | 入手量の倍率 |
実装例
namespace = args.namespace
inventoryName = args.inventoryName
itemName = args.itemName
item = args.item
userId = args.userId
acquireCount = args.acquireCount
result = {
permit=permit,
rate=rate
}非同期実行スクリプト
巨大アイテム入手の実行後にスクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| inventoryName | string | 巨大インベントリモデル名 |
| itemName | string | 巨大アイテムモデル名 |
| oldItem | BigItem | 更新前の巨大アイテム |
| newItem | BigItem | 更新後の巨大アイテム |
| userId | string | ユーザーID |
| acquireCount | string | 巨大アイテムの入手数量リスト |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 |
|---|
実装例
namespace = args.namespace
inventoryName = args.inventoryName
itemName = args.itemName
oldItem = args.oldItem
newItem = args.newItem
userId = args.userId
acquireCount = args.acquireCount
result = {
}bigItemConsume
巨大アイテム消費
同期実行スクリプト
スクリプト、巨大アイテム消費の順に同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| inventoryName | string | 巨大インベントリモデル名 |
| itemName | string | 巨大アイテムモデル名 |
| item | BigItem | 巨大アイテム |
| userId | string | ユーザーID |
| consumeCount | string | 巨大アイテムの消費数量リスト |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 巨大アイテム消費を許可するか | ||
| rate | float | 1.0 | 0 ~ 1000 | 消費量の倍率 |
実装例
namespace = args.namespace
inventoryName = args.inventoryName
itemName = args.itemName
item = args.item
userId = args.userId
consumeCount = args.consumeCount
result = {
permit=permit,
rate=rate
}非同期実行スクリプト
巨大アイテム消費の実行後にスクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| inventoryName | string | 巨大インベントリモデル名 |
| itemName | string | 巨大アイテムモデル名 |
| oldItem | BigItem | 更新前の巨大アイテム |
| newItem | BigItem | 更新後の巨大アイテム |
| userId | string | ユーザーID |
| consumeCount | string | 巨大アイテムの消費数量リスト |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 |
|---|
実装例
namespace = args.namespace
inventoryName = args.inventoryName
itemName = args.itemName
oldItem = args.oldItem
newItem = args.newItem
userId = args.userId
consumeCount = args.consumeCount
result = {
}