GS2-SkillTree Script Trigger Reference

Reference for event triggers that call extended scripts

Trigger

release

Release node

Synchronous Execution Script

The script is executed synchronously before the release node process.

Request
Type Description
namespace Namespace Namespace
oldStatus Status Status before update
newStatus Status Status after update
userId string User ID
nodeModelNames [] List of node model names
Result
Type Required Default Value Limits Description
permit bool
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
Type Description
namespace Namespace Namespace
oldStatus Status Status before update
newStatus Status Status after update
userId string User 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
Type Description
namespace Namespace Namespace
userId string User ID
oldStatus Status Status before update
newStatus Status Status after update
nodeModelNames [] List of node model names
Result
Type Required Default Value Limits Description
permit bool
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
Type Description
namespace Namespace Namespace
userId string User ID
oldStatus Status Status before update
newStatus Status Status 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 = {
}