Client Lobby API Reference
The Lobby Service works with the DS Hosting and Management service and provides a way for the game to gather players together to start a battle. A player can create a private lobby to play battles with specific people or create an open lobby which anyone can join. The Lobby Service also provides lobby management, search, text chat, and other features.
API List
| API | Description |
|---|---|
| CreateLobby | Create a new lobby |
| GetLobbyDetailInfo | Get detail information of a lobby |
| GetLobbyBriefInfo | Get brief information of a lobby |
| BatchGetLobbyBriefInfo | Get brief information of lobby in batch (max 100 lobbies) |
| EditLobbyInfo | Edit detail information of a lobby, only available for lobby owner |
| SearchLobby | Search the lobby list @param params The optional filter information when searching the lobby list. Note: If these data are not filled (lobby_id, lobby_config, status, protection), all existing lobbies will be returned. |
| JoinLobby | Join the specified lobby |
| QuickJoinLobby | PGOS will attempt to place the player into a lobby instance that meets the lobby global kv data data filtering conditions, note that this operation does not guarantee success. Only Lobby instances with 1) status as Waiting, 2) LobbyPrivacy as Visible, and 3) LobbyProtection as FreeAccess can be quickly joined. |
| JoinLobbyWithGroups | Join the specified group in the specified lobby. Try to join the specified groups in the lobby according to the specified priority value from small to large. Slot selection within the group follows the Team Selection Strategy configuration on the portal. The portal's lobby configuration needs to be switched to advanced mode. |
| JoinLobbyWithTeams | Join the specified team in the specified lobby. Try to join the specified teams in the lobby according to the specified priority value from small to large. When multiple teams have the same priority, slot selection follows the Team Selection Strategy configuration on the portal. The portal's lobby configuration needs to be switched to advanced mode. |
| LeaveLobby | Leave current lobby |
| DismissLobby | Dismiss current lobby, only available for lobby owner |
| KickOutMember | Kick out a lobby member, only available for lobby owner |
| InvitePlayer | Invite a player to current lobby |
| SwitchTeamSlot | Switch to another slot. The operation will be failed if the target slot is already occupied Note that the team slot index starts form 1. |
| RequestSwitchTeamSlot | Switch team slot with another lobby member. The operation will be failed if the target slot is empty. Note that the team slot index starts form 1. |
| ConfirmSwitchTeamSlot | Agree to swap slots with a lobby member at the specified position. The interface will return a failure if the position of either party in the swap request changes. |
| RejectSwitchTeamSlot | Reject a team slot switch request. |
| TransferOwnership | Transfer the ownership of a lobby to another member, only available for lobby owner |
| SetLobbyData | Update lobby data, only available for lobby owner |
| SetLobbyGlobalData | Update lobby global data, only available for lobby owner |
| SetLobbyPlayerData | Update player lobby data, lobby members can only modify their own custom data. |
| StartBattle | Try to start a battle that contains all lobby members, only available for lobby owner |
| ReadyForBattle | Switch the READY flag of current lobby member |
| GetCurrentLobbyDetail | Get latest lobby detail information from SDK local cache |
| SendLobbyChatTextMsg | Send a message to the lobby's chat channel. Only enable_chatting in CreateLobbyParams is True when the lobby was created |
| SendLobbyChatCustomMsg | Send a message to the lobby's chat channel. Only enable_chatting in CreateLobbyParams is True when the lobby was created |
| ApproveJoinLobbyRequest | Approve a lobby join request. The interface is for lobby owner use only. Each request is valid for 10 minutes. |
| RejectJoinLobbyRequest | Approve a lobby join request. The interface is for lobby owner use only. Each request is valid for 10 minutes. |
| GetPlayerLobbyInfo | Get the player's current lobby information from server. |
Event List
| Event | Description |
|---|---|
| OnLobbyMemberJoined | The event will be triggered when someone joined current lobby. |
| OnLobbyMemberLeft | The event will be triggered when someone left current lobby. |
| OnLobbyTeamUpdated | The event will be triggered when team struct of current lobby changed. |
| OnLobbyInvitation | The event will be triggered when receive lobby invitations. |
| OnLobbyDismiss | The event will be triggered when current lobby is dismissed. |
| OnLobbyOwnerTransferred | The event will be triggered when lobby ownership is transferred. |
| OnLobbyInfoUpdated | The event will be triggered when current lobby options is changed. |
| OnLobbyDataUpdated | The event will be triggered when custom lobby data is changed. |
| OnLobbyStatusChanged | The event will be triggered when current lobby's status changed. |
| OnBattleSessionUpdated | The event will be triggered when the battle session started by current lobby has updated. |
| OnReceiveLobbyChatMsg | The event will be triggered when receive chat messages from current lobby's chat channel. |
| OnLobbySwitchTeamSlotRequest | The event will be triggered when another lobby member send a team-slot switch request. |
| OnLobbySwitchTeamSlotRequestConfirmed | The event will be triggered when a switch request when a team-slot switch request has been confirmed. |
| OnLobbySwitchTeamSlotRequestRejected | The event will be triggered when a team-slot switch request has been rejected. |
| OnLobbyJoinRequest | The event will be triggered when a player request to join a lobby with protection type LobbyProtection::ApplicationNeeded. |
| OnLobbyJoinRequestApproved | The event will be triggered when a join request has been approved by lobby owner. |
| OnLobbyJoinRequestRejected | The event will be triggered when a join request has been reject by lobby owner. |
| OnLobbyGlobalCustomDataUpdated | The event will be triggered when lobby global custom data updated. |
| OnLobbyPlayerCustomDataUpdated | The event will be triggered when lobby player custom data updated. |
API Details
CreateLobby
Create a new lobby
/**
* Create a new lobby
*
* @param Params The information needed to create the lobby.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void CreateLobby(
const FPgosClientCreateLobbyParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientCreateLobbyParams& | The information needed to create the lobby. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
GetLobbyDetailInfo
Get detail information of a lobby
/**
* Get detail information of a lobby
*
* @param LobbyId The lobby id to query.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetLobbyDetailInfo(
const FString& LobbyId,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| LobbyId | const FString& | The lobby id to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
GetLobbyBriefInfo
Get brief information of a lobby
/**
* Get brief information of a lobby
*
* @param LobbyId The lobby id to query.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetLobbyBriefInfo(
const FString& LobbyId,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyBriefInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| LobbyId | const FString& | The lobby id to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyBriefInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
BatchGetLobbyBriefInfo
Get brief information of lobby in batch (max 100 lobbies)
/**
* Get brief information of lobby in batch (max 100 lobbies)
*
* @param LobbyIds List of lobby id to query.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void BatchGetLobbyBriefInfo(
const TArray<FString>& LobbyIds,
TFunction<void(const FPgosResult& Ret, const TArray<FPgosClientLobbyBriefInfo>* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| LobbyIds | const TArray<FString>& | List of lobby id to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const TArray<FPgosClientLobbyBriefInfo>* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
EditLobbyInfo
Edit detail information of a lobby, only available for lobby owner
/**
* Edit detail information of a lobby, only available for lobby owner
*
* @param Params The lobby information that needs to be updated. these data will overwrite the previous data.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void EditLobbyInfo(
const FPgosClientEditLobbyInfoParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientEditLobbyInfoParams& | The lobby information that needs to be updated. these data will overwrite the previous data. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
SearchLobby
Search the lobby list @param params The optional filter information when searching the lobby list. Note: If these data are not filled (lobby_id, lobby_config, status, protection), all existing lobbies will be returned.
/**
* Search the lobby list
* @param params The optional filter information when searching the lobby list.
*
* Note: If these data are not filled (lobby_id, lobby_config, status, protection),
* all existing lobbies will be returned.
*
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SearchLobby(
const FPgosClientSearchLobbyParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientSearchLobbyResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSearchLobbyParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientSearchLobbyResult* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
JoinLobby
Join the specified lobby
/**
* Join the specified lobby
*
* @param Params The information needed when join the lobby
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void JoinLobby(
const FPgosClientJoinLobbyParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientJoinLobbyParams& | The information needed when join the lobby |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
QuickJoinLobby
PGOS will attempt to place the player into a lobby instance that meets the lobby global kv data data filtering conditions, note that this operation does not guarantee success. Only Lobby instances with 1) status as Waiting, 2) LobbyPrivacy as Visible, and 3) LobbyProtection as FreeAccess can be quickly joined.
/**
* PGOS will attempt to place the player into a lobby instance that meets the lobby global kv data data filtering conditions, note that this operation does not guarantee success.
* Only Lobby instances with 1) status as Waiting, 2) LobbyPrivacy as Visible, and 3) LobbyProtection as FreeAccess can be quickly joined.
*
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void QuickJoinLobby(
const FPgosClientQuickJoinLobbyParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientQuickJoinLobbyParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
JoinLobbyWithGroups
Join the specified group in the specified lobby. Try to join the specified groups in the lobby according to the specified priority value from small to large. Slot selection within the group follows the Team Selection Strategy configuration on the portal. The portal's lobby configuration needs to be switched to advanced mode.
/**
* Join the specified group in the specified lobby. Try to join the specified groups in the lobby according to the specified priority value from small to large.
* Slot selection within the group follows the Team Selection Strategy configuration on the portal.
* The portal's lobby configuration needs to be switched to advanced mode.
*
* @param Params The information needed when join the lobby.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void JoinLobbyWithGroups(
const FPgosClientJoinLobbyWithGroupsParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientJoinLobbyWithGroupsParams& | The information needed when join the lobby. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
JoinLobbyWithTeams
Join the specified team in the specified lobby. Try to join the specified teams in the lobby according to the specified priority value from small to large. When multiple teams have the same priority, slot selection follows the Team Selection Strategy configuration on the portal. The portal's lobby configuration needs to be switched to advanced mode.
/**
* Join the specified team in the specified lobby. Try to join the specified teams in the lobby according to the specified priority value from small to large.
* When multiple teams have the same priority, slot selection follows the Team Selection Strategy configuration on the portal.
* The portal's lobby configuration needs to be switched to advanced mode.
*
* @param Params The information needed when join the lobby.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void JoinLobbyWithTeams(
const FPgosClientJoinLobbyWithTeamsParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientJoinLobbyWithTeamsParams& | The information needed when join the lobby. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
LeaveLobby
Leave current lobby
/**
* Leave current lobby
*
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void LeaveLobby(
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ResultCallback | TFunction<void(const FPgosResult& Ret)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
DismissLobby
Dismiss current lobby, only available for lobby owner
/**
* Dismiss current lobby, only available for lobby owner
*
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void DismissLobby(
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ResultCallback | TFunction<void(const FPgosResult& Ret)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
KickOutMember
Kick out a lobby member, only available for lobby owner
/**
* Kick out a lobby member, only available for lobby owner
*
* @param MemberPlayerId The player id of the lobby member.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void KickOutMember(
const FString& MemberPlayerId,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| MemberPlayerId | const FString& | The player id of the lobby member. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
InvitePlayer
Invite a player to current lobby
/**
* Invite a player to current lobby
*
* @param PlayerId The invited player id.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void InvitePlayer(
const FString& PlayerId,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | The invited player id. |
| ResultCallback | TFunction<void(const FPgosResult& Ret)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
SwitchTeamSlot
Switch to another slot. The operation will be failed if the target slot is already occupied Note that the team slot index starts form 1.
/**
* Switch to another slot. The operation will be failed if the target slot is already occupied
* Note that the team slot index starts form 1.
*
* @param TargeteamName The name of team to switch to.
* @param TargeteamSlot The slot of team to switch to.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SwitchTeamSlot(
const FString& TargeteamName,
int32 TargeteamSlot,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| TargeteamName | const FString& | The name of team to switch to. |
| TargeteamSlot | int32 | The slot of team to switch to. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
RequestSwitchTeamSlot
Switch team slot with another lobby member. The operation will be failed if the target slot is empty. Note that the team slot index starts form 1.
/**
* Switch team slot with another lobby member. The operation will be failed if the target slot is empty.
* Note that the team slot index starts form 1.
*
* @param TargeteamName The name of team to switch to.
* @param TargeteamSlot The slot index of team to switch to.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void RequestSwitchTeamSlot(
const FString& TargeteamName,
int32 TargeteamSlot,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| TargeteamName | const FString& | The name of team to switch to. |
| TargeteamSlot | int32 | The slot index of team to switch to. |
| ResultCallback | TFunction<void(const FPgosResult& Ret)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
ConfirmSwitchTeamSlot
Agree to swap slots with a lobby member at the specified position. The interface will return a failure if the position of either party in the swap request changes.
/**
* Agree to swap slots with a lobby member at the specified position.
* The interface will return a failure if the position of either party in the swap request changes.
*
* @param RequestId Team slot switch request id.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void ConfirmSwitchTeamSlot(
const FString& RequestId,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| RequestId | const FString& | Team slot switch request id. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
RejectSwitchTeamSlot
Reject a team slot switch request.
/**
* Reject a team slot switch request.
*
* @param RequestId Team slot switch request id.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void RejectSwitchTeamSlot(
const FString& RequestId,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| RequestId | const FString& | Team slot switch request id. |
| ResultCallback | TFunction<void(const FPgosResult& Ret)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
TransferOwnership
Transfer the ownership of a lobby to another member, only available for lobby owner
/**
* Transfer the ownership of a lobby to another member, only available for lobby owner
*
* @param NewOwnerPlayerId The target player id.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void TransferOwnership(
const FString& NewOwnerPlayerId,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| NewOwnerPlayerId | const FString& | The target player id. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
SetLobbyData
Update lobby data, only available for lobby owner
Deprecated, use SetLobbyGlobalData instead.
/**
* Update lobby data, only available for lobby owner
* [DEPRECATED!!!] SetLobbyData was declared deprecated, consider using SetLobbyGlobalData instead.
*
* @param KvData Lobby data.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetLobbyData(
const TMap<FString, FString>& KvData,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| KvData | const TMap<FString, FString>& | Lobby data. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
SetLobbyGlobalData
Update lobby global data, only available for lobby owner
/**
* Update lobby global data, only available for lobby owner
*
* @param LobbyGlobalData Lobby global data. Each key-value pair is a string. Special note: When using this parameter to filter room instances (such as in the SearchLobby/QuickJoin interfaces), PGOS supports parsing special string values as lists to enable more complex set-based filtering operations. The string value formats that can be parsed as lists include: [a, b, c] / ["a", "b", "c"] (where the double quotes will be automatically stripped).
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetLobbyGlobalData(
const TMap<FString, FString>& LobbyGlobalData,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| LobbyGlobalData | const TMap<FString, FString>& | Lobby global data. Each key-value pair is a string. Special note: When using this parameter to filter room instances (such as in the SearchLobby/QuickJoin interfaces), PGOS supports parsing special string values as lists to enable more complex set-based filtering operations. The string value formats that can be parsed as lists include: [a, b, c] / ["a", "b", "c"] (where the double quotes will be automatically stripped). |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
SetLobbyPlayerData
Update player lobby data, lobby members can only modify their own custom data.
/**
* Update player lobby data, lobby members can only modify their own custom data.
*
* @param LobbyPlayerData Lobby player data.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetLobbyPlayerData(
const FString& LobbyPlayerData,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| LobbyPlayerData | const FString& | Lobby player data. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
StartBattle
Try to start a battle that contains all lobby members, only available for lobby owner
/**
* Try to start a battle that contains all lobby members, only available for lobby owner
*
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void StartBattle(
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
ReadyForBattle
Switch the READY flag of current lobby member
/**
* Switch the READY flag of current lobby member
*
* @param Ready The READY flag.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void ReadyForBattle(
bool Ready,
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Ready | bool | The READY flag. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
GetCurrentLobbyDetail
Get latest lobby detail information from SDK local cache
/**
* Get latest lobby detail information from SDK local cache
*
* @param Dst The latest lobby detail information
* @return false if not in a lobby, or don't get the detail information of the current lobby
*/
bool GetCurrentLobbyDetail(
FPgosClientLobbyDetailInfo& Dst) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Dst | FPgosClientLobbyDetailInfo& | The latest lobby detail information |
Return: bool
false if not in a lobby, or don't get the detail information of the current lobby
SendLobbyChatTextMsg
Send a message to the lobby's chat channel. Only enable_chatting in CreateLobbyParams is True when the lobby was created
/**
* Send a message to the lobby's chat channel.
* Only enable_chatting in CreateLobbyParams is True when the lobby was created
*
* @param Params Request struct for sending lobby chat message
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendLobbyChatTextMsg(
const FPgosClientSendLobbyChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientChatMsgInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSendLobbyChatMsgParams& | Request struct for sending lobby chat message |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientChatMsgInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
SendLobbyChatCustomMsg
Send a message to the lobby's chat channel. Only enable_chatting in CreateLobbyParams is True when the lobby was created
/**
* Send a message to the lobby's chat channel.
* Only enable_chatting in CreateLobbyParams is True when the lobby was created
*
* @param Params Request struct for sending lobby chat message
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SendLobbyChatCustomMsg(
const FPgosClientSendLobbyChatMsgParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientChatMsgInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSendLobbyChatMsgParams& | Request struct for sending lobby chat message |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientChatMsgInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
ApproveJoinLobbyRequest
Approve a lobby join request. The interface is for lobby owner use only. Each request is valid for 10 minutes.
/**
* Approve a lobby join request.
* The interface is for lobby owner use only. Each request is valid for 10 minutes.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void ApproveJoinLobbyRequest(
const FPgosClientApproveJoinLobbyRequestParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientApproveJoinLobbyRequestParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
RejectJoinLobbyRequest
Approve a lobby join request. The interface is for lobby owner use only. Each request is valid for 10 minutes.
/**
* Approve a lobby join request.
* The interface is for lobby owner use only. Each request is valid for 10 minutes.
*
* @param Params
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void RejectJoinLobbyRequest(
const FPgosClientRejectJoinLobbyRequestParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientRejectJoinLobbyRequestParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
GetPlayerLobbyInfo
Get the player's current lobby information from server.
/**
* Get the player's current lobby information from server.
*
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetPlayerLobbyInfo(
TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientLobbyDetailInfo* Data)> | The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject. |
Return: void
Event Details
OnLobbyMemberJoined
The event will be triggered when someone joined current lobby.
/**
* OnLobbyMemberJoined:
* The event will be triggered when someone joined current lobby.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyMemberJoined, const FPgosClientLobbyMemberJoinedEvt& /*Event*/);
FOnLobbyMemberJoined& OnLobbyMemberJoined() { return LobbyMemberJoinedDelegate; }
Type Reference:
OnLobbyMemberLeft
The event will be triggered when someone left current lobby.
/**
* OnLobbyMemberLeft:
* The event will be triggered when someone left current lobby.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyMemberLeft, const FPgosClientLobbyMemberLeftEvt& /*Event*/);
FOnLobbyMemberLeft& OnLobbyMemberLeft() { return LobbyMemberLeftDelegate; }
Type Reference:
OnLobbyTeamUpdated
The event will be triggered when team struct of current lobby changed.
/**
* OnLobbyTeamUpdated:
* The event will be triggered when team struct of current lobby changed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyTeamUpdated, const FPgosClientLobbyTeamUpdatedEvt& /*Event*/);
FOnLobbyTeamUpdated& OnLobbyTeamUpdated() { return LobbyTeamUpdatedDelegate; }
Type Reference:
OnLobbyInvitation
The event will be triggered when receive lobby invitations.
/**
* OnLobbyInvitation:
* The event will be triggered when receive lobby invitations.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyInvitation, const FPgosClientLobbyInvitationEvt& /*Event*/);
FOnLobbyInvitation& OnLobbyInvitation() { return LobbyInvitationDelegate; }
Type Reference:
OnLobbyDismiss
The event will be triggered when current lobby is dismissed.
/**
* OnLobbyDismiss:
* The event will be triggered when current lobby is dismissed.
*/
DECLARE_MULTICAST_DELEGATE(FOnLobbyDismiss);
FOnLobbyDismiss& OnLobbyDismiss() { return LobbyDismissDelegate; }
Type Reference:
OnLobbyOwnerTransferred
The event will be triggered when lobby ownership is transferred.
/**
* OnLobbyOwnerTransferred:
* The event will be triggered when lobby ownership is transferred.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyOwnerTransferred, const FPgosClientLobbyOwnerTransferredEvt& /*Event*/);
FOnLobbyOwnerTransferred& OnLobbyOwnerTransferred() { return LobbyOwnerTransferredDelegate; }
Type Reference:
OnLobbyInfoUpdated
The event will be triggered when current lobby options is changed.
/**
* OnLobbyInfoUpdated:
* The event will be triggered when current lobby options is changed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyInfoUpdated, const FPgosClientLobbyInfoUpdatedEvt& /*Event*/);
FOnLobbyInfoUpdated& OnLobbyInfoUpdated() { return LobbyInfoUpdatedDelegate; }
Type Reference:
OnLobbyDataUpdated
The event will be triggered when custom lobby data is changed.
/**
* OnLobbyDataUpdated:
* The event will be triggered when custom lobby data is changed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyDataUpdated, const FPgosClientLobbyDataUpdatedEvt& /*Event*/);
FOnLobbyDataUpdated& OnLobbyDataUpdated() { return LobbyDataUpdatedDelegate; }
Type Reference:
OnLobbyStatusChanged
The event will be triggered when current lobby's status changed.
/**
* OnLobbyStatusChanged:
* The event will be triggered when current lobby's status changed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyStatusChanged, const FPgosClientLobbyStatusChangedEvt& /*Event*/);
FOnLobbyStatusChanged& OnLobbyStatusChanged() { return LobbyStatusChangedDelegate; }
Type Reference:
OnBattleSessionUpdated
The event will be triggered when the battle session started by current lobby has updated.
/**
* OnBattleSessionUpdated:
* The event will be triggered when the battle session started by current lobby has updated.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnBattleSessionUpdated, const FPgosClientBattleSessionUpdatedEvt& /*Event*/);
FOnBattleSessionUpdated& OnBattleSessionUpdated() { return BattleSessionUpdatedDelegate; }
Type Reference:
OnReceiveLobbyChatMsg
The event will be triggered when receive chat messages from current lobby's chat channel.
/**
* OnReceiveLobbyChatMsg:
* The event will be triggered when receive chat messages from current lobby's chat channel.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnReceiveLobbyChatMsg, const FPgosClientReceiveLobbyChatMsgEvt& /*Event*/);
FOnReceiveLobbyChatMsg& OnReceiveLobbyChatMsg() { return ReceiveLobbyChatMsgDelegate; }
Type Reference:
OnLobbySwitchTeamSlotRequest
The event will be triggered when another lobby member send a team-slot switch request.
/**
* OnLobbySwitchTeamSlotRequest:
* The event will be triggered when another lobby member send a team-slot switch request.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbySwitchTeamSlotRequest, const FPgosClientLobbySwitchTeamSlotRequestEvt& /*Event*/);
FOnLobbySwitchTeamSlotRequest& OnLobbySwitchTeamSlotRequest() { return LobbySwitchTeamSlotRequestDelegate; }
Type Reference:
OnLobbySwitchTeamSlotRequestConfirmed
The event will be triggered when a switch request when a team-slot switch request has been confirmed.
/**
* OnLobbySwitchTeamSlotRequestConfirmed:
* The event will be triggered when a switch request when a team-slot switch request has been confirmed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbySwitchTeamSlotRequestConfirmed, const FPgosClientLobbySwitchTeamSlotRequestConfirmedEvt& /*Event*/);
FOnLobbySwitchTeamSlotRequestConfirmed& OnLobbySwitchTeamSlotRequestConfirmed() { return LobbySwitchTeamSlotRequestConfirmedDelegate; }
Type Reference:
OnLobbySwitchTeamSlotRequestRejected
The event will be triggered when a team-slot switch request has been rejected.
/**
* OnLobbySwitchTeamSlotRequestRejected:
* The event will be triggered when a team-slot switch request has been rejected.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbySwitchTeamSlotRequestRejected, const FPgosClientLobbySwitchTeamSlotRequestRejectedEvt& /*Event*/);
FOnLobbySwitchTeamSlotRequestRejected& OnLobbySwitchTeamSlotRequestRejected() { return LobbySwitchTeamSlotRequestRejectedDelegate; }
Type Reference:
OnLobbyJoinRequest
The event will be triggered when a player request to join a lobby with protection type LobbyProtection::ApplicationNeeded.
/**
* OnLobbyJoinRequest:
* The event will be triggered when a player request to join a lobby with protection type LobbyProtection::ApplicationNeeded.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyJoinRequest, const FPgosClientLobbyJoinRequestEvt& /*Event*/);
FOnLobbyJoinRequest& OnLobbyJoinRequest() { return LobbyJoinRequestDelegate; }
Type Reference:
OnLobbyJoinRequestApproved
The event will be triggered when a join request has been approved by lobby owner.
/**
* OnLobbyJoinRequestApproved:
* The event will be triggered when a join request has been approved by lobby owner.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyJoinRequestApproved, const FPgosClientLobbyJoinRequestApprovedEvt& /*Event*/);
FOnLobbyJoinRequestApproved& OnLobbyJoinRequestApproved() { return LobbyJoinRequestApprovedDelegate; }
Type Reference:
OnLobbyJoinRequestRejected
The event will be triggered when a join request has been reject by lobby owner.
/**
* OnLobbyJoinRequestRejected:
* The event will be triggered when a join request has been reject by lobby owner.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyJoinRequestRejected, const FPgosClientLobbyJoinRequestRejectedEvt& /*Event*/);
FOnLobbyJoinRequestRejected& OnLobbyJoinRequestRejected() { return LobbyJoinRequestRejectedDelegate; }
Type Reference:
OnLobbyGlobalCustomDataUpdated
The event will be triggered when lobby global custom data updated.
/**
* OnLobbyGlobalCustomDataUpdated:
* The event will be triggered when lobby global custom data updated.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyGlobalCustomDataUpdated, const FPgosClientLobbyGlobalCustomDataUpdatedEvt& /*Event*/);
FOnLobbyGlobalCustomDataUpdated& OnLobbyGlobalCustomDataUpdated() { return LobbyGlobalCustomDataUpdatedDelegate; }
Type Reference:
OnLobbyPlayerCustomDataUpdated
The event will be triggered when lobby player custom data updated.
/**
* OnLobbyPlayerCustomDataUpdated:
* The event will be triggered when lobby player custom data updated.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLobbyPlayerCustomDataUpdated, const FPgosClientLobbyPlayerCustomDataUpdatedEvt& /*Event*/);
FOnLobbyPlayerCustomDataUpdated& OnLobbyPlayerCustomDataUpdated() { return LobbyPlayerCustomDataUpdatedDelegate; }
Type Reference: