Script Trigger Reference of GS2-Idle
Reference of event triggers that call extended scripts
Trigger
receive
Receiving rewards
Synchronous Execution Script
The script is executed synchronously before the receiving rewards process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| category | CategoryModel | Category Model |
| userId | string | User ID executing reward receive |
| status | Status | Status |
| acquireActions | AcquireAction[] | Rewards |
| config | Config[] | Set values to be applied to transaction variables |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow receiving rewards | ||
| rate | float | 1.0 | 0 ~ 1000 | Acquisition quantity rate |
Implementation Example
namespace = args.namespace
category = args.category
userId = args.userId
status = args.status
acquireActions = args.acquireActions
config = args.config
result = {
permit=permit,
rate=rate
}Asynchronous Execution Script
The script executes asynchronously after the Receiving rewards.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| category | CategoryModel | Category Model |
| userId | string | User ID executing reward receive |
| oldStatus | Status | Status before receiving rewards |
| newStatus | Status | Status after receiving rewards |
| acquireActions | AcquireAction[] | Rewards |
| config | Config[] | Set values to be applied to transaction variables |
Implementation Example
namespace = args.namespace
category = args.category
userId = args.userId
oldStatus = args.oldStatus
newStatus = args.newStatus
acquireActions = args.acquireActions
config = args.config
result = {
}overrideAcquireActions
Script that dynamically determines the idle reward acquisition action
Synchronous Execution Script
After synchronously executing the Script that dynamically determines the idle reward acquisition action, the acquisition action is performed.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| categoryModel | CategoryModel | Category Model |
| userId | string | User ID |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| acquireActions | AcquireActionList[] | ✓ | 1 ~ 100 items | List of acquire actions for each waiting time Assuming that the waiting time is “X minutes”, “X / rewardIntervalMinutes” will be the number of rewards that can be received, but by looping the elements specified in this array, different rewards can be given for each waiting time. |
Implementation Example
namespace = args.namespace
categoryModel = args.categoryModel
userId = args.userId
result = {
acquireActions=acquireActions
}