GS2-Limit Script トリガーリファレンス
拡張スクリプトを呼び出す イベントトリガー のリファレンス
トリガー
countUp
カウントアップ
同期実行スクリプト
スクリプト、カウントアップの順に同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| limitModel | LimitModel | 回数制限モデル |
| counter | Counter | カウンター |
| userId | string | ユーザーID |
| countUpValue | int | カウントアップする量 |
| maxValue | int | カウントアップを許容する最大値 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | カウントアップを許可するか |
実装例
namespace = args.namespace
limitModel = args.limitModel
counter = args.counter
userId = args.userId
countUpValue = args.countUpValue
maxValue = args.maxValue
result = {
permit=permit
}非同期実行スクリプト
カウントアップの実行後にスクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| limitModel | LimitModel | 回数制限モデル |
| oldCounter | Counter | 更新前のカウンター |
| newCounter | Counter | 更新後のカウンター |
| userId | string | ユーザーID |
| countUpValue | int | カウントアップする量 |
| maxValue | int | カウントアップを許容する最大値 |
実装例
namespace = args.namespace
limitModel = args.limitModel
oldCounter = args.oldCounter
newCounter = args.newCounter
userId = args.userId
countUpValue = args.countUpValue
maxValue = args.maxValue
result = {
}