GS2-LoginReward Script Trigger Reference

Reference of event triggers that call extended scripts

Trigger

receive

Receive

Synchronous Execution Script

The script is executed synchronously before the receive process.

Request
TypeDescription
namespaceNamespaceNamespace
bonusModelBonusModelLogin Bonus Model
userIdstringUser ID performing the loginReward
receiveStepintReceived step
configConfig[]Set values to be applied to transaction variables
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow buy
Implementation Example
-- Request
local namespace = args.namespace
local bonusModel = args.bonusModel
local userId = args.userId
local receiveStep = args.receiveStep
local config = args.config

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the receive process.

Request
TypeDescription
namespaceNamespaceNamespace
bonusModelBonusModelLogin Bonus Model
userIdstringUser ID performing the loginReward
receiveStepintReceived step
configConfig[]Set values to be applied to transaction variables
Implementation Example
-- Request
local namespace = args.namespace
local bonusModel = args.bonusModel
local userId = args.userId
local receiveStep = args.receiveStep
local config = args.config

-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.

result = {
}