Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/guides/quickmatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ As long as the room has capacity, anyone can join.
This method can result in a [`QuickmatchRoomNotFound`](../room/disconnect-events#quickmatchroomnotfound) disconnect event if the room has been cleaned up, or a [`QuickmatchRoomFull`](../room/disconnect-events#quickmatchroomfull) event if the room is at capacity. See [Error Handling](#error-handling) for how to handle these cases.
:::

:::note
If you're using [Normcore Private webhooks](../normcore-private/webhooks), all quickmatch connection methods are verified by the webhook before a room slot is reserved. See the [webhooks documentation](../normcore-private/webhooks#quickmatch-webhook-behavior) for details.
:::

Comment on lines +96 to +99
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's drop this, most customers don't care about this when reading the quickmatch docs and it complicates the guide unnecessarily.

### Room Properties

After connecting to a Quickmatch room, you can access the room code and capacity via the `Room` object:
Expand Down
23 changes: 22 additions & 1 deletion docs/normcore-private/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ Normcore sends webhook requests for the following actions:

- **GetRegionsList**: Fired whenever a client requests a list of available regions.
- **ConnectToNextAvailableQuickmatchRoom**: Called when a client requests connecting to the next available quickmatch room. The webhook can approve or deny the request before Normcore reserves space or spins up a fresh room. This action includes `roomGroupName` and `capacity` values.
- **ConnectToRoom**: Called whenever a client attempts to connect to a room server. This action is also called after a `ConnectToNextAvailableQuickmatchRoom` request is approved and a room has been selected for the client.
- **ConnectDirectlyToQuickmatchRoom**: Called when a client connects to a specific quickmatch room, whether by room code or room name. The webhook can approve or deny the request before Normcore reserves a spot. This action includes `roomGroupName` and `roomCode` values.
- **ConnectToRoom**: Called whenever a client attempts to connect to a room server. This action is also called after a quickmatch request is approved and a room has been selected for the client.

### Quickmatch webhook behavior
When a client connects to a quickmatch room, Normcore sends two webhook requests in sequence:

1. A quickmatch-specific webhook (`ConnectToNextAvailableQuickmatchRoom` or `ConnectDirectlyToQuickmatchRoom`) — this fires first, before any room slot is reserved.
2. A `ConnectToRoom` webhook — this fires after the quickmatch request is approved and a room has been assigned.

If either webhook denies the request, the connection is rejected. This applies regardless of which API method the client used to connect — even if a client connects to a quickmatch room using `Connect()` with the room name, the quickmatch webhook fires first.

## Request format
When the matcher needs to authenticate one or more requests, it sends a POST request to the webhook endpoint. The request includes a JSON-serialized body with a map of requests to verify.
Expand All @@ -42,6 +51,18 @@ An example request looks like this:
}
```

A quickmatch webhook request includes the room group name and either the capacity or room code, depending on the action:
```json
{
"a1b2c3d4-e5f6-7890-abcd-ef1234567890": {
"appKey": "f0b89d74-a4bb-4dc6-8bcb-0dc063c38e7c",
"action": "ConnectDirectlyToQuickmatchRoom",
"roomGroupName": "lobby",
"roomCode": "ABC123"
}
}
```

The webhook endpoint is expected to reply with a status for each request. Any request GUIDs that are not included in the response to will fail.

The webhook response should match this format:
Expand Down