Skip to main content

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

APIDescription
JoinWorldRequest 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.
InviteJoinWorldInvite 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.
LeaveWorldRequest to leave a world
InviteLeaveWorldInvite other players to leave a world together.
JoinWorldBattleSessionRequest 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.
InviteJoinWorldBattleSessionInvite 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.
AcceptJoinWorldInvitationAccept 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.
RejectJoinWorldInvitationReject the join world invitation when receive the 'OnJoinWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision.
AcceptLeaveWorldInvitationAccept the leave world invitation when receive the 'OnLeaveWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision.
RejectLeaveWorldInvitationReject the join world invitation when receive the 'OnLeaveWorldInvitationUpdated' event. Note: Once you have made your choice, you cannot change your decision.
QueryMyWorldBattleSessionsSpecify 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.
QueryPlayerWorldBattleSessionsSpecify 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.
QueryJoinWorldInvitationQuery the detail information of the join world invitation for the specified invitation ticket.

Event List

EventDescription
OnWorldBattleSessionUpdatedThe event will be triggered when battle session status changed.
OnWorldBattlePropertiesUpdatedThe event will be triggered when battle properties updated.
OnJoinWorldInvitationUpdatedThe event is triggered when someone invites you to join a world or the invitation info has been updated.
OnLeaveWorldInvitationUpdatedThe 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:

ParamTypeDescription
Paramsconst FPgosClientJoinWorldParams&Request struct for join a world.
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientInviteJoinWorldParams&Request struct for inviting other players to join a world together.
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientLeaveWorldParams&Request struct for leave a world.
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientInviteLeaveWorldParams&Request struct for inviting other players to leave a world together.
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientJoinWorldBattleSessionParams&Request struct for join a world battle session.
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientInviteJoinWorldBattleSessionParams&Request struct for inviting other players to join a world battle session.
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientAcceptJoinWorldInvitationParams&Request params for accept the join world invitation.
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientRejectJoinWorldInvitationParams&Request params for reject the join world invitation.
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientAcceptLeaveWorldInvitationParams&Request params for accept the leave world invitation.
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientRejectLeaveWorldInvitationParams&Request params for reject the leave world invitation.
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientQueryMyWorldBattleSessionsParams&
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientQueryPlayerWorldBattleSessionsParams&
ResultCallbackTFunction<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:

ParamTypeDescription
Paramsconst FPgosClientQueryJoinWorldInvitationParams&
ResultCallbackTFunction<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: