Operations to create and manage lobbies.
- CreateLobby - Create a new lobby for an existing application using
appId
. CreateLocalLobby-⚠️ DeprecatedCreatePrivateLobby-⚠️ DeprecatedCreatePublicLobby-⚠️ Deprecated- GetLobbyInfo - Get details for an existing lobby using
appId
androomId
. - ListActivePublicLobbies - Get all active lobbies for a given application using
appId
. Filter the array by optionally passing in aregion
. - SetLobbyState - Set the state of a lobby using
appId
androomId
. State is intended to be set by the server and must be smaller than 1MB.
Create a new lobby for an existing application using appId
.
using Hathora;
using Hathora.Models.Operations;
using Hathora.Models.Shared;
var sdk = new HathoraSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2"
);
using(var res = await sdk.LobbyV2.CreateLobbyAsync(new Models.Operations.CreateLobbyRequest() {
CreateLobbyRequest = new Models.Shared.CreateLobbyRequest() {
InitialConfig = new LobbyInitialConfig() {},
Region = Hathora.Models.Shared.Region.London,
Visibility = Hathora.Models.Shared.LobbyVisibility.Private,
},
RoomId = "2swovpy1fnunu",
}))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
Models.Operations.CreateLobbyRequest | ✔️ | The request object to use for the request. |
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
using Hathora;
using Hathora.Models.Operations;
using Hathora.Models.Shared;
var sdk = new HathoraSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2"
);
using(var res = await sdk.LobbyV2.CreateLocalLobbyAsync(new CreateLocalLobbyRequest() {
RequestBody = new CreateLocalLobbyRequestBody() {
InitialConfig = new LobbyInitialConfig() {},
Region = Hathora.Models.Shared.Region.Frankfurt,
},
RoomId = "2swovpy1fnunu",
}))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
CreateLocalLobbyRequest | ✔️ | The request object to use for the request. |
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
using Hathora;
using Hathora.Models.Operations;
using Hathora.Models.Shared;
var sdk = new HathoraSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2"
);
using(var res = await sdk.LobbyV2.CreatePrivateLobbyAsync(new CreatePrivateLobbyRequest() {
RequestBody = new CreatePrivateLobbyRequestBody() {
InitialConfig = new LobbyInitialConfig() {},
Region = Hathora.Models.Shared.Region.Chicago,
},
RoomId = "2swovpy1fnunu",
}))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
CreatePrivateLobbyRequest | ✔️ | The request object to use for the request. |
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
using Hathora;
using Hathora.Models.Operations;
using Hathora.Models.Shared;
var sdk = new HathoraSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2"
);
using(var res = await sdk.LobbyV2.CreatePublicLobbyAsync(new CreatePublicLobbyRequest() {
RequestBody = new CreatePublicLobbyRequestBody() {
InitialConfig = new LobbyInitialConfig() {},
Region = Hathora.Models.Shared.Region.Sydney,
},
RoomId = "2swovpy1fnunu",
}))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
CreatePublicLobbyRequest | ✔️ | The request object to use for the request. |
Get details for an existing lobby using appId
and roomId
.
using Hathora;
using Hathora.Models.Operations;
var sdk = new HathoraSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2"
);
using(var res = await sdk.LobbyV2.GetLobbyInfoAsync(new GetLobbyInfoRequest() {
RoomId = "2swovpy1fnunu",
}))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
GetLobbyInfoRequest | ✔️ | The request object to use for the request. |
Get all active lobbies for a given application using appId
. Filter the array by optionally passing in a region
.
using Hathora;
using Hathora.Models.Operations;
using Hathora.Models.Shared;
var sdk = new HathoraSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2"
);
using(var res = await sdk.LobbyV2.ListActivePublicLobbiesAsync(new ListActivePublicLobbiesRequest() {
Region = Hathora.Models.Shared.Region.Seattle,
}))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
ListActivePublicLobbiesRequest | ✔️ | The request object to use for the request. |
ListActivePublicLobbiesResponse
Set the state of a lobby using appId
and roomId
. State is intended to be set by the server and must be smaller than 1MB.
using Hathora;
using Hathora.Models.Operations;
using Hathora.Models.Shared;
var sdk = new HathoraSDK(
appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2"
);
using(var res = await sdk.LobbyV2.SetLobbyStateAsync(new SetLobbyStateSecurity() {
HathoraDevToken = "",
}, new Models.Operations.SetLobbyStateRequest() {
SetLobbyStateRequest = new Models.Shared.SetLobbyStateRequest() {
State = new SetLobbyStateRequestState() {},
},
RoomId = "2swovpy1fnunu",
}))
{
// handle response
}
Parameter | Type | Required | Description |
---|---|---|---|
request |
Models.Operations.SetLobbyStateRequest | ✔️ | The request object to use for the request. |
security |
SetLobbyStateSecurity | ✔️ | The security requirements to use for the request. |