> For the complete documentation index, see [llms.txt](https://horizongames.gitbook.io/kronos-matchmaking/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://horizongames.gitbook.io/kronos-matchmaking/usage/reservations/the-host-reservation.md).

# The Host Reservation

## What is The Host Reservation

The **Host Reservation** is a set of reservations that will be registered immediately when a `KronosReservationHost` is created.

{% hint style="warning" %}
In order to keep the reservation system in sync with the session, the **Host Reservation** must be set properly before changing maps (e.g. from lobby to game).
{% endhint %}

## When To Use The Host Reservation

You must set the **Host Reservation** before changing maps in online matches.

Imagine that you are hosting a match for your friends. After finishing the current match, you simply want to change maps and continue playing. The issue is that your `KronosReservationHost` beacon will be destroyed once you begin changing maps, and your friends who are already in the session won't request a reservation again since they are already in the session. So in order to keep the reservation system in sync with the session, you (the host) must set the host reservation to one that includes everyone in the current match before initiating the map change.

## Setting The Host Reservation

Use the `SetHostReservations` in combination with the `CopyRegisteredReservations` function before changing maps in online matches (e.g. from lobby to game) to ensure that all players will have a valid reservation when they attempt join the new map.

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

<figure><img src="/files/p7Cqqzkr5GdFxMV2fUyo" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="C++" %}

```cpp
#include "KronosReservationManager.h"
```

```cpp
// Get the reservation manager.
UKronosReservationManager* ReservationManager = UKronosReservationManager::Get(this);
if (ReservationManager->IsReservationHost())
{
    // Get the reservations that we want to register.
    // Here we are making a copy of the current reservations to keep all players
    // reservations intact when changing maps.
    // Note that this reservation is still data only, it needs to be registered!
    const TArray<FKronosReservation> Reservations = ReservationManager->CopyRegisteredReservations();
    
    // Register the reservations.
    ReservationManager->SetHostReservations(Reservations);
}
```

{% endtab %}
{% endtabs %}

If the **Host Reservation** is empty, a reservation will be made for the local player automatically. Once it is register it will be consume - meaning it is reset into an empty reservation.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://horizongames.gitbook.io/kronos-matchmaking/usage/reservations/the-host-reservation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
