GS2-Dictionary Script Trigger Reference
Reference of event triggers that call extended scripts
Trigger
entry
entry registration
Synchronous Execution Script
The script is executed synchronously before the entry registration process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| entryModels | EntryModel[] | List of Entry Models |
| userId | string | User ID |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | Whether to allow entry registration |
Implementation Example
-- Request
local namespace = args.namespace
local entryModels = args.entryModels
local userId = args.userId
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}Asynchronous Execution Script
The script is executed asynchronously after the entry registration process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| entryModels | EntryModel[] | List of Entry Models |
| userId | string | User ID |
Implementation Example
-- Request
local namespace = args.namespace
local entryModels = args.entryModels
local userId = args.userId
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}duplicateEntry
re-registration for entries already registered
Synchronous Execution Script
The script is executed synchronously before the re-registration for entries already registered process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| entryModel | EntryModel | Entry Model |
| userId | string | User ID |
Implementation Example
-- Request
local namespace = args.namespace
local entryModel = args.entryModel
local userId = args.userId
-- Business logic:
-- Result
result = {
}