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.
/// <summary>
/// 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.
/// </summary>
/// <param name="pgos_params">Request struct for join a world.</param>
public void JoinWorld(JoinWorldParams pgos_params, WorldDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | JoinWorldParams | Request struct for join a world. |
| callback | WorldDelegate0 |
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.
/// <summary>
/// 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.
/// </summary>
/// <param name="pgos_params">Request struct for inviting other players to join a world together.</param>
public void InviteJoinWorld(InviteJoinWorldParams pgos_params, WorldDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | InviteJoinWorldParams | Request struct for inviting other players to join a world together. |
| callback | WorldDelegate1 |
Return: void
LeaveWorld
Request to leave a world
/// <summary>Request to leave a world</summary>
/// <param name="pgos_params">Request struct for leave a world.</param>
public void LeaveWorld(LeaveWorldParams pgos_params, WorldDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | LeaveWorldParams | Request struct for leave a world. |
| callback | WorldDelegate2 |
Return: void
InviteLeaveWorld
Invite other players to leave a world together.
/// <summary>Invite other players to leave a world together.</summary>
/// <param name="pgos_params">Request struct for inviting other players to leave a world together.</param>
public void InviteLeaveWorld(InviteLeaveWorldParams pgos_params, WorldDelegate3 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | InviteLeaveWorldParams | Request struct for inviting other players to leave a world together. |
| callback | WorldDelegate3 |
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.
/// <summary>
/// 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.
/// </summary>
/// <param name="pgos_params">Request struct for join a world battle session.</param>
public void JoinWorldBattleSession(JoinWorldBattleSessionParams pgos_params, WorldDelegate4 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | JoinWorldBattleSessionParams | Request struct for join a world battle session. |
| callback | WorldDelegate4 |
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.
/// <summary>
/// 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.
/// </summary>
/// <param name="pgos_params">Request struct for inviting other players to join a world battle session.</param>
public void InviteJoinWorldBattleSession(InviteJoinWorldBattleSessionParams pgos_params, WorldDelegate5 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | InviteJoinWorldBattleSessionParams | Request struct for inviting other players to join a world battle session. |
| callback | WorldDelegate5 |
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.
/// <summary>
/// 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.
/// </summary>
/// <param name="pgos_params">Request params for accept the join world invitation.</param>
public void AcceptJoinWorldInvitation(AcceptJoinWorldInvitationParams pgos_params, WorldDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | AcceptJoinWorldInvitationParams | Request params for accept the join world invitation. |
| callback | WorldDelegate2 |
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.
/// <summary>
/// Reject the join world invitation when receive the 'OnJoinWorldInvitationUpdated' event.
/// Note: Once you have made your choice, you cannot change your decision.
/// </summary>
/// <param name="pgos_params">Request params for reject the join world invitation.</param>
public void RejectJoinWorldInvitation(RejectJoinWorldInvitationParams pgos_params, WorldDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | RejectJoinWorldInvitationParams | Request params for reject the join world invitation. |
| callback | WorldDelegate2 |
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.
/// <summary>
/// Accept the leave world invitation when receive the 'OnLeaveWorldInvitationUpdated' event.
/// Note: Once you have made your choice, you cannot change your decision.
/// </summary>
/// <param name="pgos_params">Request params for accept the leave world invitation.</param>
public void AcceptLeaveWorldInvitation(AcceptLeaveWorldInvitationParams pgos_params, WorldDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | AcceptLeaveWorldInvitationParams | Request params for accept the leave world invitation. |
| callback | WorldDelegate2 |
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.
/// <summary>
/// Reject the join world invitation when receive the 'OnLeaveWorldInvitationUpdated' event.
/// Note: Once you have made your choice, you cannot change your decision.
/// </summary>
/// <param name="pgos_params">Request params for reject the leave world invitation.</param>
public void RejectLeaveWorldInvitation(RejectLeaveWorldInvitationParams pgos_params, WorldDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | RejectLeaveWorldInvitationParams | Request params for reject the leave world invitation. |
| callback | WorldDelegate2 |
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.
/// <summary>
/// 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.
/// </summary>
public void QueryMyWorldBattleSessions(QueryMyWorldBattleSessionsParams pgos_params, WorldDelegate6 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | QueryMyWorldBattleSessionsParams | |
| callback | WorldDelegate6 |
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.
/// <summary>
/// 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.
/// </summary>
public void QueryPlayerWorldBattleSessions(QueryPlayerWorldBattleSessionsParams pgos_params, WorldDelegate7 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | QueryPlayerWorldBattleSessionsParams | |
| callback | WorldDelegate7 |
Return: void
QueryJoinWorldInvitation
Query the detail information of the join world invitation for the specified invitation ticket.
/// <summary>Query the detail information of the join world invitation for the specified invitation ticket.</summary>
public void QueryJoinWorldInvitation(QueryJoinWorldInvitationParams pgos_params, WorldDelegate8 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | QueryJoinWorldInvitationParams | |
| callback | WorldDelegate8 |
Return: void
Event Details
OnWorldBattleSessionUpdated
The event will be triggered when battle session status changed.
/// <summary>The event will be triggered when battle session status changed.</summary>
public event WorldDelegate9 OnWorldBattleSessionUpdated;
Type Reference:
OnWorldBattlePropertiesUpdated
The event will be triggered when battle properties updated.
/// <summary>The event will be triggered when battle properties updated.</summary>
public event WorldDelegate10 OnWorldBattlePropertiesUpdated;
Type Reference:
OnJoinWorldInvitationUpdated
The event is triggered when someone invites you to join a world or the invitation info has been updated.
/// <summary>The event is triggered when someone invites you to join a world or the invitation info has been updated.</summary>
public event WorldDelegate11 OnJoinWorldInvitationUpdated;
Type Reference:
OnLeaveWorldInvitationUpdated
The event is triggered when someone invites you to leave a world or the invitation info has been updated.
/// <summary>The event is triggered when someone invites you to leave a world or the invitation info has been updated.</summary>
public event WorldDelegate12 OnLeaveWorldInvitationUpdated;
Type Reference:
All Delegates
public delegate void WorldDelegate0(PgosResult a0, JoinWorldResult a1);
public delegate void WorldDelegate1(PgosResult a0, InviteJoinWorldResult a1);
public delegate void WorldDelegate2(PgosResult a0);
public delegate void WorldDelegate3(PgosResult a0, InviteLeaveWorldResult a1);
public delegate void WorldDelegate4(PgosResult a0, JoinWorldBattleSessionResult a1);
public delegate void WorldDelegate5(PgosResult a0, InviteJoinWorldBattleSessionResult a1);
public delegate void WorldDelegate6(PgosResult a0, QueryMyWorldBattleSessionsResult a1);
public delegate void WorldDelegate7(PgosResult a0, QueryPlayerWorldBattleSessionsResult a1);
public delegate void WorldDelegate8(PgosResult a0, QueryJoinWorldInvitationResult a1);
public delegate void WorldDelegate9(WorldBattleSessionUpdatedEvt a0);
public delegate void WorldDelegate10(WorldBattlePropertiesUpdatedEvt a0);
public delegate void WorldDelegate11(JoinWorldInvitationUpdatedEvt a0);
public delegate void WorldDelegate12(LeaveWorldInvitationUpdatedEvt a0);
Type Reference:
- PgosResult
- JoinWorldResult
- InviteJoinWorldResult
- InviteLeaveWorldResult
- JoinWorldBattleSessionResult
- InviteJoinWorldBattleSessionResult
- QueryMyWorldBattleSessionsResult
- QueryPlayerWorldBattleSessionsResult
- QueryJoinWorldInvitationResult
- WorldBattleSessionUpdatedEvt
- WorldBattlePropertiesUpdatedEvt
- JoinWorldInvitationUpdatedEvt
- LeaveWorldInvitationUpdatedEvt