Skip to content

Latest commit

 

History

History
371 lines (246 loc) · 22.2 KB

README.md

File metadata and controls

371 lines (246 loc) · 22.2 KB

LobbiesV2

(LobbiesV2)

Overview

Available Operations

  • CreateLobbyDeprecated - 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
  • CreateLocalLobby - ⚠️ Deprecated
  • CreatePrivateLobby - ⚠️ Deprecated
  • CreatePublicLobby - ⚠️ Deprecated
  • GetLobbyInfo - Get details for a lobby. ⚠️ Deprecated
  • ListActivePublicLobbiesDeprecatedV2 - 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
  • SetLobbyState - 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

CreateLobbyDeprecated

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.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Operations;
using HathoraCloud.Models.Shared;

var sdk = new HathoraCloudSDK(appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

CreateLobbyDeprecatedRequest req = new CreateLobbyDeprecatedRequest() {
    CreateLobbyParams = new CreateLobbyParams() {
        InitialConfig = "<value>",
        Region = Region.Tokyo,
        Visibility = LobbyVisibility.Private,
    },
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.LobbiesV2.CreateLobbyDeprecatedAsync(
    security: new CreateLobbyDeprecatedSecurity() {
        PlayerAuth = "<YOUR_BEARER_TOKEN_HERE>",
    },
    req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request CreateLobbyDeprecatedRequest ✔️ The request object to use for the request.
security HathoraCloud.Models.Operations.CreateLobbyDeprecatedSecurity ✔️ The security requirements to use for the request.

Response

CreateLobbyDeprecatedResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 400,401,402,404,422,429,500 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

CreateLocalLobby

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Operations;
using HathoraCloud.Models.Shared;

var sdk = new HathoraCloudSDK(appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

CreateLocalLobbyRequest req = new CreateLocalLobbyRequest() {
    RequestBody = new CreateLocalLobbyRequestBody() {
        InitialConfig = "<value>",
        Region = Region.SaoPaulo,
    },
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.LobbiesV2.CreateLocalLobbyAsync(
    security: new CreateLocalLobbySecurity() {
        PlayerAuth = "<YOUR_BEARER_TOKEN_HERE>",
    },
    req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request CreateLocalLobbyRequest ✔️ The request object to use for the request.
security HathoraCloud.Models.Operations.CreateLocalLobbySecurity ✔️ The security requirements to use for the request.

Response

CreateLocalLobbyResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 400,401,402,404,422,429,500 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

CreatePrivateLobby

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Operations;
using HathoraCloud.Models.Shared;

var sdk = new HathoraCloudSDK(appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

CreatePrivateLobbyRequest req = new CreatePrivateLobbyRequest() {
    RequestBody = new CreatePrivateLobbyRequestBody() {
        InitialConfig = "<value>",
        Region = Region.Chicago,
    },
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.LobbiesV2.CreatePrivateLobbyAsync(
    security: new CreatePrivateLobbySecurity() {
        PlayerAuth = "<YOUR_BEARER_TOKEN_HERE>",
    },
    req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request CreatePrivateLobbyRequest ✔️ The request object to use for the request.
security HathoraCloud.Models.Operations.CreatePrivateLobbySecurity ✔️ The security requirements to use for the request.

Response

CreatePrivateLobbyResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 400,401,402,404,422,429,500 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

CreatePublicLobby

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Operations;
using HathoraCloud.Models.Shared;

var sdk = new HathoraCloudSDK(appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

CreatePublicLobbyRequest req = new CreatePublicLobbyRequest() {
    RequestBody = new CreatePublicLobbyRequestBody() {
        InitialConfig = "<value>",
        Region = Region.SaoPaulo,
    },
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.LobbiesV2.CreatePublicLobbyAsync(
    security: new CreatePublicLobbySecurity() {
        PlayerAuth = "<YOUR_BEARER_TOKEN_HERE>",
    },
    req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request CreatePublicLobbyRequest ✔️ The request object to use for the request.
security HathoraCloud.Models.Operations.CreatePublicLobbySecurity ✔️ The security requirements to use for the request.

Response

CreatePublicLobbyResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 400,401,402,404,422,429,500 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

GetLobbyInfo

Get details for a lobby.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

GetLobbyInfoRequest req = new GetLobbyInfoRequest() {
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.LobbiesV2.GetLobbyInfoAsync(req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request GetLobbyInfoRequest ✔️ The request object to use for the request.

Response

GetLobbyInfoResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 404,429 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

ListActivePublicLobbiesDeprecatedV2

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.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

ListActivePublicLobbiesDeprecatedV2Request req = new ListActivePublicLobbiesDeprecatedV2Request() {};


using(var res = await sdk.LobbiesV2.ListActivePublicLobbiesDeprecatedV2Async(req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request ListActivePublicLobbiesDeprecatedV2Request ✔️ The request object to use for the request.

Response

ListActivePublicLobbiesDeprecatedV2Response

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401,429 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /

SetLobbyState

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.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2");

SetLobbyStateRequest req = new SetLobbyStateRequest() {
    SetLobbyStateParams = new SetLobbyStateParams() {
        State = "<value>",
    },
    RoomId = "2swovpy1fnunu",
};


using(var res = await sdk.LobbiesV2.SetLobbyStateAsync(req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request SetLobbyStateRequest ✔️ The request object to use for the request.

Response

SetLobbyStateResponse

Errors

Error Object Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401,404,422,429 application/json
HathoraCloud.Models.Errors.SDKException 4xx-5xx /