> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-Account Script Trigger Reference

Reference for event triggers that call extended scripts



## Trigger

### createAccount

Account creation

**Related methods:**
createAccount - Create Game Player Account


#### Synchronous Execution Script

The script is executed synchronously before the account creation process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| account | [Account](../sdk/#account) | Game Player Account |

##### Result

|  | Type | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | Whether to allow account creation |

##### Implementation Example


**Lua**
```lua

-- 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](../sdk/#namespace) | Namespace |
| account | [Account](../sdk/#account) | Game Player Account |


##### Implementation Example


**Lua**
```lua

-- 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

**Related methods:**
authentication - Authenticate Game Player Account


#### Synchronous Execution Script

The script is executed synchronously before the account authentication process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| account | [Account](../sdk/#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


**Lua**
```lua

-- 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](../sdk/#namespace) | Namespace |
| account | [Account](../sdk/#account) | Game Player Account |
| elapsedHours | int | Elapsed time since last login |


##### Implementation Example


**Lua**
```lua

-- 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

**Related methods:**
addBan - Add the Account Ban Status for a Game Player Account


#### Synchronous Execution Script

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

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| account | [Account](../sdk/#account) | Game Player Account |
| addBanStatus | [BanStatus](../sdk/#banstatus) | Account Ban Status to be added |

##### Result

|  | Type | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | Whether to allow Account BAN registration |

##### Implementation Example


**Lua**
```lua

-- 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](../sdk/#namespace) | Namespace |
| account | [Account](../sdk/#account) | Game Player Account |
| addBanStatus | [BanStatus](../sdk/#banstatus) | Account Ban Status to be added |


##### Implementation Example


**Lua**
```lua

-- 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

**Related methods:**
updateBanned - Update on Account Ban Status of Game Player Account
removeBan - Remove the Account Ban Status for a Game Player Account
authentication - Authenticate Game Player Account


#### Synchronous Execution Script

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

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| account | [Account](../sdk/#account) | Game Player Account |

##### Result

|  | Type | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | Whether to allow Account Ban removal |

##### Implementation Example


**Lua**
```lua

-- 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](../sdk/#namespace) | Namespace |
| account | [Account](../sdk/#account) | Game Player Account |


##### Implementation Example


**Lua**
```lua

-- 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

Takeover Information registration

**Related methods:**
createTakeOver - Create Takeover Information


#### Synchronous Execution Script

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

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| takeOver | [TakeOver](../sdk/#takeover) | Takeover Information |
| account | [Account](../sdk/#account) | Game Player Account |

##### Result

|  | Type | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | Whether to allow Takeover Information registration |

##### Implementation Example


**Lua**
```lua

-- 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](../sdk/#namespace) | Namespace |
| takeOver | [TakeOver](../sdk/#takeover) | Takeover Information |
| account | [Account](../sdk/#account) | Game Player Account |


##### Implementation Example


**Lua**
```lua

-- 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

**Related methods:**
doTakeOver - Execute Account Takeover


#### Synchronous Execution Script

The script is executed synchronously before the takeover execution process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| account | [Account](../sdk/#account) | Game Player Account |
| takeOver | [TakeOver](../sdk/#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


**Lua**
```lua

-- 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](../sdk/#namespace) | Namespace |
| account | [Account](../sdk/#account) | Game Player Account |
| takeOver | [TakeOver](../sdk/#takeover) | Takeover Information |


##### Implementation Example


**Lua**
```lua

-- 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 = {
}
```


---
  



