LobbyApi
Import
Import
Constructors
Constructor
-
Parameters
-
Optional configuration: Configuration
-
basePath: string = ...
-
axios: AxiosInstance = ...
Returns LobbyApi
-
Methods
Create Lobby
-
Parameters
-
Optional createRequest: CreateRequest
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<Lobby>>
-
Delete Lobby
-
Delete a lobby so it's no longer discoverable/joinable.
Parameters
-
lobbyId: string
The ID of the lobby to execute the request against.
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<void>>
-
Get Joined Lobbies
-
Get a list of lobby IDs that the player is currently a member of.
Parameters
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<string[]>>
-
Get Lobby
-
Get the full details for a lobby including the game-specific metadata and player details.
Parameters
-
lobbyId: string
The ID of the lobby to execute the request against.
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<Lobby>>
-
Heartbeat
-
Heartbeat a lobby, updating its
LastUpdated
property, to signify that the lobby is not stale.Parameters
-
lobbyId: string
The ID of the lobby to execute the request against.
-
Optional body: object
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<void>>
-
Join Lobby By Code
-
Join an existing lobby using the lobby code if there is space available (i.e. total number of players is less than the value of
MaxPlayers
).Parameters
-
Optional joinByCodeRequest: JoinByCodeRequest
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<Lobby>>
-
Join Lobby By Id
-
Join an existing lobby using the lobby ID if there is space available (i.e. total number of players is less than the value of
MaxPlayers
).Parameters
-
lobbyId: string
The ID of the lobby to execute the request against.
-
Optional player: Player
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<Lobby>>
-
Query Lobbies
-
Query all of the public lobbies for a title and filter them down according to parameters provided by the client.
Parameters
-
Optional queryRequest: QueryRequest
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<QueryResponse>>
-
Quick Join Lobby
-
Query all of the available lobbies for a title and filter them down according to parameters provided by the client. If possible, join one and return its information.
Parameters
-
Optional quickJoinRequest: QuickJoinRequest
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<Lobby>>
-
Reconnect
-
Reconnect a disconnected player to a lobby using the lobby ID.
Parameters
-
lobbyId: string
The ID of the lobby to execute the request against.
-
Optional body: object
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<Lobby>>
-
Remove Player
-
Remove an individual player from a lobby. If the player being removed is the host, a random player is chosen as the new host. Hosts can avoid this by changing the
hostId
to another player using the Update Lobby API before leaving.Parameters
-
lobbyId: string
The ID of the lobby to execute the request against.
-
playerId: string
The ID of the player to execute the request against.
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<void>>
-
Request Tokens
-
Request authentication tokens for use with other services that interact with Lobby.
Parameters
-
lobbyId: string
The ID of the lobby to execute the request against.
-
tokenRequest: TokenRequest[]
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<{}>>
-
Update Lobby
-
Update the properties of a lobby. This could include the lobby name, number of max players, the lobby's
data
property, etc.Parameters
-
lobbyId: string
The ID of the lobby to execute the request against.
-
Optional updateRequest: UpdateRequest
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<Lobby>>
-
Update Player
-
Update the properties of a player. Only the player matching the player ID can perform this action. This could include updating the
data
property for an individual player to include game-specific metadata. The index data property is not allowed on player data objects at this time.Parameters
-
lobbyId: string
The ID of the lobby to execute the request against.
-
playerId: string
The ID of the player to execute the request against.
-
Optional playerUpdateRequest: PlayerUpdateRequest
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<Lobby>>
-
Create a new lobby and return the lobby metadata.
Create a lobby
{RequiredError}
LobbyApi