Skip to main content
Version: 5.7.0

GetLobbyInstances

Gets a map keyed by rating of the visible lobby instances matching the given type and rating range.

ServiceOperation
lobbyGET_LOBBY_INSTANCES

Method Parameters

ParameterDescription
lobbyTypeThe type of lobby to look for. Lobby types are defined in the portal.
criteriaJsonJSON object describing the filter criteria. Supported sub-values include: 'rating'.

Usage

http://localhost:3000
string lobbyType = "Relay_lobbyT_v2";
Dictionary<string, object> criteriaJson = new Dictionary<string, object>
{
{ "rating", new Dictionary<string, object>
{
{ "min", 10 },
{ "max", 100 }
}
}
};

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.GetLobbyInstances(lobbyType, criteriaJson, successCallback, failureCallback);
tip

If the "settings" parameter is specified during the creation of a lobby, as demonstrated below:

{
"_public": {
"name": "myLobbyName",
"pwd": "mySecretCode"
}
}

A new field named "publicSettings" will be returned in the response.

{
"publicSettings": {
"name": "myLobbyName",
"pwd": "mySecretCode"
}
}
JSON Response
{
"data": {
"lobbiesByRating": {
"20.0": [
{
"id": "23782:Relay_lobbyT_v2:2",
"lobbyType": "Relay_lobbyT_v2",
"state": "setup",
"rating": 20,
"desc": "starts as soon as 1 player is ready",
"owner": {
"profileId": "10b6d6fa-0aa6-43b0-a7b3-48aff2d13312",
"name": "",
"rating": 0,
"pic": null,
"cxId": "23782:10b6d6fa-0aa6-43b0-a7b3-48aff2d13312:52kc0h19k0pnnjhnrp8pug7udd"
},
"numMembers": 1,
"maxMembers": 8,
"publicSettings": {
"name": "myLobbyName",
"pwd": "mySecretCode"
}
}
]
}
},
"status": 200
}