GS2-Experience Script トリガー リファレンス
拡張スクリプトを呼び出す イベントトリガー のリファレンス
トリガー
rankCapScript
ランクキャップ取得
同期実行スクリプト
ランクキャップ取得処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| experienceModel | ExperienceModel | 経験値モデル |
| userId | string | ユーザーID |
| propertyId | string | プロパティID ユーザースコープ内でこのステータスを一意に識別する開発者定義の識別子です。経験値を持つ GS2-Inventory のアイテムセット GRN や GS2-Dictionary のエントリー GRN の末尾に経験値モデルのサフィックスを付与した値を使用することを推奨します。 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| rankCap | long | ✓ | 0 ~ 2147483645 | ランクキャップ |
実装例
-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local userId = args.userId
local propertyId = args.propertyId
-- Business logic:
local rankCap = 0
-- Result
result = {
rankCap=rankCap
}changeExperience
経験値変化
同期実行スクリプト
経験値変化処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| experienceModel | ExperienceModel | 経験値モデル |
| status | Status | 変化前ステータス |
| afterStatus | Status | 変化後ステータス |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 経験値変化 を許可するか | ||
| overrideExperienceValue | long | ✓ | 0 ~ 2147483645 | 上書きする経験値 |
実装例
-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local status = args.status
local afterStatus = args.afterStatus
-- Business logic:
local permit = true
local overrideExperienceValue = 0
-- Result
result = {
permit=permit,
overrideExperienceValue=overrideExperienceValue
}非同期実行スクリプト
経験値変化処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| experienceModel | ExperienceModel | 経験値モデル |
| oldStatus | Status | 変化前のステータス |
| status | Status | ステータス |
実装例
-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local oldStatus = args.oldStatus
local status = args.status
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}changeRank
ランク変化
同期実行スクリプト
ランク変化処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| experienceModel | ExperienceModel | 経験値モデル |
| status | Status | 変化前のステータス |
| afterStatus | Status | 変化後のステータス |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ランク変化 を許可するか |
実装例
-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local status = args.status
local afterStatus = args.afterStatus
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
ランク変化処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| experienceModel | ExperienceModel | 経験値モデル |
| oldStatus | Status | 変化前のステータス |
| status | Status | ステータス |
実装例
-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local oldStatus = args.oldStatus
local status = args.status
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}changeRankCap
ランクキャップ変化
同期実行スクリプト
ランクキャップ変化処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| experienceModel | ExperienceModel | 経験値モデル |
| status | Status | 変化前のステータス |
| afterStatus | Status | 変化後のステータス |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ランクキャップ変化 を許可するか | ||
| overrideRankCapValue | long | ✓ | 0 ~ 2147483645 | 新しいランクキャップ |
実装例
-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local status = args.status
local afterStatus = args.afterStatus
-- Business logic:
local permit = true
local overrideRankCapValue = 0
-- Result
result = {
permit=permit,
overrideRankCapValue=overrideRankCapValue
}非同期実行スクリプト
ランクキャップ変化処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| experienceModel | ExperienceModel | 経験値モデル |
| status | Status | ステータス |
実装例
-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local status = args.status
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}overflowExperience
経験値あふれ
同期実行スクリプト
経験値あふれ処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| experienceModel | ExperienceModel | 経験値モデル |
| status | Status | ステータス |
| overflowExperienceValue | long | 経験値あふれ量 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 経験値あふれ を許可するか |
実装例
-- Request
local namespace = args.namespace
local experienceModel = args.experienceModel
local status = args.status
local overflowExperienceValue = args.overflowExperienceValue
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}