Master Data Reference of GS2-Exchange
{
"version": "2019-08-19",
"rateModels": [
{
"name": "[string]Exchange Rate Name",
"metadata": "[string?]metadata",
"verifyActions": [
{
"action": "[string]Types of actions to be performed in the verify task",
"request": "[string]JSON of request"
}
],
"consumeActions": [
{
"action": "[string]Types of actions to be performed in the consume action",
"request": "[string]JSON of request"
}
],
"timingType": "[string]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 of request"
}
]
}
],
"incrementalRateModels": [
{
"name": "[string]Cost Increase Type Exchange Rate Name",
"metadata": "[string?]metadata",
"consumeAction": {
"action": "[string]Types of actions to be performed in the consume action",
"request": "[string]JSON of request"
},
"calculateType": "[string]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 of request"
}
]
}
]
}
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
version | ✓ | 2019-08-19 | Format version of master data | |||
rateModels | List<RateModel> | ~ 10000 items | Exchange Rate Model | |||
incrementalRateModels | List<IncrementalRateModel> | ~ 10000 items | Cost increase type exchange rate 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 | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
rateModelId | string | ✓ | ~ 1024 chars | Exchange rate model GRN | ||
name | string | ✓ | ~ 128 chars | Exchange Rate Name | ||
metadata | string | ~ 2048 chars | metadata | |||
verifyActions | List<VerifyAction> | [] | ~ 10 items | List of Verify Action | ||
consumeActions | List<ConsumeAction> | [] | ~ 10 items | List of Consume Action | ||
timingType | enum { “immediate”, “await” } | ✓ | “immediate” | ~ 128 chars | Type of exchange | |
lockTime | int | {timingType} == “await” | ✓ | ~ 525600 | Waiting time (minutes) from the execution of the exchange until the reward is actually received | |
acquireActions | List<AcquireAction> | [] | ~ 100 items | List of Acquire Action |
Enumeration type definition to specify as timingType
Enumerator String Definition | Description |
---|---|
immediate | Immediate |
await | Waiting for reality time to elapse |
IncrementalRateModel
Cost increase type 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 | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
incrementalRateModelId | string | ✓ | ~ 1024 chars | Incremental Exchange rate model GRN | ||
name | string | ✓ | ~ 128 chars | Cost Increase Type Exchange Rate Name | ||
metadata | string | ~ 2048 chars | metadata | |||
consumeAction | ConsumeAction | ✓ | Consumption Action (Quantity/Value is overwritten so no setting is required) | |||
calculateType | enum { “linear”, “power”, “gs2_script” } | ✓ | ~ 128 chars | Calculation method for cost increase amount | ||
baseValue | long | {calculateType} == “linear” | ✓ | ~ 9223372036854775805 | Base Value | |
coefficientValue | long | {calculateType} in [“linear”, “power”] | ✓ | ~ 9223372036854775805 | Coefficient Value” | |
calculateScriptId | string | {calculateType} == “gs2_script” | ✓ | ~ 1024 chars | GRN of cost calculation script | |
exchangeCountId | string | ✓ | ~ 1024 chars | GRN of GS2-Limit model that manages the number of exchanges | ||
maximumExchangeCount | int | ✓ | 2147483646 | ~ 2147483646 | Maximum number of exchanges | |
acquireActions | List<AcquireAction> | [] | ~ 100 items | List of Acquire Action |
Enumeration type definition to specify as calculateType
Enumerator String Definition | Description |
---|---|
linear | Base Value + (Coefficient * Number of Exchanges) |
power | Coefficient * (Number of Exchanges + 1) ^ 2 |
gs2_script | Any logic with GS2-Script |
LogCost
Cost calculation result using logarithm
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
base | double | ✓ | 2 ~ 10 | Base | ||
adds | List<double> | ✓ | 1 ~ 100 items | List of logs to be added | ||
subs | List<double> | ~ 100 items | List of logs to be subtracted |
AcquireAction
Acquire Action
ConsumeAction
Consume Action
VerifyAction
Verify Action