GS2-Exchange Script トリガーリファレンス
exchange
交換実行前にGS2-Scriptを呼び出すイベントトリガー
Request
型 | 説明 | |
---|
namespace | Namespace | ネームスペース |
rateModel | RateModel | 交換レートモデル |
userId | string | 交換を実行しているユーザID |
count | int | 交換量 |
config | Config[] | スタンプシートの変数に適用する設定値 |
Result
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|
permit | bool | ✓ | | | 交換を許可するか |
実装例
namespace = args.namespace
rateModel = args.rateModel
userId = args.userId
count = args.count
config = args.config
result = {
permit=permit
}
exchangeDone
交換実行後にGS2-Scriptを呼び出すイベントトリガー
Request
型 | 説明 | |
---|
namespace | Namespace | ネームスペース |
rateModel | RateModel | 交換レートモデル |
userId | string | 交換を実行しているユーザID |
count | int | 交換量 |
config | Config[] | スタンプシートの変数に適用する設定値 |
Result
実装例
namespace = args.namespace
rateModel = args.rateModel
userId = args.userId
count = args.count
config = args.config
result = {
}
calculateCost
コスト上昇型交換レートのためのコスト計算スクリプト実行時にGS2-Scriptを呼び出すイベントトリガー
Request
型 | 説明 | |
---|
namespace | Namespace | ネームスペース |
incrementalRateModel | IncrementalRateModel | コスト上昇型交換モデル |
currentExchangeCount | int | 現在の交換回数 |
quantity | int | 交換数量 |
Result
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|
cost | long | ✓ | | ~ 9223372036854775805 | コスト |
実装例
namespace = args.namespace
incrementalRateModel = args.incrementalRateModel
currentExchangeCount = args.currentExchangeCount
quantity = args.quantity
result = {
cost=cost
}