Interface ILobbyApi
Represents a collection of functions to interact with the API endpoints
Namespace: Unity.Services.Apis.Lobbies
Assembly: Unity.Services.Apis.dll
Syntax
public interface ILobbyApi : IApiAccessor
Methods
BulkUpdateLobby(string, string, string, BulkUpdateRequest, CancellationToken)
Bulk update
Declaration
ApiOperation<Lobby> BulkUpdateLobby(string lobbyId, string serviceId = null, string impersonatedUserId = null, BulkUpdateRequest bulkUpdateRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | lobbyId | The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters. |
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Bulk |
bulkUpdateRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
CreateLobby(string, string, CreateRequest, CancellationToken)
Create a lobby
Declaration
ApiOperation<Lobby> CreateLobby(string serviceId = null, string impersonatedUserId = null, CreateRequest createRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Create |
createRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
CreateOrJoinLobby(string, string, string, CreateRequest, CancellationToken)
Create or join a lobby with lobby ID
Declaration
ApiOperation<Lobby> CreateOrJoinLobby(string lobbyId, string serviceId = null, string impersonatedUserId = null, CreateRequest createRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | lobbyId | The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters. |
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Create |
createRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
DeleteLobby(string, string, string, CancellationToken)
Delete a lobby
Declaration
ApiOperation DeleteLobby(string lobbyId, string serviceId = null, string impersonatedUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | lobbyId | The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters. |
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetHostedLobbies(string, string, CancellationToken)
Get a player/service's hosted lobbies
Declaration
ApiOperation<List<string>> GetHostedLobbies(string serviceId = null, string impersonatedUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetJoinedLobbies(string, string, CancellationToken)
Get a player's joined lobbies
Declaration
ApiOperation<List<string>> GetJoinedLobbies(string serviceId = null, string impersonatedUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetLobby(string, string, string, string, CancellationToken)
Get lobby details
Declaration
ApiOperation<Lobby> GetLobby(string lobbyId, string serviceId = null, string impersonatedUserId = null, string ifNoneMatch = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | lobbyId | The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters. |
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
string | ifNoneMatch | The etag of the record being requested. Results/actions are only returned/executed when the current record version does not match the provided value. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
Heartbeat(string, string, string, object, CancellationToken)
Heartbeat a lobby
Declaration
ApiOperation Heartbeat(string lobbyId, string serviceId = null, string impersonatedUserId = null, object body = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | lobbyId | The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters. |
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
object | body | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
JoinLobbyByCode(string, string, JoinByCodeRequest, CancellationToken)
Join a lobby with lobby code
Declaration
ApiOperation<Lobby> JoinLobbyByCode(string serviceId = null, string impersonatedUserId = null, JoinByCodeRequest joinByCodeRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Join |
joinByCodeRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
JoinLobbyById(string, string, string, JoinByIdRequest, CancellationToken)
Join a lobby with lobby ID
Declaration
ApiOperation<Lobby> JoinLobbyById(string lobbyId, string serviceId = null, string impersonatedUserId = null, JoinByIdRequest joinByIdRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | lobbyId | The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters. |
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Join |
joinByIdRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
QueryLobbies(string, string, QueryRequest, CancellationToken)
Query public lobbies
Declaration
ApiOperation<QueryResponse> QueryLobbies(string serviceId = null, string impersonatedUserId = null, QueryRequest queryRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Query |
queryRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
QuickJoinLobby(string, string, QuickJoinRequest, CancellationToken)
Query available lobbies and join a random one
Declaration
ApiOperation<Lobby> QuickJoinLobby(string serviceId = null, string impersonatedUserId = null, QuickJoinRequest quickJoinRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Quick |
quickJoinRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
Reconnect(string, string, string, object, CancellationToken)
Reconnect to a lobby after disconnecting
Declaration
ApiOperation<Lobby> Reconnect(string lobbyId, string serviceId = null, string impersonatedUserId = null, object body = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | lobbyId | The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters. |
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
object | body | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
RemovePlayer(string, string, string, string, CancellationToken)
Remove a player
Declaration
ApiOperation RemovePlayer(string lobbyId, string playerId, string serviceId = null, string impersonatedUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | lobbyId | The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters. |
string | playerId | The ID of the player to execute the request against. |
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
UpdateLobby(string, string, string, UpdateRequest, CancellationToken)
Update lobby data
Declaration
ApiOperation<Lobby> UpdateLobby(string lobbyId, string serviceId = null, string impersonatedUserId = null, UpdateRequest updateRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | lobbyId | The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters. |
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Update |
updateRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
UpdatePlayer(string, string, string, string, PlayerUpdateRequest, CancellationToken)
Update player data
Declaration
ApiOperation<Lobby> UpdatePlayer(string lobbyId, string playerId, string serviceId = null, string impersonatedUserId = null, PlayerUpdateRequest playerUpdateRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | lobbyId | The ID of the lobby to execute the request against. It should be composed of 64 characters or less, and only have dashes, underscores and alphanumeric characters. |
string | playerId | The ID of the player to execute the request against. |
string | serviceId | When service authentication is used, this provides a logical identity for the service (optional) |
string | impersonatedUserId | When service authentication is used, this provides a 'playerId' to execute as. If this header is detected, the service request will be identical to a request from the specified player. (optional) |
Player |
playerUpdateRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |