Client World API Reference
World is an entity that players can move in and out of freely and smoothly. PGOS divides players who enter the world into several world buckets based on the world filter. PGOS will allocate players from the world bucket to multiple battle sessions based on factors such as player count, player latency, and the configured capacity of battle sessions in the world.
API List
| API | Description |
|---|---|
| JoinWorld | Request to join a world. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected. |
| InviteJoinWorld | Invite other players to join a world together. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected. |
| LeaveWorld | Request to leave a world |
| InviteLeaveWorld | Invite other players to leave a world together. |
| JoinWorldBattleSession | Request to join a world battle session directly. The API will return failure when there are not enough slots left in the battle session. The API will return failure when the battle session is locked. |
| InviteJoinWorldBattleSession | Invite other players to join a world battle session directly together. The API will return failure when there are not enough slots left in the battle session. The API will return failure when the battle session is locked. |
| AcceptJoinWorldInvitation | Accept the join world invitation when receive the 'OnJoinWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected. |
| RejectJoinWorldInvitation | Reject the join world invitation when receive the 'OnJoinWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision. |
| AcceptLeaveWorldInvitation | Accept the leave world invitation when receive the 'OnLeaveWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision. |
| RejectLeaveWorldInvitation | Reject the join world invitation when receive the 'OnLeaveWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision. |
| QueryMyWorldBattleSessions | Specify the world config names to query if the current player has joined them. Corresponding battle session id will be returned for the worlds in which the player has joined. |
| QueryPlayerWorldBattleSessions | Specify the world config names to query if a player has joined them. Corresponding battle session id will be returned for the worlds in which the player has joined. |
| QueryJoinWorldInvitation | Query the detail information of the join world invitation for the specified invitation ticket. |
Event List
| Event | Description |
|---|---|
| OnWorldBattleSessionUpdated | The event will be triggered when battle session status changed. |
| OnWorldBattlePropertiesUpdated | The event will be triggered when battle properties updated. |
| OnJoinWorldInvitationUpdated | The event is triggered when someone invites you to join a world or the invitation info has been updated. |
| OnLeaveWorldInvitationUpdated | The event is triggered when someone invites you to leave a world or the invitation info has been updated. |
API Details
JoinWorld
Request to join a world. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected.
/**
* Request to join a world.
* Tips: In order to enhance the reliability of the service event reception, after calling this API,
* the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period.
* This ensures that the service continues to function even when the persistent connection is disconnected.
*
* @param Params Request struct for join a world.
* @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 JoinWorld(
const FPgosClientJoinWorldParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientJoinWorldResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientJoinWorldParams& | Request struct for join a world. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientJoinWorldResult* 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
InviteJoinWorld
Invite other players to join a world together. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected.
/**
* Invite other players to join a world together.
* Tips: In order to enhance the reliability of the service event reception, after calling this API,
* the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period.
* This ensures that the service continues to function even when the persistent connection is disconnected.
*
* @param Params Request struct for inviting other players to join a world together.
* @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 InviteJoinWorld(
const FPgosClientInviteJoinWorldParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientInviteJoinWorldResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientInviteJoinWorldParams& | Request struct for inviting other players to join a world together. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientInviteJoinWorldResult* 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
LeaveWorld
Request to leave a world
/**
* Request to leave a world
*
* @param Params Request struct for leave a world.
* @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 LeaveWorld(
const FPgosClientLeaveWorldParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientLeaveWorldParams& | Request struct for leave a world. |
| 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
InviteLeaveWorld
Invite other players to leave a world together.
/**
* Invite other players to leave a world together.
*
* @param Params Request struct for inviting other players to leave a world together.
* @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 InviteLeaveWorld(
const FPgosClientInviteLeaveWorldParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientInviteLeaveWorldResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientInviteLeaveWorldParams& | Request struct for inviting other players to leave a world together. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientInviteLeaveWorldResult* 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
JoinWorldBattleSession
Request to join a world battle session directly. The API will return failure when there are not enough slots left in the battle session. The API will return failure when the battle session is locked.
/**
* Request to join a world battle session directly.
* The API will return failure when there are not enough slots left in the battle session.
* The API will return failure when the battle session is locked.
*
* @param Params Request struct for join a world battle session.
* @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 JoinWorldBattleSession(
const FPgosClientJoinWorldBattleSessionParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientJoinWorldBattleSessionResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientJoinWorldBattleSessionParams& | Request struct for join a world battle session. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientJoinWorldBattleSessionResult* 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
InviteJoinWorldBattleSession
Invite other players to join a world battle session directly together. The API will return failure when there are not enough slots left in the battle session. The API will return failure when the battle session is locked.
/**
* Invite other players to join a world battle session directly together.
* The API will return failure when there are not enough slots left in the battle session.
* The API will return failure when the battle session is locked.
*
* @param Params Request struct for inviting other players to join a world battle session.
* @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 InviteJoinWorldBattleSession(
const FPgosClientInviteJoinWorldBattleSessionParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientInviteJoinWorldBattleSessionResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientInviteJoinWorldBattleSessionParams& | Request struct for inviting other players to join a world battle session. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientInviteJoinWorldBattleSessionResult* 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
AcceptJoinWorldInvitation
Accept the join world invitation when receive the 'OnJoinWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision. Tips: In order to enhance the reliability of the service event reception, after calling this API, the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period. This ensures that the service continues to function even when the persistent connection is disconnected.
/**
* Accept the join world invitation when receive the 'OnJoinWorldInvitationUpdated' event.
* Note: Once you have made your choice, you cannot change your decision.
* Tips: In order to enhance the reliability of the service event reception, after calling this API,
* the SDK will automatically invoke relevant APIs to poll the event status from the backend within a certain time period.
* This ensures that the service continues to function even when the persistent connection is disconnected.
*
* @param Params Request params for accept the join world invitation.
* @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 AcceptJoinWorldInvitation(
const FPgosClientAcceptJoinWorldInvitationParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientAcceptJoinWorldInvitationParams& | Request params for accept the join world invitation. |
| 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
RejectJoinWorldInvitation
Reject the join world invitation when receive the 'OnJoinWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision.
/**
* Reject the join world invitation when receive the 'OnJoinWorldInvitationUpdated' event.
* Note: Once you have made your choice, you cannot change your decision.
*
* @param Params Request params for reject the join world invitation.
* @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 RejectJoinWorldInvitation(
const FPgosClientRejectJoinWorldInvitationParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientRejectJoinWorldInvitationParams& | Request params for reject the join world invitation. |
| 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
AcceptLeaveWorldInvitation
Accept the leave world invitation when receive the 'OnLeaveWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision.
/**
* Accept the leave world invitation when receive the 'OnLeaveWorldInvitationUpdated' event.
* Note: Once you have made your choice, you cannot change your decision.
*
* @param Params Request params for accept the leave world invitation.
* @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 AcceptLeaveWorldInvitation(
const FPgosClientAcceptLeaveWorldInvitationParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientAcceptLeaveWorldInvitationParams& | Request params for accept the leave world invitation. |
| 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
RejectLeaveWorldInvitation
Reject the join world invitation when receive the 'OnLeaveWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision.
/**
* Reject the join world invitation when receive the 'OnLeaveWorldInvitationUpdated' event.
* Note: Once you have made your choice, you cannot change your decision.
*
* @param Params Request params for reject the leave world invitation.
* @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 RejectLeaveWorldInvitation(
const FPgosClientRejectLeaveWorldInvitationParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientRejectLeaveWorldInvitationParams& | Request params for reject the leave world invitation. |
| 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
QueryMyWorldBattleSessions
Specify the world config names to query if the current player has joined them. Corresponding battle session id will be returned for the worlds in which the player has joined.
/**
* Specify the world config names to query if the current player has joined them.
* Corresponding battle session id will be returned for the worlds in which the player has 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 QueryMyWorldBattleSessions(
const FPgosClientQueryMyWorldBattleSessionsParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientQueryMyWorldBattleSessionsResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientQueryMyWorldBattleSessionsParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientQueryMyWorldBattleSessionsResult* 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
QueryPlayerWorldBattleSessions
Specify the world config names to query if a player has joined them. Corresponding battle session id will be returned for the worlds in which the player has joined.
/**
* Specify the world config names to query if a player has joined them.
* Corresponding battle session id will be returned for the worlds in which the player has 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 QueryPlayerWorldBattleSessions(
const FPgosClientQueryPlayerWorldBattleSessionsParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientQueryPlayerWorldBattleSessionsResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientQueryPlayerWorldBattleSessionsParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientQueryPlayerWorldBattleSessionsResult* 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
QueryJoinWorldInvitation
Query the detail information of the join world invitation for the specified invitation ticket.
/**
* Query the detail information of the join world invitation for the specified invitation ticket.
*
* @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 QueryJoinWorldInvitation(
const FPgosClientQueryJoinWorldInvitationParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientQueryJoinWorldInvitationResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientQueryJoinWorldInvitationParams& | |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientQueryJoinWorldInvitationResult* 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
OnWorldBattleSessionUpdated
The event will be triggered when battle session status changed.
/**
* OnWorldBattleSessionUpdated:
* The event will be triggered when battle session status changed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnWorldBattleSessionUpdated, const FPgosClientWorldBattleSessionUpdatedEvt& /*Event*/);
FOnWorldBattleSessionUpdated& OnWorldBattleSessionUpdated() { return WorldBattleSessionUpdatedDelegate; }
Type Reference:
OnWorldBattlePropertiesUpdated
The event will be triggered when battle properties updated.
/**
* OnWorldBattlePropertiesUpdated:
* The event will be triggered when battle properties updated.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnWorldBattlePropertiesUpdated, const FPgosClientWorldBattlePropertiesUpdatedEvt& /*Event*/);
FOnWorldBattlePropertiesUpdated& OnWorldBattlePropertiesUpdated() { return WorldBattlePropertiesUpdatedDelegate; }
Type Reference:
OnJoinWorldInvitationUpdated
The event is triggered when someone invites you to join a world or the invitation info has been updated.
/**
* OnJoinWorldInvitationUpdated:
* The event is triggered when someone invites you to join a world or the invitation info has been updated.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnJoinWorldInvitationUpdated, const FPgosClientJoinWorldInvitationUpdatedEvt& /*Event*/);
FOnJoinWorldInvitationUpdated& OnJoinWorldInvitationUpdated() { return JoinWorldInvitationUpdatedDelegate; }
Type Reference:
OnLeaveWorldInvitationUpdated
The event is triggered when someone invites you to leave a world or the invitation info has been updated.
/**
* OnLeaveWorldInvitationUpdated:
* The event is triggered when someone invites you to leave a world or the invitation info has been updated.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnLeaveWorldInvitationUpdated, const FPgosClientLeaveWorldInvitationUpdatedEvt& /*Event*/);
FOnLeaveWorldInvitationUpdated& OnLeaveWorldInvitationUpdated() { return LeaveWorldInvitationUpdatedDelegate; }
Type Reference: