(LobbiesV3)
Create a new lobby for an application. A lobby object is a wrapper around a room object. With a lobby, you get additional functionality like configuring the visibility of the room, managing the state of a match, and retrieving a list of public lobbies to display to players.
using HathoraCloud;
using HathoraCloud.Models.Operations;
using HathoraCloud.Models.Shared;
var sdk = new HathoraCloudSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
orgId: "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");
CreateLobbyRequest req = new CreateLobbyRequest() {
CreateLobbyV3Params = new CreateLobbyV3Params() {
Region = Region.Seattle,
RoomConfig = "{\"name\":\"my-room\"}",
Visibility = LobbyVisibility.Private,
},
AppId = "app-af469a92-5b45-4565-b3c4-b79878de67d2",
RoomId = "2swovpy1fnunu",
ShortCode = "LFG4",
};
using(var res = await sdk.LobbiesV3.CreateLobbyAsync(
security: new CreateLobbySecurity() {
PlayerAuth = "<YOUR_BEARER_TOKEN_HERE>",
},
req))
{
// handle response
}
CreateLobbyResponse
Error Type |
Status Code |
Content Type |
HathoraCloud.Models.Errors.ApiError |
400, 401, 402, 404, 422, 429 |
application/json |
HathoraCloud.Models.Errors.ApiError |
500 |
application/json |
HathoraCloud.Models.Errors.SDKException |
4XX, 5XX |
*/* |
Get details for a lobby.
using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;
var sdk = new HathoraCloudSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
orgId: "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");
GetLobbyInfoByRoomIdRequest req = new GetLobbyInfoByRoomIdRequest() {
RoomId = "2swovpy1fnunu",
AppId = "app-af469a92-5b45-4565-b3c4-b79878de67d2",
};
using(var res = await sdk.LobbiesV3.GetLobbyInfoByRoomIdAsync(req))
{
// handle response
}
GetLobbyInfoByRoomIdResponse
Error Type |
Status Code |
Content Type |
HathoraCloud.Models.Errors.ApiError |
404, 422, 429 |
application/json |
HathoraCloud.Models.Errors.SDKException |
4XX, 5XX |
*/* |
Get details for a lobby. If 2 or more lobbies have the same shortCode
, then the most recently created lobby will be returned.
using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;
var sdk = new HathoraCloudSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
orgId: "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");
GetLobbyInfoByShortCodeRequest req = new GetLobbyInfoByShortCodeRequest() {
ShortCode = "LFG4",
AppId = "app-af469a92-5b45-4565-b3c4-b79878de67d2",
};
using(var res = await sdk.LobbiesV3.GetLobbyInfoByShortCodeAsync(req))
{
// handle response
}
GetLobbyInfoByShortCodeResponse
Error Type |
Status Code |
Content Type |
HathoraCloud.Models.Errors.ApiError |
404, 429 |
application/json |
HathoraCloud.Models.Errors.SDKException |
4XX, 5XX |
*/* |
Get all active lobbies for a given application. Filter the array by optionally passing in a region
. Use this endpoint to display all public lobbies that a player can join in the game client.
using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;
var sdk = new HathoraCloudSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
orgId: "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");
ListActivePublicLobbiesRequest req = new ListActivePublicLobbiesRequest() {
AppId = "app-af469a92-5b45-4565-b3c4-b79878de67d2",
};
using(var res = await sdk.LobbiesV3.ListActivePublicLobbiesAsync(req))
{
// handle response
}
ListActivePublicLobbiesResponse
Error Type |
Status Code |
Content Type |
HathoraCloud.Models.Errors.ApiError |
401, 429 |
application/json |
HathoraCloud.Models.Errors.SDKException |
4XX, 5XX |
*/* |