Master Data Reference of GS2-Exchange
Master Data Format
{
"version": "2019-08-19",
"rateModels": [
{
"name": "[string]Exchange Rate Model name",
"metadata": "[string?]Metadata",
"verifyActions": [
{
"action": "[string]Types of actions to be performed in the verify task",
"request": "[string]JSON string of the request used when executing the action"
}
],
"consumeActions": [
{
"action": "[string]Types of actions to be performed in the consume action",
"request": "[string]JSON string of the request used when executing the action"
}
],
"timingType": "[string enum]Type of exchange",
"lockTime": "[int]Waiting time (minutes) from the execution of the exchange until the reward is actually received",
"acquireActions": [
{
"action": "[string]Types of actions to be performed in the acquire action",
"request": "[string]JSON string of the request used when executing the action"
}
]
}
],
"incrementalRateModels": [
{
"name": "[string]Cost Increase Exchange Rate Model name",
"metadata": "[string?]Metadata",
"consumeAction": {
"action": "[string]Types of actions to be performed in the consume action",
"request": "[string]JSON string of the request used when executing the action"
},
"calculateType": "[string enum]Calculation method for cost increase amount",
"baseValue": "[long]Base Value",
"coefficientValue": "[long]Coefficient Value",
"calculateScriptId": "[string]GRN of cost calculation script",
"exchangeCountId": "[string]GRN of GS2-Limit model that manages the number of exchanges",
"maximumExchangeCount": "[int]Maximum number of exchanges",
"acquireActions": [
{
"action": "[string]Types of actions to be performed in the acquire action",
"request": "[string]JSON string of the request used when executing the action"
}
]
}
]
}| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| version | string | ✓ | 2019-08-19 | Format version of master data | ||
| rateModels | List<RateModel> | ~ 10000 items | Exchange Rate Model The exchange rate is an entity that defines the rate used to exchange resources for resources. In addition to the rate at which a resource can be exchanged immediately, a rate can also be set at which a resource can be exchanged after a certain amount of time in real time has elapsed. Exchange rates that require an elapse of time in real time can further define the resources required to perform an immediate exchange. | |||
| incrementalRateModels | List<IncrementalRateModel> | ~ 10000 items | Cost Increase Exchange Rate Model Normal exchange rates always provide exchanges at a constant rate. With incremental exchange rates, you can define a rate that increases in cost as the number of exchanges increases. For example, the first exchange can be exchanged at a rate of 1:1, but the second exchange can be exchanged at a rate of 2:1. By defining such a rate, you can increase the value of the resources obtained by the player as the game progresses. The number of exchanges can be reset by the passage of real time. This is useful for resetting the number of exchanges on a daily or weekly basis. |
Model
RateModel
Exchange Rate Model
The exchange rate is an entity that defines the rate used to exchange resources for resources.
In addition to the rate at which a resource can be exchanged immediately, a rate can also be set at which a resource can be exchanged after a certain amount of time in real time has elapsed. Exchange rates that require an elapse of time in real time can further define the resources required to perform an immediate exchange.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| rateModelId | string | ✓* | ~ 1024 chars | Exchange rate model GRN * Automatically configured on the server | ||||||||
| name | string | ✓ | ~ 128 chars | Exchange Rate Model name Exchange rate model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||||||||
| verifyActions | List<VerifyAction> | [] | 0 ~ 10 items | List of Verify Action | ||||||||
| consumeActions | List<ConsumeAction> | [] | 0 ~ 10 items | List of Consume Action | ||||||||
| timingType | String Enum enum { “immediate”, “await” } | ✓ | “immediate” | Type of exchange
| ||||||||
| lockTime | int | {timingType} == “await” | ✓* | 0 ~ 538214400 | Waiting time (minutes) from the execution of the exchange until the reward is actually received * Required if timingType is “await” | |||||||
| acquireActions | List<AcquireAction> | [] | 0 ~ 100 items | List of Acquire Action |
AcquireAction
Acquire Action
ConsumeAction
Consume Action
VerifyAction
Verify Action
IncrementalRateModel
Cost Increase Exchange Rate Model
Normal exchange rates always provide exchanges at a constant rate. With incremental exchange rates, you can define a rate that increases in cost as the number of exchanges increases. For example, the first exchange can be exchanged at a rate of 1:1, but the second exchange can be exchanged at a rate of 2:1. By defining such a rate, you can increase the value of the resources obtained by the player as the game progresses.
The number of exchanges can be reset by the passage of real time. This is useful for resetting the number of exchanges on a daily or weekly basis.
| Type | Condition | Required | Default | Value Limits | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| incrementalRateModelId | string | ✓* | ~ 1024 chars | Cost increase exchange rate model GRN * Automatically configured on the server | ||||||||||
| name | string | ✓ | ~ 128 chars | Cost Increase Exchange Rate Model name Cost Increase Exchange Rate Model-specific names. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). | ||||||||||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||||||||||
| consumeAction | ConsumeAction | ✓ | Consumption Action (Quantity/Value is overwritten so no setting is required) | |||||||||||
| calculateType | String Enum enum { “linear”, “power”, “gs2_script” } | ✓ | Calculation method for cost increase amount
| |||||||||||
| baseValue | long | {calculateType} == “linear” | ✓* | 0 ~ 9223372036854775805 | Base Value * Required if calculateType is “linear” | |||||||||
| coefficientValue | long | {calculateType} in [“linear”, “power”] | ✓* | 0 ~ 9223372036854775805 | Coefficient Value * Required if calculateType is “linear”,“power” | |||||||||
| calculateScriptId | string | {calculateType} == “gs2_script” | ✓* | ~ 1024 chars | GRN
of cost calculation script Script Trigger Reference - calculateCost* Required if calculateType is “gs2_script” | |||||||||
| exchangeCountId | string | ✓ | ~ 1024 chars | GRN of GS2-Limit model that manages the number of exchanges | ||||||||||
| maximumExchangeCount | int | ✓ | 2147483646 | 0 ~ 2147483646 | Maximum number of exchanges | |||||||||
| acquireActions | List<AcquireAction> | [] | 0 ~ 100 items | List of Acquire Action |