Kronos Matchmaking
Buy NowContact
  • About
    • Kronos LTS
    • Support
    • Accolades
  • Examples
    • Playable Demo
    • Sample Project
    • Example Content
  • Configuration
  • Testing & Debugging
  • Usage
    • Getting Started
    • Authentication
      • Authenticating Users
      • Customizing The Auth Widget
      • Creating Custom Auth Tasks
    • Matchmaking
      • Overview
      • Creating Matches
      • Starting Matchmaking
      • Canceling Matchmaking
      • Using Skill Ratings
      • Sending Match Invites
      • Joining Matches
      • Leaving Matches
    • Party
      • Overview
      • Creating Parties
      • Sending Party Invites
      • Joining Parties
      • Managing Party Players
      • Party Player Actors
      • Leaving Parties
    • Reservations
      • Overview
      • Using Reservations
      • The Host Reservation
      • Completing Reservations
    • Lobby
      • Overview
      • Lobby Setup
      • Set Players Ready
      • Lobby Player Data
      • Starting The Match
      • Updating Lobby Session
      • Leaving The Lobby
    • Widgets
  • Guides
    • Creating a Level Selector
    • Integrating with Lyra Game
    • Integrating with EIK
  • Advanced
    • Steam Sockets
    • Reconnect Parties
    • Custom Party Variables
    • Player Groups
  • Changelog
    • API Upgrades
    • Legacy
Powered by GitBook
On this page
  • What is The Host Reservation
  • When To Use The Host Reservation
  • Setting The Host Reservation
  1. Usage
  2. Reservations

The Host Reservation

PreviousUsing ReservationsNextCompleting Reservations

Last updated 9 months ago

What is The Host Reservation

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

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).

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.

#include "KronosReservationManager.h"
// 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);
}

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.