GS2-LoginReward Script トリガー リファレンス
拡張スクリプトを呼び出す イベントトリガー のリファレンス
トリガー
receive
受け取り
同期実行スクリプト
受け取り処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| bonusModel | BonusModel | ログインボーナスモデル |
| userId | string | 受け取りを実行しているユーザーID |
| receiveStep | int | 受け取ったステップ |
| config | Config[] | トランザクションの変数に適用する設定値 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 受け取りを許可するか |
実装例
-- Request
local namespace = args.namespace
local bonusModel = args.bonusModel
local userId = args.userId
local receiveStep = args.receiveStep
local config = args.config
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
受け取り処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| bonusModel | BonusModel | ログインボーナスモデル |
| userId | string | 受け取りを実行しているユーザーID |
| receiveStep | int | 受け取ったステップ |
| config | Config[] | トランザクションの変数に適用する設定値 |
実装例
-- Request
local namespace = args.namespace
local bonusModel = args.bonusModel
local userId = args.userId
local receiveStep = args.receiveStep
local config = args.config
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}