GS2-Account Script Trigger Reference
Trigger
createAccount
Account creation
Synchronous Execution Script
The script is executed synchronously before the account creation process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| elapsedHours | int | Elapsed time since last login |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow account authentication | ||
| force | bool | false | Whether 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| elapsedHours | int | Elapsed 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
Account BAN registration
Synchronous Execution Script
The script is executed synchronously before the account ban registration process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| addBanStatus | BanStatus | Account Ban Status to be added |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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 account ban registration process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| addBanStatus | BanStatus | Account 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game 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 = {
}requestDeletion
Account deletion request
Synchronous Execution Script
The script is executed synchronously before the account deletion request process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| scheduledAt | long | Scheduled deletion time |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow the account deletion request |
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local scheduledAt = args.scheduledAt
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}Asynchronous Execution Script
The script is executed asynchronously after the account deletion request process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| scheduledAt | long | Scheduled deletion time |
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local scheduledAt = args.scheduledAt
-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.
result = {
}cancelDeletion
Account deletion request cancellation
Synchronous Execution Script
The script is executed synchronously before the account deletion request cancellation process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| reason | enum [ “user”, “login”, “admin” ] | Reason for the cancellation “Cancelled by the game player (user)” is a cancellation by the game player. “Cancelled by logging in during the grace period (login)” is a cancellation by authenticating while the Account is scheduled for deletion, when the behavior when logging in during the grace period is “Cancel the deletion and log in (cancel)”. “Cancelled by the administrator (admin)” is a cancellation by specifying the user ID. |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow the cancellation of the account deletion request |
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local reason = args.reason
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}Asynchronous Execution Script
The script is executed asynchronously after the account deletion request cancellation process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| reason | enum [ “user”, “login”, “admin” ] | Reason for the cancellation “Cancelled by the game player (user)” is a cancellation by the game player. “Cancelled by logging in during the grace period (login)” is a cancellation by authenticating while the Account is scheduled for deletion, when the behavior when logging in during the grace period is “Cancel the deletion and log in (cancel)”. “Cancelled by the administrator (admin)” is a cancellation by specifying the user ID. |
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local reason = args.reason
-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.
result = {
}executeDeletion
Account deletion
Synchronous Execution Script
The script is executed synchronously before the account deletion process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| dataUserId | string | User ID for data retention The user ID that holds the user data to delete. When the Namespace uses different user IDs for login and data retention, this is the user ID of the data owner; otherwise, it is the same as the user ID of the Account. |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Not used The deletion of the Account cannot be stopped by the script, so this value is ignored. When the script fails, the deletion is put off and retried later, so the script may be executed more than once for the same account. Make the script idempotent. Once the deletion has failed 13 times, it proceeds without executing the script. |
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local dataUserId = args.dataUserId
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}Asynchronous Execution Script
The script is executed asynchronously after the account deletion process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| dataUserId | string | User ID for data retention The user ID that holds the user data to delete. When the Namespace uses different user IDs for login and data retention, this is the user ID of the data owner; otherwise, it is the same as the user ID of the Account. |
Implementation Example
-- Request
local namespace = args.namespace
local account = args.account
local dataUserId = args.dataUserId
-- Asynchronous scripts typically do not affect the API response.
-- These scripts are typically used for logging, analytics, external notifications, and similar purposes.
result = {
}createTakeOver
Takeover Information registration
Synchronous Execution Script
The script is executed synchronously before the takeover information registration process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| takeOver | TakeOver | Takeover Information |
| account | Account | Game Player Account |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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 takeover information registration process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| takeOver | TakeOver | Takeover Information |
| account | Account | Game 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| takeOver | TakeOver | Takeover Information |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow takeover execution | ||
| force | bool | false | Whether 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| account | Account | Game Player Account |
| takeOver | TakeOver | Takeover 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 = {
}