GS2-AdReward Script トリガー リファレンス
拡張スクリプトを呼び出す イベントトリガー のリファレンス
トリガー
acquirePoint
ポイント獲得
同期実行スクリプト
ポイント獲得処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| point | Point | 獲得処理前ポイント |
| acquirePointValue | long | 獲得ポイント量 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ポイント獲得を許可するか | ||
| overridePointValue | long | 0 ~ 2147483645 | 上書きする獲得ポイント量 |
実装例
-- Request
local namespace = args.namespace
local point = args.point
local acquirePointValue = args.acquirePointValue
-- Business logic:
local permit = true
local overridePointValue = 0
-- Result
result = {
permit=permit,
overridePointValue=overridePointValue
}非同期実行スクリプト
ポイント獲得処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| point | Point | 獲得処理前ポイント |
| afterPoint | Point | 獲得後ポイント |
| acquirePointValue | long | 獲得ポイント量 |
実装例
-- Request
local namespace = args.namespace
local point = args.point
local afterPoint = args.afterPoint
local acquirePointValue = args.acquirePointValue
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}consumePoint
ポイント消費
同期実行スクリプト
ポイント消費処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| point | Point | 消費処理前ポイント |
| consumePointValue | long | 消費ポイント量 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ポイント消費を許可するか | ||
| overridePointValue | long | 0 ~ 2147483645 | 上書きする消費ポイント量 |
実装例
-- Request
local namespace = args.namespace
local point = args.point
local consumePointValue = args.consumePointValue
-- Business logic:
local permit = true
local overridePointValue = 0
-- Result
result = {
permit=permit,
overridePointValue=overridePointValue
}非同期実行スクリプト
ポイント消費処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| point | Point | 消費処理前ポイント |
| afterPoint | Point | 消費後ポイント |
| consumePointValue | long | 消費ポイント量 |
実装例
-- Request
local namespace = args.namespace
local point = args.point
local afterPoint = args.afterPoint
local consumePointValue = args.consumePointValue
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}