Documentation

Support

Lobby

Lobby

Host migration

Transfer the lobby host role from one player to another when the host leaves or disconnects from the lobby.
Read time 2 minutesLast updated 21 days ago

Host migration is the act of transferring the lobby host role from one player to another. This process can occur in the following scenarios:
  • The host of a lobby selects a new host by using
    UpdateLobby
    , and then updating the
    HostId
    field to the ID of the new host player. The old host remains in the lobby as a non-host player.
  • The host leaves the lobby intentionally without first selecting a new host.
  • Relay integrations removes the host due to inactivity.
  • The host disconnects from the event system for longer than five seconds.
In the scenarios where the host does not specify a new host, the new host is selected randomly from the other players who are currently in the lobby.

Migration data

Host migration data facilitates the transfer of binary game data during host migration events in a lobby. The migration data flow uses the
migrationdatainfo
endpoint to provide secure, pre-signed URLs for both retrieving and storing binary migration data.
These URLS have the following characteristics:
  • They expire.
  • They have a maximum allowed data length per call.
  • They are player-specific.
  • They only work while the player is in the Lobby host.
Remember to keep migration data compact by only including essential data needed for seamless host transitions, and by avoiding the inclusion of sensitive player information.

Migration data flow

At any time, hosts can request the migration data information and use the URLs to manage binary game data in Lobby:
  1. GET URL
    : Allows downloading the current migration data. Execute an HTTP GET with the provided URL. When the status is
    200 - OK
    , the response body contains the current game data.
  2. PUT URL
    : Enables uploading updated migration data. Execute an HTTP PUT with the provided URL. Request body containing the game data and
    content-type
    header set to
    application/octet-stream
    . The content length must respect the value provided in the URL query parameter.
This approach ensures data integrity and provides a reliable mechanism for preserving lobby state during host transitions. Include version information to handle compatibility between different game versions, as well as retry logic and fallback mechanisms for network failures.