Documentation

Support

Lobby

Lobby

Relay integration

Integrate Unity Relay with Lobby to enable synchronized disconnects and secure peer-to-peer communication between players.
Read time 1 minuteLast updated 15 hours ago

Using the Relay service isn't a requirement for using the Lobby service, but if you're using Relay, you can set Relay-related properties on a lobby to enable synchronized disconnects between Relay and Lobby. If you register a player's Relay information with the lobby, and that player disconnects or is disconnected from the Relay server they're connected to, the Relay service sends a notification to the Lobby service so that the disconnected player is removed from that lobby. Refer to the Relay documentation for more information about Relay and the Lobby config options for more details about configuring player disconnects. To enable Relay integration with the Lobby service, set the AllocationID for each player whenever a player is in a lobby and is using a Relay server. The AllocationID for the player who sets up the allocation (most likely the lobby host) should be the allocation ID returned by the CreateAllocationAsync API call. All other players in the lobby who join that allocation should instead use the allocation ID returned by their respective JoinAllocationAsync API calls. You can use the Game Lobby Sample, which demonstrates how to use the Lobby and Relay packages to create a typical game lobby experience. Check out the Lobby and Relay demo overview to learn about how you can use Lobby and Relay together to create a game that facilitates multiplayer game sessions without dedicated game servers.