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.
- The host is removed due to inactivity by Relay integrations.
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.
Note: If the host is removed due to inactivity, the underlying relay connection is destroyed. To continue receiving automatic disconnects, the new host must create a new relay, and then have the other players join it and set their Allocation ID/ Connection info per the instructions in the Relay integrations section.