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

# GS2-Matchmaking Script Trigger Reference

Reference for event triggers that call extended scripts



## Trigger

### createGathering

creating a new gathering

**Related methods:**
createGathering - Create a Gathering and start recruiting


#### Synchronous Execution Script

The script is executed synchronously before the creating a new gathering process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| gathering | [Gathering](../sdk/#gathering) | Gathering |


##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local gathering = args.gathering

-- Business logic:

-- Result
result = {
}
```


---
  
### completeMatchmaking

the matchmaking completion

**Related methods:**
earlyComplete - Early Complete Matchmaking
earlyCompleteByUserId - Early Complete Matchmaking by specifying user ID


#### Synchronous Execution Script

The script is executed synchronously before the the matchmaking completion process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| gathering | [Gathering](../sdk/#gathering) | Gathering |


##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local gathering = args.gathering

-- Business logic:

-- Result
result = {
}
```


---
  
### changeRating

Rating value changes

**Related methods:**
putResult - Recalculate rating values


#### Synchronous Execution Script

The script is executed synchronously before the rating value changes process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| oldRating | [Rating](../sdk/#rating) | Old Rating |
| newRating | [Rating](../sdk/#rating) | New Rating |

##### Result

|  | Type | Required | Default | Value Limits | Description |
| --- | --- | --- | --- | --- | --- |
| permit | bool | ✓ |  |  | Whether to allow rating value changes |

##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local oldRating = args.oldRating
local newRating = args.newRating

-- Business logic:
local permit = true

-- Result
result = {
  permit=permit
}
```


#### Asynchronous Execution Script

The script is executed asynchronously after the rating value changes process.

##### Request

| | Type | Description |
| --- | --- | --- |
| namespace | [Namespace](../sdk/#namespace) | Namespace |
| oldRating | [Rating](../sdk/#rating) | Old Rating |
| newRating | [Rating](../sdk/#rating) | New Rating |


##### Implementation Example


**Lua**
```lua

-- Request
local namespace = args.namespace
local oldRating = args.oldRating
local newRating = args.newRating

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

result = {
}
```


---
  



