(lobbiesV2())
createLobbyDeprecated- CreateLobbyDeprecated⚠️ DeprecatedcreateLocalLobby- CreateLocalLobby⚠️ DeprecatedcreatePrivateLobby- CreatePrivateLobby⚠️ DeprecatedcreatePublicLobby- CreatePublicLobby⚠️ DeprecatedgetLobbyInfo- GetLobbyInfo⚠️ DeprecatedlistActivePublicLobbiesDeprecatedV2- ListActivePublicLobbiesDeprecatedV2⚠️ DeprecatedsetLobbyState- SetLobbyState⚠️ Deprecated
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.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.CreateLobbyDeprecatedResponse;
import dev.hathora.cloud_sdk.models.operations.CreateLobbyDeprecatedSecurity;
import dev.hathora.cloud_sdk.models.shared.CreateLobbyParams;
import dev.hathora.cloud_sdk.models.shared.LobbyVisibility;
import dev.hathora.cloud_sdk.models.shared.Region;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
CreateLobbyDeprecatedResponse res = sdk.lobbiesV2().createLobbyDeprecated()
.security(CreateLobbyDeprecatedSecurity.builder()
.playerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build())
.createLobbyParams(CreateLobbyParams.builder()
.initialConfig("<value>")
.region(Region.TOKYO)
.visibility(LobbyVisibility.PRIVATE)
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.roomId("2swovpy1fnunu")
.call();
if (res.lobby().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
security |
dev.hathora.cloud_sdk.models.operations.CreateLobbyDeprecatedSecurity | ✔️ | The security requirements to use for the request. | |
createLobbyParams |
CreateLobbyParams | ✔️ | N/A | |
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
roomId |
Optional<String> | ➖ | N/A | 2swovpy1fnunu |
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ApiError | 400, 401, 402, 404, 422, 429, 500 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |
CreateLocalLobby
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.CreateLocalLobbyRequestBody;
import dev.hathora.cloud_sdk.models.operations.CreateLocalLobbyResponse;
import dev.hathora.cloud_sdk.models.operations.CreateLocalLobbySecurity;
import dev.hathora.cloud_sdk.models.shared.Region;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
CreateLocalLobbyResponse res = sdk.lobbiesV2().createLocalLobby()
.security(CreateLocalLobbySecurity.builder()
.playerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build())
.requestBody(CreateLocalLobbyRequestBody.builder()
.initialConfig("<value>")
.region(Region.SAO_PAULO)
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.roomId("2swovpy1fnunu")
.call();
if (res.lobby().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
security |
dev.hathora.cloud_sdk.models.operations.CreateLocalLobbySecurity | ✔️ | The security requirements to use for the request. | |
requestBody |
CreateLocalLobbyRequestBody | ✔️ | N/A | |
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
roomId |
Optional<String> | ➖ | N/A | 2swovpy1fnunu |
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ApiError | 400, 401, 402, 404, 422, 429, 500 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |
CreatePrivateLobby
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.CreatePrivateLobbyRequestBody;
import dev.hathora.cloud_sdk.models.operations.CreatePrivateLobbyResponse;
import dev.hathora.cloud_sdk.models.operations.CreatePrivateLobbySecurity;
import dev.hathora.cloud_sdk.models.shared.Region;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
CreatePrivateLobbyResponse res = sdk.lobbiesV2().createPrivateLobby()
.security(CreatePrivateLobbySecurity.builder()
.playerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build())
.requestBody(CreatePrivateLobbyRequestBody.builder()
.initialConfig("<value>")
.region(Region.CHICAGO)
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.roomId("2swovpy1fnunu")
.call();
if (res.lobby().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
security |
dev.hathora.cloud_sdk.models.operations.CreatePrivateLobbySecurity | ✔️ | The security requirements to use for the request. | |
requestBody |
CreatePrivateLobbyRequestBody | ✔️ | N/A | |
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
roomId |
Optional<String> | ➖ | N/A | 2swovpy1fnunu |
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ApiError | 400, 401, 402, 404, 422, 429, 500 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |
CreatePublicLobby
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.CreatePublicLobbyRequestBody;
import dev.hathora.cloud_sdk.models.operations.CreatePublicLobbyResponse;
import dev.hathora.cloud_sdk.models.operations.CreatePublicLobbySecurity;
import dev.hathora.cloud_sdk.models.shared.Region;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
CreatePublicLobbyResponse res = sdk.lobbiesV2().createPublicLobby()
.security(CreatePublicLobbySecurity.builder()
.playerAuth("<YOUR_BEARER_TOKEN_HERE>")
.build())
.requestBody(CreatePublicLobbyRequestBody.builder()
.initialConfig("<value>")
.region(Region.SAO_PAULO)
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.roomId("2swovpy1fnunu")
.call();
if (res.lobby().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
security |
dev.hathora.cloud_sdk.models.operations.CreatePublicLobbySecurity | ✔️ | The security requirements to use for the request. | |
requestBody |
CreatePublicLobbyRequestBody | ✔️ | N/A | |
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
roomId |
Optional<String> | ➖ | N/A | 2swovpy1fnunu |
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ApiError | 400, 401, 402, 404, 422, 429, 500 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |
Get details for a lobby.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetLobbyInfoResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
GetLobbyInfoResponse res = sdk.lobbiesV2().getLobbyInfo()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.roomId("2swovpy1fnunu")
.call();
if (res.lobby().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
roomId |
String | ✔️ | N/A | 2swovpy1fnunu |
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ApiError | 404, 429 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |
Get all active lobbies for a an application. Filter by optionally passing in a region
. Use this endpoint to display all public lobbies that a player can join in the game client.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.ListActivePublicLobbiesDeprecatedV2Response;
import dev.hathora.cloud_sdk.models.shared.Region;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
ListActivePublicLobbiesDeprecatedV2Response res = sdk.lobbiesV2().listActivePublicLobbiesDeprecatedV2()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.region(Region.MUMBAI)
.call();
if (res.classes().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
region |
Optional<Region> | ➖ | Region to filter by. If omitted, active public lobbies in all regions will be returned. |
ListActivePublicLobbiesDeprecatedV2Response
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ApiError | 401, 429 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |
Set the state of a lobby. State is intended to be set by the server and must be smaller than 1MB. Use this endpoint to store match data like live player count to enforce max number of clients or persist end-game data (i.e. winner or final scores).
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.SetLobbyStateResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import dev.hathora.cloud_sdk.models.shared.SetLobbyStateParams;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
SetLobbyStateResponse res = sdk.lobbiesV2().setLobbyState()
.setLobbyStateParams(SetLobbyStateParams.builder()
.state("South Dakota")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.roomId("2swovpy1fnunu")
.call();
if (res.lobby().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
setLobbyStateParams |
SetLobbyStateParams | ✔️ | N/A | |
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
roomId |
String | ✔️ | N/A | 2swovpy1fnunu |
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ApiError | 401, 404, 422, 429 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |