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 , and then updating the
UpdateLobbyfield to the ID of the new host player. The old host remains in the lobby as a non-host player.HostId - 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.
Migration data
Host migration data facilitates the transfer of binary game data during host migration events in a lobby. The migration data flow uses themigrationdatainfo- 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.
Migration data flow
At any time, hosts can request the migration data information and use the URLs to manage binary game data in Lobby:- : Allows downloading the current migration data. Execute an HTTP GET with the provided URL. When the status is
GET URL, the response body contains the current game data.200 - OK - : Enables uploading updated migration data. Execute an HTTP PUT with the provided URL. Request body containing the game data and
PUT URLheader set tocontent-type. The content length must respect the value provided in the URL query parameter.application/octet-stream
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.