Skip to main content
Version: 6.0.0

CreateLobbyWithConfig

Creates an instance of a lobby with a per-instance configuration override. Currently supports overriding the standard lobby type's team definitions. Will return the newly created lobby id in the event of a successful creation.

ServiceOperation
lobbyCREATE_LOBBY_WITH_CONFIG

Method Parameters

ParameterDescription
lobbyTypeThe type of lobby to look for. Lobby types are defined in the portal.
ratingThe skill rating to use for finding the lobby. Provided as a separate parameter because it may not exactly match the user's rating (especially in cases where parties are involved).
otherUserCxIdsArray of other users (i.e. party members) to add to the lobby as well. Will constrain things so that only lobbies with room for all players will be considered.
settingsOwner settings for this lobby.
isReadyInitial ready-status of this user.
extraJsonInitial extra-data about this user.
teamCodePreferred team for this user, if applicable. Send "" or null for automatic assignment.
configOverridesPer-instance configuration overrides applied on top of the standard lobby type. Currently supports teams (a complete replacement list of team definitions: code, minUsers, maxUsers, autoAssign).

Usage

http://localhost:3000
string lobbyType = "4v4";
int rating = 76;
string otherUserCxIds = "[\"55555:aaa-bbb-ccc-ddd:asdfjkl\"]";
string settings = "{}";
bool isReady = False;
string extraJson = "{}";
string teamCode = "reserved";
string configOverrides = "{\"teams\": [{\"code\": \"reserved\", \"minUsers\": 0, \"maxUsers\": 1, \"autoAssign\": False}, {\"code\": \"all\", \"minUsers\": 6, \"maxUsers\": 6, \"autoAssign\": True}]}";
SuccessCallback successCallback = (response, cbObject) =>
{
Debug.Log(string.Format("Success | {0}", response));
};
FailureCallback failureCallback = (status, code, error, cbObject) =>
{
Debug.Log(string.Format("Failed | {0} {1} {2}", status, code, error));
};

_bc.LobbyService.CreateLobbyWithConfig(lobbyType, rating, otherUserCxIds, settings, isReady, extraJson, teamCode, configOverrides, successCallback, failureCallback);
JSON Response
{
"data": {
"lobbyId": "23782:Relay_lobbyT_v2:1"
},
"status": 200
}