GS2-AdReward Script トリガー リファレンス

拡張スクリプトを呼び出すイベントトリガーのリファレンス

トリガー

acquirePoint

ポイント獲得

同期実行スクリプト

ポイント獲得処理の前に、スクリプトが同期実行されます。

Request
説明
namespaceNamespaceネームスペース
pointPoint獲得処理前ポイント
acquirePointValuelong獲得ポイント量
Result
必須デフォルト値の制限説明
permitbool
ポイント獲得を許可するか
overridePointValuelong0 ~ 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
説明
namespaceNamespaceネームスペース
pointPoint獲得処理前ポイント
afterPointPoint獲得後ポイント
acquirePointValuelong獲得ポイント量
実装例
-- Request
local namespace = args.namespace
local point = args.point
local afterPoint = args.afterPoint
local acquirePointValue = args.acquirePointValue

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}

consumePoint

ポイント消費

同期実行スクリプト

ポイント消費処理の前に、スクリプトが同期実行されます。

Request
説明
namespaceNamespaceネームスペース
pointPoint消費処理前ポイント
consumePointValuelong消費ポイント量
Result
必須デフォルト値の制限説明
permitbool
ポイント消費を許可するか
overridePointValuelong0 ~ 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
説明
namespaceNamespaceネームスペース
pointPoint消費処理前ポイント
afterPointPoint消費後ポイント
consumePointValuelong消費ポイント量
実装例
-- Request
local namespace = args.namespace
local point = args.point
local afterPoint = args.afterPoint
local consumePointValue = args.consumePointValue

-- 非同期スクリプトは通常、API のレスポンスには影響を与えません。
-- ログ出力や分析、外部通知などに使用します。

result = {
}