Skip to main content
Version: 6.0.0

CreateLobby

Creates a new lobby.

Sends LOBBY_JOIN_SUCCESS message to the user, with full copy of lobby data Sends LOBBY_MEMBER_JOINED to all lobby members, with copy of member data

ServiceOperation
lobbyCREATE_LOBBY

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).
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.
settingsOwner settings for this lobby.
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.

Usage

http://localhost:3000
string lobbyType = "4v4";
int rating = 76;
bool isReady = false;
string extraJson = "{}";
string teamCode = "blue";
string settings = "{}";
string[] otherUserCxIds = { "55555:aaa-bbb-ccc-ddd:asdfjkl" };
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.CreateLobby(lobbyType, rating, isReady, extraJson, teamCode, settings, otherUserCxIds, successCallback, failureCallback);
JSON Response
{
"status": 200,
"data": {}
}
Common Error Code

Status Codes

CodeNameDescription
40601RTT_NOT_ENABLEDRTT must be enabled for this feature