GS2-Account Script Trigger Reference

Reference for event triggers that call extended scripts

Trigger

createAccount

Account creation

Synchronous Execution Script

The script is executed synchronously before the account creation process.

Request
TypeDescription
namespaceNamespaceNamespace
accountAccountGame Player Account
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow account creation
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the account creation process.

Request
TypeDescription
namespaceNamespaceNamespace
accountAccountGame Player Account
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account

-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.

result = {
}

authentication

Account authentication

Synchronous Execution Script

The script is executed synchronously before the account authentication process.

Request
TypeDescription
namespaceNamespaceNamespace
accountAccountGame Player Account
elapsedHoursintElapsed time since last login
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow account authentication
forceboolfalseWhether to allow login even if password authentication fails
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local elapsedHours = args.elapsedHours

-- Business logic:
local permit = true
local force = false

-- Result
result = {
  permit=permit,
  force=force
}

Asynchronous Execution Script

The script is executed asynchronously after the account authentication process.

Request
TypeDescription
namespaceNamespaceNamespace
accountAccountGame Player Account
elapsedHoursintElapsed time since last login
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local elapsedHours = args.elapsedHours

-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.

result = {
}

ban

Register Account BAN

Synchronous Execution Script

The script is executed synchronously before the register account ban process.

Request
TypeDescription
namespaceNamespaceNamespace
accountAccountGame Player Account
addBanStatusBanStatusAccount Ban Status to be added
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow Account BAN registration
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local addBanStatus = args.addBanStatus

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the register account ban process.

Request
TypeDescription
namespaceNamespaceNamespace
accountAccountGame Player Account
addBanStatusBanStatusAccount Ban Status to be added
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local addBanStatus = args.addBanStatus

-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.

result = {
}

unBan

Account Ban removal

Synchronous Execution Script

The script is executed synchronously before the account ban removal process.

Request
TypeDescription
namespaceNamespaceNamespace
accountAccountGame Player Account
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow Account Ban removal
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the account ban removal process.

Request
TypeDescription
namespaceNamespaceNamespace
accountAccountGame Player Account
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account

-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.

result = {
}

createTakeOver

Register Takeover Information

Synchronous Execution Script

The script is executed synchronously before the register takeover information process.

Request
TypeDescription
namespaceNamespaceNamespace
takeOverTakeOverTakeover Information
accountAccountGame Player Account
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow Takeover Information registration
Implementation Example
-- Request
local namespace = args.namespace
local takeOver = args.takeOver
local account = args.account

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}

Asynchronous Execution Script

The script is executed asynchronously after the register takeover information process.

Request
TypeDescription
namespaceNamespaceNamespace
takeOverTakeOverTakeover Information
accountAccountGame Player Account
Implementation Example
-- Request
local namespace = args.namespace
local takeOver = args.takeOver
local account = args.account

-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.

result = {
}

doTakeOver

Takeover execution

Synchronous Execution Script

The script is executed synchronously before the takeover execution process.

Request
TypeDescription
namespaceNamespaceNamespace
accountAccountGame Player Account
takeOverTakeOverTakeover Information
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow takeover execution
forceboolfalseWhether to allow login even if password authentication fails
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local takeOver = args.takeOver

-- Business logic:
local permit = true
local force = false

-- Result
result = {
  permit=permit,
  force=force
}

Asynchronous Execution Script

The script is executed asynchronously after the takeover execution process.

Request
TypeDescription
namespaceNamespaceNamespace
accountAccountGame Player Account
takeOverTakeOverTakeover Information
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local takeOver = args.takeOver

-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.

result = {
}