GS2-SkillTree Script Trigger Reference

Reference of event triggers that call extended scripts

Trigger

release

Release node

Synchronous Execution Script

The script is executed synchronously before the release node process.

Request
TypeDescription
namespaceNamespaceNamespace
oldStatusStatusStatus before update
newStatusStatusStatus after update
userIdstringUser ID
nodeModelNames[]List of node model names
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow release node
Implementation Example
-- Request
local namespace = args.namespace
local oldStatus = args.oldStatus
local newStatus = args.newStatus
local userId = args.userId
local nodeModelNames = args.nodeModelNames

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the release node process.

Request
TypeDescription
namespaceNamespaceNamespace
oldStatusStatusStatus before update
newStatusStatusStatus after update
userIdstringUser ID
nodeModelNames[]List of node model names
Implementation Example
-- Request
local namespace = args.namespace
local oldStatus = args.oldStatus
local newStatus = args.newStatus
local userId = args.userId
local nodeModelNames = args.nodeModelNames

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

result = {
}

restrain

Restrain node

Synchronous Execution Script

The script is executed synchronously before the restrain node process.

Request
TypeDescription
namespaceNamespaceNamespace
userIdstringUser ID
oldStatusStatusStatus before update
newStatusStatusStatus after update
nodeModelNames[]List of node model names
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow restrain node
Implementation Example
-- Request
local namespace = args.namespace
local userId = args.userId
local oldStatus = args.oldStatus
local newStatus = args.newStatus
local nodeModelNames = args.nodeModelNames

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the restrain node process.

Request
TypeDescription
namespaceNamespaceNamespace
userIdstringUser ID
oldStatusStatusStatus before update
newStatusStatusStatus after update
nodeModelNames[]List of node model names
Implementation Example
-- Request
local namespace = args.namespace
local userId = args.userId
local oldStatus = args.oldStatus
local newStatus = args.newStatus
local nodeModelNames = args.nodeModelNames

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

result = {
}