跳到主要内容

Server Data Models

Enums

BackfillStrategy

The player filling strategy when backfilling.

// namespace: pgos::server
enum class BackfillStrategy : uint8_t
membervaluedescription
Dummy0
Custom1In this mode, the target player count of each team needs to be specified. However, the number of players per team must comply with the ruleset constraint.
MaxPossible2Backfill matchmaking will target max players as defined in ruleset and ignore expansions on player count.

BackfillStatus

Backfill matchmaking request status.

// namespace: pgos::server
enum class BackfillStatus : uint8_t
membervaluedescription
Dummy0No ongoing or ended backfill request.
Searching1Searching player to backfill with.
Paused2Means that the backfill is suspended, normally because the battle is full. If any player leaves the battle session after the backfill is paused, the backfill status will turn to searching again.
Canceled3The backfill request is canceled.
Completed4Means that the backfill reaches target and stopped, which only happens when using Custom strategy.
Error5Means that the backfill is terminated due to mathcmaking engine failure, submit bug to us when this happened.

CreationPolicy

The player battle session creation policy.

// namespace: pgos::server
enum class CreationPolicy : uint8_t
membervaluedescription
ALLOW_ALL0
DENY_ALL1

EctStatus

The status of ECT.

// namespace: pgos::server
enum class EctStatus : uint8_t
membervaluedescription
Uncompleted0The ECT is in an 'Uncompleted' state, indicating that it has not yet reached the 'Done', 'Canceled', or 'Expired' state. This status implies that the ECT is still in progress or has not been completed.
Done1The status of all the actions were updated to 'SUCCESS'; consequently, the ECT's status will become 'Done'
Canceled2The ECT is canceled.
Expired3The ECT is Expired.

EctActionStatus

The status of ECT action.

// namespace: pgos::server
enum class EctActionStatus : uint8_t
membervaluedescription
Init0The default action status when an ECT is created.
Success1The action is succeeded.
Failed2The action is failed.

PartyJoinStrategy

The strategy controls the rules who could join the party

// namespace: pgos::server
enum class PartyJoinStrategy : uint8_t
membervaluedescription
Public0Open to anyone, it's the default strategy
OnlyFriendsOfLeader1Only friends of the leader could join the party
OnlyFriendsOfMembers2Only friends of any member could join the party
OnlyInvited3Only invited players could join the party
NotAllowed4No one can join

PartyInviteStrategy

The strategy controls the rules who could invite others to the party

// namespace: pgos::server
enum class PartyInviteStrategy : uint8_t
membervaluedescription
AllMembersCanInvite0All members of the party can invite others, it's the default strategy
OnlyLeaderCanInvite1Only the party leader can invite others

Structs

WorldTeamInfo

Information of a team in a world battle session.

// namespace: pgos::server
struct WorldTeamInfo
fieldtypedescription
team_namepgos::pstringThe world team name
player_idspgos::pvector<pgos::pstring>Players of the world team
team_capacityuint32_tMax number of players in the world team

Balance

The currency in the player's wallet.

// namespace: pgos::server
struct Balance
fieldtypedescription
currency_codepgos::pstringThe code of the currency.
currency_namepgos::pstringThe name of the currency.
currency_iconpgos::pstringThe uri of the currency.
currency_typeCurrencyTypeCurrency type.
amountint64_tThe balance of the currency.
max_depositint64_tThe maximum balance that a player can hold for this currency. A value of 0 represents no limitation.

BatchGetPlayerInfoSvrRsp

Response that server batch getting playerInfo.

// namespace: pgos::server
struct BatchGetPlayerInfoSvrRsp
fieldtypedescription
datapgos::pmap<pgos::pstring, PlayerDetail>Player infos, key: player_id, value: player detail.
fail_playerspgos::pmap<pgos::pstring, pgos::pstring>Players who totally failed, key: player_id, value: failed reason.

BatchIncrOneOfPlayerKVDataRsp

The response that Performs atomic increment operation on a specific kvdata item for multiple players.

// namespace: pgos::server
struct BatchIncrOneOfPlayerKVDataRsp
fieldtypedescription
datapgos::pmap<pgos::pstring, OnePlayerKVData>data after the increment, key: player_id, value: the player's new kvdata value after the updated.
failed_playerspgos::pmap<pgos::pstring, PgosResult>Players who totally failed, key: player_id, value: failed reason.

KVDataGroupWithResult

A set of kvdata items.

// namespace: pgos::server
struct KVDataGroupWithResult
fieldtypedescription
resultPgosResultThe result corresponding to the data in the structure: If the result.err_code is 0 (success), then the operation for the player is successful and the kvdata is the latest data. If the result.err_code is 11108 (kBackendKVDataVersionMismatched (11108)), then the operation for the player is failed and the kvdata is the latest data, you may try again with the latest version. For other values of the result.err_code, the kvdata is invalid, you can check the result.msg for detail.
versionuint32_tThe player-wide version of the versioned kvdata
kvdatapgos::pmap<pgos::pstring, KVDataValue>KVData items, key: item key, value: item value.

BatchSetPlayerVersionedKVDataRsp

Response that updates versioned kvdata for multiple players.

// namespace: pgos::server
struct BatchSetPlayerVersionedKVDataRsp
fieldtypedescription
datapgos::pmap<pgos::pstring, KVDataGroupWithResult>Results and data for each player, key: player_id, value: kvdata with result.

BatchOpenIDToPlayerIDRsp

Response of transform playerIDs of PGOS to account openIDs of external platform.

// namespace: pgos::server
struct BatchOpenIDToPlayerIDRsp
fieldtypedescription
datapgos::pmap<pgos::pstring, pgos::pstring>Result of successful conversion, key: account openID, value: player id.
failspgos::pmap<pgos::pstring, pgos::pstring>Account openIDs who failed, key: account openID, value: failed reason.

BattleSession

A battle session corresponds a accessible battle

// namespace: pgos::server
struct BattleSession
fieldtypedescription
battle_session_idpgos::pstringThe battle session id to query
fleet_idpgos::pstringThe DS fleet that battle sessions located in
battle_source_dataBattleSourceDataCreation source data of a battle session, contains information about the source type of the battle and player information filled in by the battle creator.
battle_propertiespgos::pvector<BattleProperty>Custom K-V pairs of a battle session. Preset in matchmaking or world configuration of filled with lobby data
battle_session_datapgos::pstringCustom string data of a battle session. Preset in matchmaking or world configuration
portint32_tThe port of the DS holding the battle session.
ip_addresspgos::pstringThe IP address of the DS holding the battle session.
backfill_statusBackfillStatusBackfill request status.
bucket_pathpgos::pmap<pgos::pstring, pgos::pstring>Mapping from bucket filter attribute name to attribute value. [for WORLD battle session only]
source_typeBattleSourceTypeWhat service that the battle session generated from
configuration_namepgos::pstringConfiguration name of matchmaking, lobby or world service
max_playersint32_tMaximum number of players in the battle session If the source of the battle session is Matchmaking, the max_players is calculated from the teams section of ruleset script If the source of the game is Lobby, the max_players is calculated from the teams section of lobby config
max_teamsint32_tMaximum number of teams in the battle session Only filled when the battle session source type is BattleSourceType::World
total_playersint32_tTotal number of players in the battle session. Only players with a player battle session status of COMPLETED will be excluded
ruleset_namepgos::pstringRuleset name hit. Filled when battle session source type is BattleSourceType::Matchmaking
lockedboolTrue if the battle session is locked by game server A battle session generated from world service could be locked/unlocked by calling Lock/UnlockWorldBattleSession.
zonepgos::pstringZone where the battle session placed.
teamspgos::pmap<pgos::pstring, WorldTeamInfo>Teams info in a world battle session. Only filled when the battle session source type is BattleSourceType::World

PlayerBattleSession

A player-battle-session is a session between a player and a activated battle-session

// namespace: pgos::server
struct PlayerBattleSession
fieldtypedescription
player_battle_session_idpgos::pstringThe id of player session in the battle, !!! NOT BATTLE SESSION ID !!!
player_idpgos::pstringThe player id
battle_session_idpgos::pstringThe battle session id
statuspgos::pstringPENDING The player battle session requires DS to call the ReservePlayerBattleSession interface for approval. RESERVED Reserved players can be validated through the AcceptPlayerBattleSession interface. ACTIVE Player battle session status turn to ACTIVE after AcceptPlayerBattleSession is called successfully. COMPLETED This is the terminal status of player battle session. The status will turn to COMPLETED after RemovePlayerBattleSession is called or player actively leave the battle session.
payloadpgos::pstringPayload data set be game client when calling interface JoinWorldBattleSession.
created_timeint64_tThe Unix timestamp(in seconds) when the battle session was created.
team_namepgos::pstringTeam name in a world battle session.

PlayerBattleSessionParams

// namespace: pgos::server
struct PlayerBattleSessionParams
fieldtypedescription
battle_session_idpgos::pstringThe battle session in which the player is participating.
player_battle_session_idpgos::pstringThe session ID of the player within the battle session. Please note that this parameter is different from the battle session ID. PGOS assigns different player battle session IDs to players who join the same battle session multiple times.
player_idpgos::pstringPlayer ID.

DescribePlayerBattleSessionsParams

Request info to describe player battle sessions

// namespace: pgos::server
struct DescribePlayerBattleSessionsParams
fieldtypedescription
battle_session_idpgos::pstringThe battle session id to query
player_battle_session_idpgos::pstringThe id of player session in the battle, !!! NOT BATTLE SESSION ID !!!
offsetuint32_tThe next token
countuint32_tThe limit of the player battle sessions request

DescribePlayerBattleSessionsResult

Information about the players in the battle session.

// namespace: pgos::server
struct DescribePlayerBattleSessionsResult
fieldtypedescription
next_offsetuint32_tThe next offset.
has_moreboolIf has more players.
total_numuint32_tNone-completed players count in the battle session.
player_battle_sessionspgos::pvector<PlayerBattleSession>A list of player battle sessions. Empty if there's no more sessions.

GrantItem

// namespace: pgos::server
struct GrantItem
fieldtypedescription
item_idpgos::pstringThe id of the item will be granted.
amountuint32_tThe number of the item will be granted.
mutable_custom_datapgos::pmap<pgos::pstring, KVDataValue>The mutable kv data of the instance. The key must be prefixed with "int", "flt", or "str_", which respectively indicate that the value type is integer, float, or string. Max 32 keys, each key limited to 128 bytes and each value limited to 4096 bytes(in a narrow-character string).

BatchRevokeInstancesParams

Request struct for revoke instances.

// namespace: pgos::server
struct BatchRevokeInstancesParams : public BaseBackendEventParams

parent: BaseBackendEventParams

fieldtypedescription
player_idpgos::pstringThe player whose item instance will be revoked from inventory.
instance_idspgos::pvector<pgos::pstring>The item instance ids. Maximum array size: 99.

BatchRevokeInstancesResult

Request struct for batch revoke instances.

// namespace: pgos::server
struct BatchRevokeInstancesResult
fieldtypedescription
left_amountspgos::pmap<pgos::pstring, uint32_t>The number of instance remaining after this operation. key: item instance id, value: left amount.
failspgos::pmap<pgos::pstring, PgosResult>Item instances that failed to revoke. key: item instance id, value: failed reason.

GrantCurrency

// namespace: pgos::server
struct GrantCurrency
fieldtypedescription
currency_codepgos::pstringThe code of the currency will be granted.
amountuint32_tThe amount of the currency will be granted.

GrantItemToPlayerParams

Request struct for grant item to player.

// namespace: pgos::server
struct GrantItemToPlayerParams : public BaseBackendEventParams

parent: BaseBackendEventParams

fieldtypedescription
player_idpgos::pstringThe player id who will be granted items to.
itemspgos::pvector<GrantItem>The items will be granted.
idempotency_tokenpgos::pstring[Optional] Used to ensure the idempotence of the function. Idempotence means that regardless of how many times the function is called, the result remains the same. By passing a unique idempotency_token, it ensures that the function does not produce duplicate side effects or results when called repeatedly. Note: To avoid generating the same idempotency_token as other players, it is recommended to concatenate it with the player_id.
pay_platform_dataPayPlatformDataThe necessary information required by the payment platform, which must be filled out when granting items contents premium currency.

GrantItemResult

// namespace: pgos::server
struct GrantItemResult
fieldtypedescription
player_idpgos::pstringThe player id who has been successfully granted.
item_instsItemInstPackThe item instances that have been granted.
currenciespgos::pvector<Currency>The currencies that have been granted. (such as granting bundle that contains currencies)
conflict_unique_itemspgos::pvector<ConflictUniqueItem>Unique items that already in inventory cause failed to be granted.
failed_currenciespgos::pmap<pgos::pstring, pgos::pstring>Currencies that failed to grant. Mapping from currency code to failure reason.
replayedboolWhether the request is replayed. When it is True, it indicates that the result of the function is obtained by replaying with the same idempotency_token. This means that the result of the function has been generated in a previous call and is being reused in the current call.

GrantCurrencyToPlayerParams

Request struct for grant currency to player.

// namespace: pgos::server
struct GrantCurrencyToPlayerParams : public BaseBackendEventParams

parent: BaseBackendEventParams

fieldtypedescription
player_idpgos::pstringThe player id who will be granted currencies to.
currenciesGrantCurrencyThe currencies will be granted.
idempotency_tokenpgos::pstring[Optional] Used to ensure the idempotence of the function. Idempotence means that regardless of how many times the function is called, the result remains the same. By passing a unique idempotency_token, it ensures that the function does not produce duplicate side effects or results when called repeatedly. Note: To avoid generating the same idempotency_token as other players, it is recommended to concatenate it with the player_id.
pay_platform_dataPayPlatformDataThe necessary information required by the payment platform, which must be filled out when granting premium currency.

GrantCurrencyResult

// namespace: pgos::server
struct GrantCurrencyResult
fieldtypedescription
player_idpgos::pstringThe player id who have been successfully granted.
replayedboolWhether the request is replayed. When it is True, it indicates that the result of the function is obtained by replaying with the same idempotency_token. This means that the result of the function has been generated in a previous call and is being reused in the current call.

GetPlayerInventoryResult

// namespace: pgos::server
struct GetPlayerInventoryResult
fieldtypedescription
player_idpgos::pstringThe player id whose inventory will be queried.
item_instsItemInstPackThe item instances of the query instance ids.
failspgos::pmap<pgos::pstring, pgos::pstring>The instance ids which was failed to query.

GetPlayerInventoryWithFilterResult

// namespace: pgos::server
struct GetPlayerInventoryWithFilterResult
fieldtypedescription
player_idpgos::pstringThe player id whose inventory will be queried.
item_instsItemInstPackThe item instances of the query instance ids.

SetInstanceCustomDataParams

// namespace: pgos::server
struct SetInstanceCustomDataParams
fieldtypedescription
player_idpgos::pstringThe player whose item instance mutable_custom_data will be updated.
instance_idpgos::pstringThe item instance id.
update_datapgos::pmap<pgos::pstring, KVDataValue>Update the data of the specified keys in the mutable_custom_data. If the key does not exist, it indicates inserting new data.
delete_keyspgos::pvector<pgos::pstring>Delete the data of specified keys in the mutable_custom_data. The key from update_data cannot be included.

SetInstanceCustomDataResult

// namespace: pgos::server
struct SetInstanceCustomDataResult
fieldtypedescription
mutable_custom_datapgos::pmap<pgos::pstring, KVDataValue>Latest mutable_custom_data of item instance.
versionuint32_tLatest mutable_custom_data_version of item instance.

UpdatedInstanceCustomData

// namespace: pgos::server
struct UpdatedInstanceCustomData
fieldtypedescription
update_datapgos::pmap<pgos::pstring, KVDataValue>Update the data of the specified keys in the mutable_custom_data. If the key does not exist, it indicates inserting new data.
delete_keyspgos::pvector<pgos::pstring>Delete the data of specified keys in the mutable_custom_data. The key from update_data cannot be included.

BatchSetInstanceCustomDataParams

// namespace: pgos::server
struct BatchSetInstanceCustomDataParams
fieldtypedescription
player_idpgos::pstringThe player whose item instance mutable_custom_data will be updated.
datapgos::pmap<pgos::pstring, UpdatedInstanceCustomData>The item instances to be updated. key: item instance id, value: custom data to be updated. Maximum map entries: 99.

InstanceCustomData

// namespace: pgos::server
struct InstanceCustomData
fieldtypedescription
mutable_custom_datapgos::pmap<pgos::pstring, KVDataValue>Latest mutable_custom_data of item instance.
versionuint32_tLatest mutable_custom_data_version of item instance.

BatchSetInstanceCustomDataResult

// namespace: pgos::server
struct BatchSetInstanceCustomDataResult
fieldtypedescription
datapgos::pmap<pgos::pstring, InstanceCustomData>Latest mutable_custom_data of item instance. key: item instance id, value: latest custom data
failspgos::pmap<pgos::pstring, PgosResult>Item instances that failed to update. key: item instance id, value: failed reason.

SetInstanceCustomDataWithVersionParams

// namespace: pgos::server
struct SetInstanceCustomDataWithVersionParams : public SetInstanceCustomDataParams

parent: SetInstanceCustomDataParams

fieldtypedescription
versionuint32_tThe latest mutable_custom_data_version.

IncrInstanceCustomDataParams

// namespace: pgos::server
struct IncrInstanceCustomDataParams
fieldtypedescription
player_idpgos::pstringThe player id whose item instance mutable_custom_data will be updated.
instance_idpgos::pstringThe item instance id.
incrementspgos::pmap<pgos::pstring, KVDataValue>Increments to update, key: kvdata key, value: increment of the value.
idempotency_tokenpgos::pstring[Optional] Used to ensure the idempotence of the function. By passing a unique idempotency_token, it ensures that the function does not produce duplicate side effects or results when called repeatedly.

IncrInstanceCustomDataResult

// namespace: pgos::server
struct IncrInstanceCustomDataResult
fieldtypedescription
mutable_custom_datapgos::pmap<pgos::pstring, KVDataValue>Latest mutable_custom_data of item instance.
versionuint32_tLatest mutable_custom_data_version of item instance.
replayedboolWhether the request is replayed. When it is true, it indicates that the previously used idempotency_token was used, and the increment operation did not take effect. The result returns the latest mutable_custom_data and mutable_custom_data_version of the instance.

SetInstanceTagsParams

// namespace: pgos::server
struct SetInstanceTagsParams
fieldtypedescription
player_idpgos::pstringThe player id whose item instance tags will be updated.
instance_idpgos::pstringThe item instance id.
update_datapgos::pmap<pgos::pstring, pgos::pstring>Update the data of the specified keys in the tags. If the key does not exist, it indicates inserting new data.
delete_keyspgos::pvector<pgos::pstring>Delete the data of specified keys in the tags. The key from update_data cannot be included.

SetInstanceTagsResult

// namespace: pgos::server
struct SetInstanceTagsResult
fieldtypedescription
tagspgos::pmap<pgos::pstring, pgos::pstring>Latest tags of item instance.

UpdatedInstanceTags

// namespace: pgos::server
struct UpdatedInstanceTags
fieldtypedescription
update_datapgos::pmap<pgos::pstring, pgos::pstring>Update the data of the specified keys in the tags. If the key does not exist, it indicates inserting new data.
delete_keyspgos::pvector<pgos::pstring>Delete the data of specified keys in the tags. The key from update_data cannot be included.

BatchSetInstanceTagsParams

// namespace: pgos::server
struct BatchSetInstanceTagsParams
fieldtypedescription
player_idpgos::pstringThe player id whose item instance tags will be updated.
datapgos::pmap<pgos::pstring, UpdatedInstanceTags>The item instances to be updated. key: item instance id, value: tags to be updated. Maximum map entries: 99.

InstanceTags

// namespace: pgos::server
struct InstanceTags
fieldtypedescription
tagspgos::pmap<pgos::pstring, pgos::pstring>Latest tags of item instance.

BatchSetInstanceTagsResult

// namespace: pgos::server
struct BatchSetInstanceTagsResult
fieldtypedescription
datapgos::pmap<pgos::pstring, InstanceTags>Latest tags of item instance.
failspgos::pmap<pgos::pstring, PgosResult>Item instances that failed to update. key: item instance id, value: failed reason.

DelBattleDataRsp

Response that delete battle data.

// namespace: pgos::server
struct DelBattleDataRsp
fieldtypedescription
failspgos::pmap<pgos::pstring, pgos::pstring>Keys failed to delete, key: battle data keys, value: failed reason.

StartBackfillParams

// namespace: pgos::server
struct StartBackfillParams
fieldtypedescription
battle_session_idpgos::pstringBattle session to be backfilled.
backfill_strategyBackfillStrategyThe player filling strategy when backfilling.
custom_team_mappgos::pmap<pgos::pstring, uint32_t>The target player count of each team.

CancelBackfillResult

Cancel a backfill matchmaking request

// namespace: pgos::server
struct CancelBackfillResult
fieldtypedescription
canceledboolWhether the player has canceled the backfill matchmaking request

BattlePlayerOfflineEvt

The event will be triggered when the player in the battle-session is offline.

// namespace: pgos::server
struct BattlePlayerOfflineEvt
fieldtypedescription
player_idpgos::pstringThe player id of the player who is offline.
battle_session_idpgos::pstringThe battle-session the player is in
offline_typePlayerSessionEvtThe reason why the player is offline.
offline_msgpgos::pstringThe detail message for the event.

BattlePlayerBannedEvt

The event will be triggered when the player in the battle-session is banned.

// namespace: pgos::server
struct BattlePlayerBannedEvt
fieldtypedescription
player_idpgos::pstringThe player id of the player who is baned.
battle_session_idpgos::pstringThe battle-session the player is in
ban_reasonpgos::pstringReason for ban. The reason string comes from the reason string passed in when creating the ban.
ban_created_timeint64_tBan creation time.
ban_durationint64_tBan duration
ban_expired_timeint64_tBan expiration time, 0 means forever

BattleSessionUpdatedEvt

The event will be triggered when new players are added to the battle session or when the backfill status changes.

// namespace: pgos::server
struct BattleSessionUpdatedEvt
fieldtypedescription
update_reasonpgos::pstringThis is a string data enumeration: @BACKFILL_STATUS_CHANGED: backfill status changes @BACKFILL_ADDED_PLAYERS: new players backfilled to the battle session @WORLD_ADDED_PLAYERS: New players are added to the session by World service.
battle_session_idpgos::pstringBattle session id.
backfill_statusBackfillStatusStatus for the backfilling process to the battle session.
total_playersint32_tTotal number of players in the battle session. Note: players with a player battle session status of COMPLETED will be excluded.
max_playersint32_tMax number of players in the battle session.
backedfilled_playerspgos::pvector<PlayerDesc>New players add by backfill matchmaking.
new_player_battle_sessionspgos::pvector<PlayerBattleSession>New players added to the battle session. For example, by the World service.
lockedboolLocked state of the battle session.

UpdateStatItemParams

// namespace: pgos::server
struct UpdateStatItemParams
fieldtypedescription
itemStatItemThe stat item to update.
ignore_custom_databoolWhether update custom data. It won't overwrite the old one when updated if this is true.
ignore_tagsboolWhether update tags. It won't overwrite the old one when updated if this is true.

BatchUpdateStatItemParams

// namespace: pgos::server
struct BatchUpdateStatItemParams
fieldtypedescription
itemspgos::pvector<StatItem>The stat items to update.
ignore_custom_databoolWhether update custom data. It won't overwrite the old one when updated if this is true.
ignore_tagsboolWhether update tags. It won't overwrite the old one when updated if this is true.

UpdateStatItemFailInfo

Update stat item fail info.

// namespace: pgos::server
struct UpdateStatItemFailInfo
fieldtypedescription
stat_namepgos::pstringStat to update.
keypgos::pstringThe key of the stat item to update.
err_codePgosErrCodeupdate fail error code, view pgos_error.h or PgosErrorCode.h for details.
msgpgos::pstringUpdate fail error message, view pgos_error.h or PgosErrorCode.h for details.

StatItemAfterUpdate

Update stat item success info.

// namespace: pgos::server
struct StatItemAfterUpdate
fieldtypedescription
latest_itemStatItemLatest stat item.
is_insertedboolIf the stat item is newly created (which means previously the key doesn't exist).
is_modifiedboolIf the stat item is updated (which depends on aggregation type and min/max value range).

BatchUpdateStatItemResult

Response for batch update stat items.

// namespace: pgos::server
struct BatchUpdateStatItemResult
fieldtypedescription
itemspgos::pvector<StatItemAfterUpdate>Stat items after updated.
failspgos::pvector<UpdateStatItemFailInfo>Stat items that failed to update.

SetBattlePropertiesParams

// namespace: pgos::server
struct SetBattlePropertiesParams
fieldtypedescription
battle_session_idpgos::pstringBattle session id.
battle_propertiespgos::pvector<BattleProperty>The new battle properties.

LockWorldBattleSessionParams

// namespace: pgos::server
struct LockWorldBattleSessionParams
fieldtypedescription
battle_session_idpgos::pstringBattle session id.

UnlockWorldBattleSessionParams

// namespace: pgos::server
struct UnlockWorldBattleSessionParams
fieldtypedescription
battle_session_idpgos::pstringBattle session id.

PlayerFriendsLimit

// namespace: pgos::server
struct PlayerFriendsLimit
fieldtypedescription
player_idpgos::pstringPlayer id.
friends_limituint32_tThe maximum limit of friends player can have. (max 500 friends)

BatchSetPlayerFriendsLimitParams

// namespace: pgos::server
struct BatchSetPlayerFriendsLimitParams
fieldtypedescription
player_friends_limitpgos::pvector<PlayerFriendsLimit>Friends limit of player.

BatchGetPlayerFriendsLimitParams

// namespace: pgos::server
struct BatchGetPlayerFriendsLimitParams
fieldtypedescription
player_idspgos::pvector<pgos::pstring>Player ids.

BatchGetPlayerFriendsLimitResult

// namespace: pgos::server
struct BatchGetPlayerFriendsLimitResult
fieldtypedescription
player_friends_limitpgos::pvector<PlayerFriendsLimit>Friends limit of player.

SetBattleTagsParams

// namespace: pgos::server
struct SetBattleTagsParams
fieldtypedescription
battle_session_idpgos::pstringThe id of battle session.
tagspgos::pvector<pgos::pstring>The tags of battle.

KVDataItemsWithReplayed

// namespace: pgos::server
struct KVDataItemsWithReplayed
fieldtypedescription
kvdatapgos::pmap<pgos::pstring, KVDataValue>KVData items, key: item key, value: value of the key.
replayedboolWhether the request is replayed. When it is True, it indicates that the result of the function is obtained by replaying with the same idepotency_token. This means that the result of the function has been generated in a previous call and is being reused in the current call.

KVDataIncrementsIdempotent

A set of kvdata items with a idempotency token.

// namespace: pgos::server
struct KVDataIncrementsIdempotent : public PlayerKVDataGroup

parent: PlayerKVDataGroup

fieldtypedescription
idempotency_tokenpgos::pstring[Optional] Used to ensure the idempotence of the function. An idempotent operation produces the same outcome regardless of how many times it's executed, without causing any side effects or altering the system's state. The scope of the idempotent token is for each player.

BatchIncrPlayerKVDataIdempotentParams

// namespace: pgos::server
struct BatchIncrPlayerKVDataIdempotentParams
fieldtypedescription
datapgos::pvector<KVDataIncrementsIdempotent>Key: player id, value: kvdata increments of the player.

BatchIncrPlayerKVDataIdempotentResult

// namespace: pgos::server
struct BatchIncrPlayerKVDataIdempotentResult
fieldtypedescription
datapgos::pmap<pgos::pstring, KVDataItemsWithReplayed>players kvdata result values map: key is player id, value is result for increment operations.
failed_playerspgos::pmap<pgos::pstring, PgosResult>Failed players map: key is player id, value is error code and message.

MachineInfo

// namespace: pgos::server
struct MachineInfo
fieldtypedescription
machine_idpgos::pstringunique id of the machine
machine_modelpgos::pstringinstance type of the machine

BuildInfo

// namespace: pgos::server
struct BuildInfo
fieldtypedescription
build_idpgos::pstringunique id of the build
build_namepgos::pstringname of the build

DeploymentInfo

// namespace: pgos::server
struct DeploymentInfo
fieldtypedescription
public_ippgos::pstringpublic ip of the game server
fleet_idpgos::pstringunique id of the fleet
data_centerpgos::pstringname of the data center. the possible values can be viewed in the 'DataCenterName' definition.
machine_infoMachineInfodetail information of the machine
build_infoBuildInfodetail information of the build
title_idpgos::pstring
title_region_idpgos::pstring

EctActionInfo

Structure to hold information about an ECT action.

// namespace: pgos::server
struct EctActionInfo
fieldtypedescription
idpgos::pstringThe ID of ECT action.
namepgos::pstringThe name of ECT action.
idempotency_tokenpgos::pstringToken for idempotency operation.
payloadpgos::pstringThe userdata of operation set by game, such as parameters in JSON.
resultpgos::pstringThe result of operation set by game.
statusEctActionStatusThe status of ECT action.
updated_timeint64_tThe last updated time of ECT action.

EctExpirationAndRetryPolicy

// namespace: pgos::server
struct EctExpirationAndRetryPolicy
fieldtypedescription
expiration_durationuint32_tThe expiration duration for an ECT is the time period in seconds from its creation until it expires. The ECT will be marked as expired if the duration has elapsed and the ECT is uncompleted. Minimum: 60 seconds; maximum: 604800 seconds (7 days).
trigger_auto_retry_eventboolWhether the retry event of ECT is triggered to VS by PGOS if the ECT is uncompleted.
max_auto_retry_countuint32_tMaximum number of retry attempts. This is only meaningful when the 'trigger_auto_retry_event' is set to true.
auto_retry_intervaluint32_tThe time interval in seconds between each retry attempt. The timing of the first try starts counting from the creation of the ECT. This is only meaningful when the 'trigger_auto_retry_event' is set to true. Minimum: 60 seconds; maximum: 86400 seconds (24 hours).

EctInfo

Structure to hold information about an ECT (Eventual Consistent Transaction).

// namespace: pgos::server
struct EctInfo
fieldtypedescription
idpgos::pstringThe ID of ECT.
namepgos::pstringThe name of ECT.
payloadpgos::pstringThe userdata of ECT set by game.
player_idspgos::pvector<pgos::pstring>All players associated with the operation in this ECT.
statusEctStatusThe status of ECT.
expiration_and_retry_policyEctExpirationAndRetryPolicyWhether the retry event of ECT is triggered to VS by PGOS if the ECT is not done.
created_timeint64_tThe created time of ECT.
updated_timeint64_tThe last updated time of ECT.
actionspgos::pvector<EctActionInfo>The actions of ECT.

EctActionCreateParams

// namespace: pgos::server
struct EctActionCreateParams
fieldtypedescription
namepgos::pstringThe name of ECT action.
payloadpgos::pstringThe userdata of operation set by game, such as parameters in JSON.
idempotency_tokenpgos::pstringToken for idempotency operation.

CreateEctParams

// namespace: pgos::server
struct CreateEctParams
fieldtypedescription
idpgos::pstringThe ID of ECT.
namepgos::pstringThe name of ECT.
payloadpgos::pstringThe userdata of ECT set by game.
player_idspgos::pvector<pgos::pstring>All players associated with the operation in this ECT.
expiration_and_retry_policyEctExpirationAndRetryPolicyWhether the retry event of ECT will be triggered to VS by PGOS if the ECT is uncompleted.
actionspgos::pvector<EctActionCreateParams>The actions of ECT.

EctActionUpdateParam

// namespace: pgos::server
struct EctActionUpdateParam
fieldtypedescription
payloadpgos::pstringUpdate action's payload.
resultpgos::pstringUpdate action's result.
statusEctActionStatusUpdate action's status.

UpdateEctParams

// namespace: pgos::server
struct UpdateEctParams
fieldtypedescription
idpgos::pstringECT ID.
payloadpgos::pstringUpdate action's payload.
action_updatespgos::pmap<pgos::pstring, EctActionUpdateParam>Update the results and status of actions. key: action ID.

UpdateEctActionsParams

// namespace: pgos::server
struct UpdateEctActionsParams
fieldtypedescription
idpgos::pstringECT ID.
action_updatespgos::pmap<pgos::pstring, EctActionUpdateParam>Update the results and status of actions. key: action ID.

CancelEctParams

// namespace: pgos::server
struct CancelEctParams
fieldtypedescription
idpgos::pstringECT ID.
reasonpgos::pstringReason for cancellation.

GetEctInfoParams

// namespace: pgos::server
struct GetEctInfoParams
fieldtypedescription
idpgos::pstringECT ID.

GetPlayerUncompletedEctsParams

// namespace: pgos::server
struct GetPlayerUncompletedEctsParams
fieldtypedescription
player_idpgos::pstringThe ID of the specified player.
offsetuint32_tThe start position.
countuint32_tThe limit of the ECTs request.

GetPlayerUncompletedEctsResult

// namespace: pgos::server
struct GetPlayerUncompletedEctsResult
fieldtypedescription
ect_listpgos::pvector<EctInfo>List of ECTs.
has_moreboolHas more.
next_offsetuint32_tThe next starting position of the list.
total_numuint32_tThe total number of uncompleted ECTs that this player has.

PushMsgToGameBackendParams

// namespace: pgos::server
struct PushMsgToGameBackendParams
fieldtypedescription
msg_bus_tagpgos::pstringOptional, the tag of the message bus instance to which the message is sent. If this value is not set, the messge will be sent to a random message bus instance.
msgpgos::pvector<uint8_t>The message data to be sent.
extrapgos::pvector<uint8_t>Optional, extra data to be delivered. For example: it can be used as a header for routing.

RPCRequestToGameBackendParams

// namespace: pgos::server
struct RPCRequestToGameBackendParams
fieldtypedescription
msg_bus_tagpgos::pstringOptional, the tag of the message bus instance to which the message is sent. If this value is not set, the messge will be sent to a random message bus instance.
msgpgos::pvector<uint8_t>The message data to be sent.
extrapgos::pvector<uint8_t>Optional, extra data to be delivered. For example: it can be used as a header for routing.
timeout_msuint32_tTimeout period, in milliseconds. If this value is set to 0, the maximum value 60000 (60 seconds) will be used.

RPCResponse

// namespace: pgos::server
struct RPCResponse
fieldtypedescription
responsepgos::pvector<uint8_t>The response of an RPC request.

GameBackendMsgEvt

Event info when received msg from the game backend.

// namespace: pgos::server
struct GameBackendMsgEvt
fieldtypedescription
msg_bus_tagpgos::pstringThe tag of the message bus instance from which the message is received.
msgpgos::pvector<uint8_t>Message data sent by the game via PgosMsgBusSDK.

HTTPAPIMsgEvt

Event info when received msg the PGOS backend HTTP API.

// namespace: pgos::server
struct HTTPAPIMsgEvt
fieldtypedescription
msgpgos::pvector<uint8_t>Message data sent by the game via backend HTTP API.
extrapgos::pvector<uint8_t>Extra data sent by the game via backend HTTP API.

SubtractCurrency

// namespace: pgos::server
struct SubtractCurrency
fieldtypedescription
currency_codepgos::pstringThe code of the currency will be subtracted.
amountuint32_tThe amount of the currency will be subtracted.

SubtractPlayerCurrencyParams

// namespace: pgos::server
struct SubtractPlayerCurrencyParams : public BaseBackendEventParams

parent: BaseBackendEventParams

fieldtypedescription
player_idpgos::pstringPlayers whose balance will be subtracted.
subtract_currencySubtractCurrencyInformation about the subtracted currency.
idempotency_tokenpgos::pstring[Optional] Used to ensure the idempotence of the function. Idempotence means that regardless of how many times the function is called, the result remains the same. By passing a unique idempotency_token, it ensures that the function does not produce duplicate side effects or results when called repeatedly. Note: To avoid generating the same idempotency_token as other players, it is recommended to concatenate it with the player_id.
pay_platform_dataPayPlatformDataThe necessary information required by the payment platform, which must be filled out when deducting premium currency.

SubtractPlayerCurrencyResult

// namespace: pgos::server
struct SubtractPlayerCurrencyResult
fieldtypedescription
player_idpgos::pstringThe player id who have been successfully granted.
replayedboolWhether the request is replayed. When it is True, it indicates that the result of the function is obtained by replaying with the same idempotency_token. This means that the result of the function has been generated in a previous call and is being reused in the current call.

GetPlayerBalanceParams

// namespace: pgos::server
struct GetPlayerBalanceParams
fieldtypedescription
player_idpgos::pstring
pay_platform_dataPayPlatformDataThe necessary information required by the payment platform, which must be filled out when deducting premium currency.

GetPlayerBalanceResult

// namespace: pgos::server
struct GetPlayerBalanceResult
fieldtypedescription
currenciespgos::pvector<Balance>All virtual currency balance of the player.

BatchGrantVirtualCurrenciesToPlayerParams

Request struct for batch grant currency to player.

// namespace: pgos::server
struct BatchGrantVirtualCurrenciesToPlayerParams : public BaseBackendEventParams

parent: BaseBackendEventParams

fieldtypedescription
player_idpgos::pstringThe player id who will be granted currencies to.
granted_currenciespgos::pvector<GrantCurrency>The virtual currencies will be granted.
idempotency_tokenpgos::pstring[Optional] Used to ensure the idempotence of the function. Idempotence means that regardless of how many times the function is called, the result remains the same. By passing a unique idempotency_token, it ensures that the function does not produce duplicate side effects or results when called repeatedly. Note: To avoid generating the same idempotency_token as other players, it is recommended to concatenate it with the player_id.

BatchGrantVirtualCurrenciesToPlayerResult

// namespace: pgos::server
struct BatchGrantVirtualCurrenciesToPlayerResult
fieldtypedescription
player_idpgos::pstringThe player id who have been successfully granted.
replayedboolWhether the request is replayed. When it is True, it indicates that the result of the function is obtained by replaying with the same idempotency_token. This means that the result of the function has been generated in a previous call and is being reused in the current call.

BatchSubtractPlayerVirtualCurrenciesParams

// namespace: pgos::server
struct BatchSubtractPlayerVirtualCurrenciesParams : public BaseBackendEventParams

parent: BaseBackendEventParams

fieldtypedescription
player_idpgos::pstringPlayers whose balance will be subtracted.
subtract_currenciespgos::pvector<SubtractCurrency>The virtual currencies to be granted.
idempotency_tokenpgos::pstring[Optional] Used to ensure the idempotence of the function. Idempotence means that regardless of how many times the function is called, the result remains the same. By passing a unique idempotency_token, it ensures that the function does not produce duplicate side effects or results when called repeatedly. Note: To avoid generating the same idempotency_token as other players, it is recommended to concatenate it with the player_id.

BatchSubtractPlayerVirtualCurrenciesResult

// namespace: pgos::server
struct BatchSubtractPlayerVirtualCurrenciesResult
fieldtypedescription
player_idpgos::pstringThe player id who have been successfully granted.
replayedboolWhether the request is replayed. When it is True, it indicates that the result of the function is obtained by replaying with the same idempotency_token. This means that the result of the function has been generated in a previous call and is being reused in the current call.

PartyCustomData

Custom data for party.

// namespace: pgos::server
struct PartyCustomData
fieldtypedescription
versionintCustom data version, always incremental over the lifetime of the party.
global_custom_datapgos::pstringGlobal custom data. Only Leader has permission to modify it.
player_custom_datapgos::pmap<pgos::pstring, pgos::pstring>Player custom data. The map key is party member's player ID, the map value is the party member's custom data. Each party member could modify it's player custom data.

PartyInfo

Detailed information of a party

// namespace: pgos::server
struct PartyInfo
fieldtypedescription
party_idpgos::pstringThe party id
namepgos::pstringName of the party
leaderPlayerInfoPlayer who is the leader of the party A leader can: Kick out members: a leader can kick out any member at any time. Dismiss the party. Transfer leadership to another member.
memberspgos::pvector<PlayerInfo>Players of the party
created_timeint64_tThe Unix timestamp(in seconds) when the party was created.
max_playeruint32_tMax number of players in the party, unlimited if it is 0.
custom_dataPartyCustomDataCustom data of the party(including global and player).
join_strategyPartyJoinStrategyThe strategy controls the rules who could join the party.
invite_strategyPartyInviteStrategyThe strategy controls the rules who could invite others to the party.

BatchGetPlayerCurrentPartyIdsParams

// namespace: pgos::server
struct BatchGetPlayerCurrentPartyIdsParams
fieldtypedescription
player_idspgos::pvector<pgos::pstring>The player ids.

BatchGetPlayerCurrentPartyIdsResult

// namespace: pgos::server
struct BatchGetPlayerCurrentPartyIdsResult
fieldtypedescription
player_party_idspgos::pmap<pgos::pstring, pgos::pstring>The map of player -> party ids, the empty value implies the player is not in any party.

GetPartyInfoParams

// namespace: pgos::server
struct GetPartyInfoParams
fieldtypedescription
party_idpgos::pstringThe player id.

GetPartyInfoResult

// namespace: pgos::server
struct GetPartyInfoResult
fieldtypedescription
party_infoPartyInfoThe party info.

GetPlayerInventoryWithFilterParams

Get inventory with filter params.

// namespace: pgos::server
struct GetPlayerInventoryWithFilterParams
fieldtypedescription
player_idpgos::pstringThe player id.
item_typespgos::pvector<InGameItemType>Item types to get
item_tagspgos::pvector<TagDataFilter>Item tags to get
item_instance_tagspgos::pvector<TagDataFilter>Item instance tags to get
uniqueBooleanFilterFilter by unique item
stackableBooleanFilterFilter by stackable item
consumableBooleanFilterFilter by consumable item

Common Define

PgosCallback

The result callback after the API execution ends.

using PgosCallback = std::function<void(const PgosResult&)>;

Type Reference:

PgosDataCallback

The result callback after the API execution ends.

template <typename T> 
using PgosDataCallback = std::function<void(const PgosResult&, const T*)>;

Type Reference:

PgosInterCallback

Intermediate callback that may be executed multiple times during API execution.

template <typename T>
using PgosInterCallback = std::function<void(const T*)>;