Complete the code to create a new lobby with a maximum of 4 players.
var options = new CreateLobbyOptions { MaxPlayers = [1] };
LobbyService.Instance.CreateLobbyAsync("MyLobby", options);The maximum number of players is set to 4 to allow up to 4 players in the lobby.
Complete the code to join a lobby by its ID.
var lobby = await LobbyService.Instance.JoinLobbyByIdAsync([1]);You need to provide the lobby ID as a string to join the correct lobby.
Fix the error in the code to properly list all available lobbies.
var lobbyList = await LobbyService.Instance.[1]();The correct method to list all lobbies is ListLobbiesAsync.
Fill both blanks to create a lobby and set it to be private.
var options = new CreateLobbyOptions { [1] = 6, [2] = true };
await LobbyService.Instance.CreateLobbyAsync("PrivateLobby", options);MaxPlayers sets the maximum players, and IsPrivate makes the lobby private.
Fill all three blanks to update the lobby's data with a new game mode and max players.
var updateOptions = new UpdateLobbyOptions {
Data = new Dictionary<string, DataObject> {
{ "GameMode", new DataObject(DataObject.VisibilityOptions.Public, [1]) }
},
[2] = [3]
};
await LobbyService.Instance.UpdateLobbyAsync(lobby.Id, updateOptions);The game mode is set to "Deathmatch", MaxPlayers is updated to 8.
