> For the complete documentation index, see [llms.txt](https://docs.edgegap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.edgegap.com/godot/server-browser.md).

# Server Browser

Add a server browser to your Godot game with Edgegap's optional GDScript SDK, letting players find and join live sessions from a list.

This SDK is an optional starter kit for Godot users, which can be extended and customized later.

## 💡 Features

{% columns %}
{% column %}

* Complete Examples
* Lifecycle Management
* Capacity Management
  {% endcolumn %}

{% column width="33.33333333333333%" %}

* Filter and Sort Builders
* Await, Signals and Callbacks
* Local Dev Testing
  {% endcolumn %}

{% column width="33.33333333333333%" %}

* All Exports, including Web
* Zero Dependencies
* Automated Retry
  {% endcolumn %}
  {% endcolumns %}

## ✔️ Preparation

Godot SDK contains optional integration utilities for Deployments, Matchmaking, and Server Browser. This addon is written in pure GDScript and officially supports Godot 4.3 and newer, in every export including Web.

{% hint style="info" %}
**The latest version of Godot SDK is `0.2.0`**. All examples in this documentation are up to date.
{% endhint %}

{% hint style="success" %}
This package is provided 100% free of charge, under Terms and Conditions of Free Tier.
{% endhint %}

#### Installation

Install this addon as folder `addons/edgegap_sdk` in your project. There is nothing to enable, every class is registered globally with a `class_name` prefixed with `Edgegap`.

{% tabs %}
{% tab title="git" %}

1. [Install a git client (for example git-scm)](https://git-scm.com/).
2. From your project's root folder, clone our SDK repository into `addons/edgegap_sdk`.

{% code expandable="true" collapsedlinecount="10" %}

```bash
git clone https://github.com/edgegap/sdk-godot-sessions-matchmaker-server-browser.git addons/edgegap_sdk
```

{% endcode %}

{% hint style="info" %}
To update SDK installed with git, open command line in the `addons/edgegap_sdk` folder and run `git pull`. If your project is a git repository, you may add the SDK with `git submodule add` instead, using the same URL and folder.
{% endhint %}
{% endtab %}

{% tab title="GitHub Release" %}

1. Download the zip from the [latest GitHub release](https://github.com/edgegap/sdk-godot-sessions-matchmaker-server-browser/releases).
2. Extract the zip into your project's root folder, it contains `addons/edgegap_sdk`.
   {% endtab %}
   {% endtabs %}

{% hint style="info" %}
**This SDK installs side by side with our** [**Godot Quickstart Plugin**](https://docs.edgegap.com/godot.md#preparation) (`addons/edgegap`). If your server export uses an explicit resource allowlist, add `res://addons/edgegap_sdk/*` .
{% endhint %}

The addon has four folders:

* `addons/edgegap_sdk/examples` - complete example scripts, see [SDK Examples](https://docs.edgegap.com/godot/matchmaking.md#sdk-examples).
* `addons/edgegap_sdk/matchmaking` :
  * `EdgegapGroupAgent`, `EdgegapServerAgent`, `EdgegapMatchEnvironment`, `EdgegapMatchmakingApi` .
* `addons/edgegap_sdk/server_browser` - see [Server Browser](https://docs.edgegap.com/godot/server-browser.md).
* `addons/edgegap_sdk/core` - shared utilities:
  * `EdgegapDeploymentEnvironment`, `EdgegapConnection`, `EdgegapPing` .
  * `EdgegapObservable`, `EdgegapResult`, `EdgegapCancelToken`, `EdgegapLogger` .
  * misc. HTTP helpers.

{% hint style="success" %}
**Only need deployment variables or connection addresses?** `EdgegapDeploymentEnvironment` and `EdgegapConnection` work without Matchmaking or Server Browser. Delete folders `matchmaking` and `server_browser`, and keep `core` and `edgegap_sdk.gd` .
{% endhint %}

#### Verified Sources

This addon is only published on [GitHub](https://github.com/edgegap/sdk-godot-sessions-matchmaker-server-browser), with source code and releases. Do not trust unverified sources, forks and addons with similar names outside the `edgegap` GitHub organization are not affiliated with Edgegap!

### Update Package

Run `git pull` in folder `addons/edgegap_sdk`, or replace the folder with the same folder from the [latest GitHub release](https://github.com/edgegap/sdk-godot-sessions-matchmaker-server-browser/releases). Read the installed version from `EdgegapSdk.VERSION` .

{% hint style="success" %}
**When running your game from Godot Editor, the SDK logs a warning if a newer version is released.** This check never runs in exported games, so players never contact GitHub. Turn it off with `EdgegapSdk.check_for_updates = false` before initializing an agent.
{% endhint %}

{% hint style="info" %}
Some releases may contain breaking changes. This will be indicated by a new MAJOR version.
{% endhint %}

## 🍀 Getting Started

This guide assumes basic knowledge of [Server Browser](https://docs.edgegap.com/learn/server-browser.md) concepts and a running Server Browser.

{% hint style="success" %}
**We strongly recommend opening our** [**SDK Examples**](#sdk-examples) to follow along code as you read this document.
{% endhint %}

### Overview

Our SDK utilizes heavily the [Observer](https://refactoring.guru/design-patterns/observer) programming pattern, and lets you consume changes with callbacks, [signals](https://docs.godotengine.org/en/stable/getting_started/step_by_step/signals.html), or [await](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_basics.html#awaiting-signals-or-coroutines) - whichever fits your game loop.

{% hint style="info" %}
This package integrates both [Server Browser](https://docs.edgegap.com/learn/server-browser.md) and [Matchmaking](https://docs.edgegap.com/godot/matchmaking.md), which can be used together or separately. You may freely reuse any code for your own customized forks and integrations.
{% endhint %}

This package includes:

* Service-Specific Utilities:
  * [#server-agent](#server-agent "mention") - a complete game server integration to reuse/extend.
  * [#client-agent](#client-agent "mention") - a complete game client integration to reuse/extend.
  * `EdgegapServerBrowserFilter` and `EdgegapServerBrowserSort` - builders for filter and sort queries.
  * `EdgegapServerBrowserApi` - endpoint definitions, error handling, and retry automations.
* Service-Specific Payloads - request and response Dictionaries matching Server Browser API JSON exactly.
* Shared Utilities - connection addresses, deployment variables, logging, HTTP, observables, etc...

{% hint style="info" %}
**Agents are nodes.** Add them to your scene tree with `add_child` before initializing. Freeing an agent cancels all of its timers and requests. Calls that can fail return an `EdgegapResult` (`ok`, `value`, `error`, `status`, `cancelled`) instead of throwing.
{% endhint %}

### Server Agent

**Server Lifecycle and Capacity management** are performed by Server Agent (`EdgegapServerBrowserServer`).

Once instantiated and added to the tree, agent's **handler (your server code) must initialize the agent** and optionally provide:

* `on_monitor_update` callback - observe service health changes.
* `on_instance_update` callback - observe and react to instance and slot changes.
* `on_confirmations_update` callback - observe and react to reservation confirmations.

Once initialized, this agent will automatically provide validations and hook up logging observers, finishing with a single call to the monitoring API endpoint to indicate service health.

Agent's handler is expected to take control and call agent functions from this point:

* `discover_instance` to create initial Server Instance and Slots and initiate heartbeat.
  * `instance_from_deployment` builds the request from [Deployment Variables](https://docs.edgegap.com/learn/orchestration/deployments.md#injected-environment-variables).
* `delete_instance` once the match concludes / to prevent new players from joining.
* `confirm_reservation` when players join, to verify their identity and take their seat.
* `update_slot` to update slot capacity (on player abandoned) or modify slot metadata.
* `update_instance` to modify instance metadata.
* `status` to verify Server Browser service health.
* `dispose` to stop heartbeats, cancel requests, and remove subscribers. Called automatically when the agent leaves the tree.

{% code title="addons/edgegap\_sdk/examples/server\_browser/browser\_server.gd" expandable="true" collapsedlinecount="10" %}

```gdscript
extends Node
## Game server: registers this deployment in the Server Browser, confirms reservations as players
## join, frees seats as they leave, and unregisters before stopping. Clients send their player ID
## with submit_player_id once connected.
##
## Set SB_BASE_URL, SB_SERVER_TOKEN and SB_SCALING_POLICY_NAME as app version environment variables.
## Keep server tokens out of game clients.

@export var seats := 10
@export var port := 7777

var deployment := EdgegapDeploymentEnvironment.from_env()
var server: EdgegapServerBrowserServer
var players_by_peer := {}


func _ready() -> void:
	if deployment.is_deployment():
		server = EdgegapServerBrowserServer.new(OS.get_environment("SB_BASE_URL"), OS.get_environment("SB_SERVER_TOKEN"))
		add_child(server)
		server.initialize(_on_monitor_update, _on_instance_update)
	else:
		print("Not on Edgegap, skipping Server Browser registration.")

	var peer := ENetMultiplayerPeer.new()
	peer.create_server(port)
	multiplayer.multiplayer_peer = peer
	multiplayer.peer_disconnected.connect(_on_peer_disconnected)


## Called by clients once connected. Confirming the reservation takes the reserved seat.
@rpc("any_peer", "reliable")
func submit_player_id(player_id: String) -> void:
	players_by_peer[multiplayer.get_remote_sender_id()] = player_id
	if server != null:
		server.confirm_reservation(player_id)


## Frees the seat of a player who left.
func _on_peer_disconnected(peer_id: int) -> void:
	if players_by_peer.erase(peer_id) and server != null:
		server.update_slot("main", 1)


func _on_monitor_update(_monitor: EdgegapObservable, _type: EdgegapObservable.ActionType, _message: String, event: Dictionary) -> void:
	if event.code == "healthy" and server.instance.current == null:
		var policy := OS.get_environment("SB_SCALING_POLICY_NAME")
		server.discover_instance(EdgegapServerBrowserServer.instance_from_deployment(
			deployment,
			{"policy_name": policy if not policy.is_empty() else "on-demand", "name": deployment.request_id},
			[{"name": "main", "available_seats": seats}],
		))


func _on_instance_update(_instance: EdgegapObservable, _type: EdgegapObservable.ActionType, _message: String, event: Dictionary) -> void:
	if event.code == "discovery_failed":
		end_match()


func end_match() -> void:
	if server != null:
		await server.delete_instance()
	await deployment.self_stop(self)
```

{% endcode %}

{% hint style="success" %}
Confirmations and Slot/Instance Updates are **queued and performed in batches by default** (`UpdateMode.HEARTBEAT`) to maximize scalability. Seat changes are merged per slot, so a burst of players costs one request. To iterate quicker during dev testing, set `server.update_mode = EdgegapServerBrowserServer.UpdateMode.GREEDY` .
{% endhint %}

{% hint style="info" %}
**Metadata updates are partial.** Keys that are missing or `null` keep their stored value, so numbers and booleans can be set back to `0` and `false`.
{% endhint %}

The agent automatically maintains a heartbeat to keep the server discoverable while running. If the agent can't reach your server browser for several consecutive heartbeats (`heartbeat_max_consecutive_errors`):

* less than maximum - instance will be automatically re-discovered, with queued updates applied,
* more than maximum - instance will be automatically deleted.

When a new player connection is established, player is expected to send their reservation ID (third party player ID) to the game server using your netcode, to perform reservation confirmation. Confirmed seats are taken from their slot automatically.

Once `confirmations` emits `confirmed`, handler may accept or deny connections using netcode-specific methods. Set `accept_expired_reservations = true` to also take seats of expired reservations.

When a player abandons game, handler is expected to increase available seats for this slot with `update_slot(slot_name, 1)`.

{% hint style="info" %}
Allow a short time period for players to reconnect before abandoning in case of unexpected crashes.
{% endhint %}

{% hint style="danger" %}
**Load server tokens from environment variables**, for example using [App Version Variables](https://docs.edgegap.com/learn/orchestration/application-and-versions.md#injected-variables). Tokens your game servers use must never be included in game client builds or browser bundles.
{% endhint %}

### Client Agent

**Searching for instances, pagination, filtering, and reservations** are performed by Client Agent (`EdgegapServerBrowserClient`).

Once instantiated and added to the tree, agent's **handler (your game code) must initialize the agent** and optionally provide:

* `on_monitor_update` callback - observe service health changes.
* `on_instances_update` callback - observe and react to instance list changes.

Once initialized, this agent will automatically provide validations and hook up logging observers, finishing with a single call to the monitoring API endpoint to indicate service health.

Agent's handler is expected to take control and call agent functions from this point:

* `reserve_seats` to create a capacity reservation for a particular instance and slot.
* `reserve_seats_auto` to let Server Browser choose an instance and slot for a scaling policy.
* `list_instances` to list instances with a specific filter, ordering, page size, and cursor.
* `get_next_page` to fetch more instances with the current parameters (filters, etc).
* `refresh_list` to clear cache and reload first page, or refresh with a specific cursor.
* `get_instance_details` to fetch instance metadata and slots information for a specific instance.
* `status` to verify Server Browser service health.

{% code title="addons/edgegap\_sdk/examples/server\_browser/filter\_and\_sort.gd" expandable="true" collapsedlinecount="10" %}

```gdscript
extends Node
## Game client: lists free-for-all servers with at least 2 joinable seats, preferring nearby cities,
## then servers with the most joinable seats.

const F := preload("res://addons/edgegap_sdk/server_browser/filter.gd")  # EdgegapServerBrowserFilter
const S := preload("res://addons/edgegap_sdk/server_browser/sort.gd")  # EdgegapServerBrowserSort

@export var server_browser_url := "https://<your-server-browser>.edgegap.net"
@export var client_token := "<server browser client token>"

var browser: EdgegapServerBrowserClient


func _ready() -> void:
	browser = EdgegapServerBrowserClient.new(server_browser_url, client_token)
	add_child(browser)
	browser.initialize()

	await browser.list_instances(
		F.compile([F.where("metadata.mode", F.EQ, "ffa"), F.where("total_joinable_seats", F.GE, 2)]),
		S.compile([S.rank("metadata.location.city", ["Montreal", "Toronto"]), S.desc("total_joinable_seats")]),
	)
	for instance: Dictionary in browser.instances.current["items"]:
		print(instance.metadata.name)
```

{% endcode %}

Build filters with `F.where(field, operator, value)` using `F.EQ`, `F.NE`, `F.LT`, `F.LE`, `F.GT`, `F.GE` and `F.CONTAINS` (strings), `F.is_in(field, values)`, `F.any_of(filters)` and `F.all_of(filters)`, joined with `F.compile(filters)`. Build the order with `S.asc(field)`, `S.desc(field)` and `S.rank(field, values)`, joined with `S.compile(sorts)`.

When a new player connection is established, player is expected to send their reservation ID (third party player ID) to the game server using your netcode, to perform reservation confirmation. Connect to the reserved instance's `server` with `EdgegapConnection.get_address` (ENet, TCP) or `EdgegapConnection.get_url` (WebSocket).

{% hint style="success" %}
Save connection details in client or game backend to reconnect in case of an unexpected crash.
{% endhint %}

## 🧪 Samples

Get started with samples including a complete functioning integration for both server and client.

### SDK Examples

Every sample on this page ships with the SDK in `addons/edgegap_sdk/examples/server_browser`, also on [GitHub](https://github.com/edgegap/sdk-godot-sessions-matchmaker-server-browser/tree/main/addons/edgegap_sdk/examples/server_browser). Examples declare no `class_name`, so they add no global classes to your project. Attach them to nodes in your scenes and expand them to fit your game, or delete the folder.

#### Browser Client

Game client listing joinable servers with a filter and sort order, loading more pages, and connecting with a reservation. Demonstrates both reservation flows:

* **Auto-Assign** (`quick_join`) - client specifies only policy name, Server Browser chooses an instance matching policy filter and slot with sufficient seats automatically,
* **Custom Search** (`join`) - player chooses an instance from the list and reserves seats in its slot.

{% code title="addons/edgegap\_sdk/examples/server\_browser/browser\_client.gd" expandable="true" collapsedlinecount="10" %}

```gdscript
extends Node
## Game client: lists joinable servers, reserves a seat and connects.

const F := preload("res://addons/edgegap_sdk/server_browser/filter.gd")
const S := preload("res://addons/edgegap_sdk/server_browser/sort.gd")

@export var server_browser_url := "https://<your-server-browser>.edgegap.net"
@export var client_token := "<server browser client token>"
@export var scaling_policy := "on-demand"
@export var port_name := "gameport"

var browser: EdgegapServerBrowserClient
## Use your player's account ID, so the server can confirm the reservation.
var player_id := "player-%d" % randi()


func _ready() -> void:
	browser = EdgegapServerBrowserClient.new(server_browser_url, client_token)
	add_child(browser)
	browser.initialize(Callable(), func(instances: EdgegapObservable, _type: EdgegapObservable.ActionType, _message: String, event: Dictionary) -> void:
		if event.code in ["list_retrieved", "next_page_retrieved"]:
			for instance: Dictionary in instances.current["items"]:
				print("%s: %d seats" % [instance.get("metadata", {}).get("name", instance.request_id), instance.get("total_joinable_seats", 0)])
	)
	refresh()


func refresh() -> void:
	var filter := F.compile([F.where("total_joinable_seats", F.GE, 1)])
	var order := S.compile([S.desc("total_joinable_seats")])
	await browser.list_instances(filter, order, 20)


func load_more() -> void:
	await browser.get_next_page()


## Join a server the player picked from the list.
func join(request_id: String, slot_name := "main") -> void:
	var reservation := await browser.reserve_seats(request_id, slot_name, [player_id])
	if not reservation.ok:
		print("Couldn't reserve a seat: ", reservation.error)
		return
	await browser.get_instance_details(request_id)
	for instance: Dictionary in browser.instances.current["items"]:
		if instance.request_id == request_id:
			_connect_to(instance.server)


## Let the service pick the best server.
func quick_join() -> void:
	var reservation := await browser.reserve_seats_auto(scaling_policy, [player_id])
	if reservation.ok:
		_connect_to(reservation.value.server)
	else:
		print("No seat available: ", reservation.error)


func _connect_to(server: Dictionary) -> void:
	var address := EdgegapConnection.get_address(server, port_name)
	var peer := ENetMultiplayerPeer.new()
	peer.create_client(address.ip, address.port)
	multiplayer.multiplayer_peer = peer
	# Send player_id once connected, so the server confirms the reservation.
```

{% endcode %}

#### Browser Server

Game server registering its deployment in the Server Browser, confirming reservations as players join, freeing seats as they leave, and unregistering before stopping the deployment. The complete script `addons/edgegap_sdk/examples/server_browser/browser_server.gd` is shown in Server Agent above.

#### Filter and Sort

Game client listing free-for-all servers with joinable seats, preferring nearby cities. The complete script `addons/edgegap_sdk/examples/server_browser/filter_and_sort.gd` is shown in Client Agent above.

## ⚙️ Customization

This SDK is meant to be extended and modified, though some modifications may be risky:

✅ Handler - safely hook up UI observers and perform minor additions or modifications,

⚠️ Agent - fork the source code and modify lifecycle and capacity management at your own risk,

⚠️ API - write your own integration from scratch, using `EdgegapServerBrowserApi` and cherry-picked utilities.

Handlers may observe any events emitted by Client and Server agents as described below.

{% hint style="warning" %}
Make sure to get familiar with [Server Browser In-Depth](https://docs.edgegap.com/learn/server-browser.md) concepts before making customizations.
{% endhint %}

{% hint style="info" %}
If you need help, [please reach out to us over Discord](https://discord.gg/MmJf8fWjnt). For live games support see our [ticketing system](https://edgegap.atlassian.net/servicedesk/customer/portal/3).
{% endhint %}

### Client Events

Client Agent emits events for handlers to observe and consume, through signal `changed(observable, type, message, event)` of each observable.

{% hint style="success" %}
Read state by accessing `.current` and `.previous` of any observable, and **branch on `event.code`** since event messages may change between versions. 🔴 Error events also store the full error message in `.error` .
{% endhint %}

Preview events emitted by observable `monitor` :

<table data-full-width="true"><thead><tr><th width="125">Action Type</th><th width="200">Event Code</th><th width="300">Event Parameters</th><th>Description</th></tr></thead><tbody><tr><td>🟢 <code>UPDATE</code></td><td><code>healthy</code></td><td>-</td><td>All systems OK.</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>unhealthy</code></td><td>-</td><td>Unexpected issue.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>monitor_failed</code></td><td><code>detail</code></td><td>Misconfiguration or unexpected issue.</td></tr></tbody></table>

Preview events emitted by observable `instances` :

<table data-full-width="true"><thead><tr><th width="125">Action Type</th><th width="200">Event Code</th><th width="300">Event Parameters</th><th>Description</th></tr></thead><tbody><tr><td>🔵 <code>LOG</code></td><td><code>seats_reserved</code></td><td>-</td><td>Seat reservation OK.</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>reserved_instance</code></td><td>-</td><td>Auto-assigned reservation OK, the cached list holds just the reserved instance.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>reservation_failed</code></td><td><code>reason: "not_found"</code></td><td>Auto-Assign - policy name not found (deleted or inactive). Custom Search - instance or slot not found.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>reservation_failed</code></td><td><code>reason: "capacity_reached"</code></td><td>Auto-Assign - policy reached maximum capacity. Custom Search - slot reached maximum capacity.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>reservation_failed</code></td><td><code>reason: "error"</code>, <code>detail</code></td><td>Seat reservation failed, possibly invalid policy, request ID, or slot name.</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>list_retrieved</code></td><td>-</td><td>Fetched list of instances OK.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>list_failed</code></td><td><code>detail</code></td><td>Failed to fetch instance list.</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>next_page_retrieved</code></td><td>-</td><td>Fetched next page of instances OK.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>last_page_reached</code></td><td>-</td><td>Failed to fetch next page, try refreshing or changing filters.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>next_page_failed</code></td><td><code>detail</code></td><td>Failed to fetch next page, possibly due to an invalid cursor.</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>details_retrieved</code></td><td>-</td><td>Fetched details of a listed instance OK.</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>details_prepended</code></td><td>-</td><td>Fetched details of instance outside current list.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>details_failed</code></td><td><code>detail</code></td><td>Failed to fetch details, possibly due to invalid request ID.</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>cache_cleared</code></td><td>-</td><td>Cleared cached instance list and details.</td></tr></tbody></table>

### Server Events

Server Agent emits events for handlers to observe and consume, through signal `changed(observable, type, message, event)` of each observable.

{% hint style="success" %}
Read state by accessing `.current` and `.previous` of any observable, and **branch on `event.code`** since event messages may change between versions. 🔴 Error events also store the full error message in `.error` .
{% endhint %}

Preview events emitted by observable `monitor` :

<table data-full-width="true"><thead><tr><th width="125">Action Type</th><th width="200">Event Code</th><th width="300">Event Parameters</th><th>Description</th></tr></thead><tbody><tr><td>🟢 <code>UPDATE</code></td><td><code>healthy</code></td><td>-</td><td>All systems OK.</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>unhealthy</code></td><td>-</td><td>Unexpected issue.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>monitor_failed</code></td><td><code>detail</code></td><td>Misconfiguration or unexpected issue.</td></tr><tr><td>🟡 <code>WARN</code></td><td><code>timeout_clamped</code></td><td><code>request_timeout_seconds</code></td><td>Request timeout clamped to heartbeat interval, prevents race conditions.</td></tr></tbody></table>

Preview events emitted by observable `instance` :

<table data-full-width="true"><thead><tr><th width="125">Action Type</th><th width="200">Event Code</th><th width="300">Event Parameters</th><th>Description</th></tr></thead><tbody><tr><td>🟢 <code>UPDATE</code></td><td><code>discovered</code></td><td>-</td><td>Instance Discovery completed OK. May be triggered if instance lost connection due to temporary condition and re-discovered.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>discovery_duplicate</code></td><td>-</td><td>Instance with this Request ID is already discovered.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>discovery_failed</code></td><td><code>detail</code></td><td>Unexpected issue with discovery.</td></tr><tr><td>🔵 <code>LOG</code></td><td><code>heartbeat_ok</code></td><td>-</td><td>Heartbeat completed OK.</td></tr><tr><td>🟡 <code>WARN</code></td><td><code>heartbeat_failed</code></td><td><code>attempt</code>, <code>max_attempts</code>, <code>detail</code></td><td>Heartbeat failed, server couldn't reach Server Browser.</td></tr><tr><td>🟡 <code>WARN</code></td><td><code>heartbeat_stopped</code></td><td>-</td><td>Exhausted heartbeat retries, deleting instance.</td></tr><tr><td>🔵 <code>LOG</code></td><td><code>instance_update_enqueued</code></td><td>-</td><td>Enqueued instance update for next batch (heartbeat/greedy).</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>instance_updated</code></td><td>-</td><td>Instance metadata updated OK.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>instance_update_failed</code></td><td><code>detail</code></td><td>Instance update failed, possibly due to rate limiting or error. Enqueued for retry.</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>deleted</code></td><td>-</td><td>Instance is no longer discoverable by players.</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>delete_failed</code></td><td><code>reason: "not_found"</code></td><td>Instance may have expired due to too many missed heartbeats.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>delete_failed</code></td><td><code>reason: "error"</code>, <code>detail</code></td><td>Failed to delete Instance, possibly due to rate limiting or error.</td></tr><tr><td>🔵 <code>LOG</code></td><td><code>slot_update_enqueued</code></td><td><code>slot</code></td><td>Enqueued slot update for next batch (heartbeat/greedy).</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>slot_updated</code></td><td><code>slot</code></td><td>Slot seats capacity and/or metadata updated OK.</td></tr><tr><td>🟡 <code>WARN</code></td><td><code>throttled</code></td><td><code>operation</code></td><td>Prevented attempt at concurrent update (race condition).</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>slot_update_failed</code></td><td><code>slot</code>, <code>reason: "not_found"</code></td><td>Slot with this name is not defined for this Instance yet.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>slot_update_failed</code></td><td><code>slot</code>, <code>reason: "not_enough_seats"</code></td><td>Slot update tried to reduce available seats below zero.</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>slot_update_failed</code></td><td><code>slot</code>, <code>reason: "error"</code>, <code>detail</code></td><td>Slot update failed, possibly due to rate limiting or error. Enqueued for retry.</td></tr></tbody></table>

Preview events emitted by observable `confirmations` :

<table data-full-width="true"><thead><tr><th width="125">Action Type</th><th width="200">Event Code</th><th width="300">Event Parameters</th><th>Description</th></tr></thead><tbody><tr><td>🔵 <code>LOG</code></td><td><code>enqueued</code></td><td><code>user_id</code></td><td>Enqueued confirmation for next batch (heartbeat/greedy).</td></tr><tr><td>🟡 <code>WARN</code></td><td><code>duplicate</code></td><td><code>user_id</code></td><td>Prevented attempt at duplicated confirmation (already queued).</td></tr><tr><td>🟢 <code>UPDATE</code></td><td><code>confirmed</code></td><td>-</td><td>Confirmed reservations for individual slots, includes also expired and unknown player IDs for handler to resolve (accept/kick).</td></tr><tr><td>🔴 <code>ERROR</code></td><td><code>confirm_failed</code></td><td><code>detail</code></td><td>Unexpected issue with confirmations. Check service status.</td></tr></tbody></table>
