Client Economy API Reference
PGOS provides a series of services to help you build a in-game economy, including virtual currencies, in-game items, stores, and inventory.
API List
| API | Description |
|---|---|
| GetBalances | Get all balances of the player. |
| GetStore | Get the specified store defined on the portal. |
| GetStoreWithPlatform | Get the specified store defined on the portal. This interface can get the value of 'platform_item_mapping'. |
| GetStoreBriefs | Get brief information of specified stores. |
| GetStoreCategories | Get the specified store categories defined on the portal. |
| CreateStoreOrder | Create an order before purchase the specified store item in the store. After committing the order, the PGOS virtual server events event_item_granted/event_currency_changed will be triggered. |
| CommitStoreOrder | After committing the order, the payment will be deducted and the items will be dispatched. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered. The event_custom_data filled in the parameter CreateStoreOrderParams will be passed to these events. |
| QueryStoreOrder | Query order status. |
| GetInventory | Get all item instances in the player's inventory. |
| GetInventoryWithFilter | Get all item instances in the player's inventory. |
| ConsumeInstance | Consume the specified item instance in the player's inventory. The virtual server function bound to the consumer action will be called. |
| OpenContainerInstance | Open the specified container instance in the player's inventory. The PGOS virtual server events event_item_revoked and event_item_granted/event_currency_changed will be triggered. |
| RevokeInstance | Revoke the specified item instance in the player's inventory. The PGOS virtual server event event_item_revoked will be triggered. |
| SetInstanceTags | Update the tags data of the specified item instance in the player's inventory. Instance tags can have up to 32 keys, with each key limited to 128 bytes and each value limited to 1024 bytes(in a narrow-character string). |
| CheckBeforePlatformPurchase | Check before purchasing items on 3rd-party platforms. Used to check situations where items cannot be purchased due to unique items, mapping configuration, etc. |
| SyncPlayerPlatformInventory | Synchronize the 3rd-party platform's inventory to PGOS. It is recommended to call it once after logging in to PGOS. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered. |
| SyncSteamPlayerInventory | Synchronize the Steam platform's inventory to PGOS. It is recommended to call it once after logging in to PGOS. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered. |
| SyncSteamPurchase | Synchronize item instances purchased by players from Steam to PGOS. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered. |
| SyncXboxPlayerInventory | Synchronize the Xbox platform's inventory to PGOS. It is recommended to call it once after logging in to PGOS. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered. |
| SyncXboxPurchase | Synchronize item instances purchased by players from Xbox to PGOS. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered. |
Event List
| Event | Description |
|---|---|
| OnInventoryGranted | The event will be triggered when new item instances are granted to player's inventory. |
| OnBalanceUpdated | The event will be triggered when any currency amount changed. |
API Details
GetBalances
Get all balances of the player.
/**
* Get all balances of the player.
*
* @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 GetBalances(
TFunction<void(const FPgosResult& Ret, const FPgosClientGetBalancesResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientGetBalancesResult* 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
GetStore
Get the specified store defined on the portal.
/**
* Get the specified store defined on the portal.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetStore(
const FPgosClientGetStoreParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientStore* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientGetStoreParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientStore* 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
GetStoreWithPlatform
Get the specified store defined on the portal. This interface can get the value of 'platform_item_mapping'.
Deprecated, use GetStore instead.
/**
* Get the specified store defined on the portal. This interface can get the value of 'platform_item_mapping'.
* [DEPRECATED!!!] GetStoreWithPlatform was declared deprecated, consider using GetStore instead.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetStoreWithPlatform(
const FPgosClientGetStoreWithPlatformParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientStore* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientGetStoreWithPlatformParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientStore* 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
GetStoreBriefs
Get brief information of specified stores.
/**
* Get brief information of specified stores.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetStoreBriefs(
const FPgosClientGetStoreBriefsParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientGetStoreBriefsResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientGetStoreBriefsParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientGetStoreBriefsResult* 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
GetStoreCategories
Get the specified store categories defined on the portal.
/**
* Get the specified store categories defined on the portal.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetStoreCategories(
const FPgosClientGetStoreCategoriesParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientGetStoreCategoriesResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientGetStoreCategoriesParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientGetStoreCategoriesResult* 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
CreateStoreOrder
Create an order before purchase the specified store item in the store. After committing the order, the PGOS virtual server events event_item_granted/event_currency_changed will be triggered.
/**
* Create an order before purchase the specified store item in the store.
*
* After committing the order, the PGOS virtual server events `event_item_granted`/`event_currency_changed` will be triggered.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void CreateStoreOrder(
const FPgosClientCreateStoreOrderParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientCreateStoreOrderResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientCreateStoreOrderParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientCreateStoreOrderResult* 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
CommitStoreOrder
After committing the order, the payment will be deducted and the items will be dispatched. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered. The event_custom_data filled in the parameter CreateStoreOrderParams will be passed to these events.
/**
* After committing the order, the payment will be deducted and the items will be dispatched.
*
* The PGOS virtual server events `event_item_granted`/`event_currency_changed` will be triggered.
* The `event_custom_data` filled in the parameter `CreateStoreOrderParams` will be passed to these events.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void CommitStoreOrder(
const FPgosClientCommitStoreOrderParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientCommitStoreOrderResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientCommitStoreOrderParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientCommitStoreOrderResult* 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
QueryStoreOrder
Query order status.
/**
* Query order status.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void QueryStoreOrder(
const FPgosClientQueryStoreOrderParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientQueryStoreOrderResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientQueryStoreOrderParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientQueryStoreOrderResult* 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
GetInventory
Get all item instances in the player's inventory.
/**
* Get all item instances in the player's inventory.
*
* @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 GetInventory(
TFunction<void(const FPgosResult& Ret, const FPgosItemInstPack* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosItemInstPack* 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
GetInventoryWithFilter
Get all item instances in the player's inventory.
/**
* Get all item instances in the player's inventory.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void GetInventoryWithFilter(
const FPgosClientGetInventoryWithFilterParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosItemInstPack* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientGetInventoryWithFilterParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosItemInstPack* 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
ConsumeInstance
Consume the specified item instance in the player's inventory. The virtual server function bound to the consumer action will be called.
/**
* Consume the specified item instance in the player's inventory.
*
* The virtual server function bound to the consumer action will be called.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void ConsumeInstance(
const FPgosClientConsumeInstanceParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientConsumeInstanceResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientConsumeInstanceParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientConsumeInstanceResult* 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
OpenContainerInstance
Open the specified container instance in the player's inventory. The PGOS virtual server events event_item_revoked and event_item_granted/event_currency_changed will be triggered.
/**
* Open the specified container instance in the player's inventory.
*
* The PGOS virtual server events `event_item_revoked` and `event_item_granted`/`event_currency_changed` will be triggered.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void OpenContainerInstance(
const FPgosClientOpenContainerInstanceParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientOpenContainerResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientOpenContainerInstanceParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientOpenContainerResult* 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
RevokeInstance
Revoke the specified item instance in the player's inventory. The PGOS virtual server event event_item_revoked will be triggered.
/**
* Revoke the specified item instance in the player's inventory.
*
* The PGOS virtual server event `event_item_revoked` will be triggered.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void RevokeInstance(
const FPgosClientRevokeInstanceParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientInstanceOperationResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientRevokeInstanceParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientInstanceOperationResult* 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
SetInstanceTags
Update the tags data of the specified item instance in the player's inventory. Instance tags can have up to 32 keys, with each key limited to 128 bytes and each value limited to 1024 bytes(in a narrow-character string).
/**
* Update the `tags` data of the specified item instance in the player's inventory.
* Instance `tags` can have up to 32 keys, with each key limited to 128 bytes and each value limited to 1024 bytes(in a narrow-character string).
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SetInstanceTags(
const FPgosClientSetInstanceTagsParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientSetInstanceTagsResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSetInstanceTagsParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientSetInstanceTagsResult* 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
CheckBeforePlatformPurchase
Check before purchasing items on 3rd-party platforms. Used to check situations where items cannot be purchased due to unique items, mapping configuration, etc.
/**
* Check before purchasing items on 3rd-party platforms. Used to check situations where items cannot be purchased due to unique items, mapping configuration, etc.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void CheckBeforePlatformPurchase(
const FPgosClientCheckBeforePlatformPurchaseParams& Params,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientCheckBeforePlatformPurchaseParams& | Request params. |
| 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
SyncPlayerPlatformInventory
Synchronize the 3rd-party platform's inventory to PGOS. It is recommended to call it once after logging in to PGOS. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered.
Deprecated, use SyncSteamPlayerInventory/SyncXboxPlayerInventory instead.
/**
* Synchronize the 3rd-party platform's inventory to PGOS.
* It is recommended to call it once after logging in to PGOS.
*
* The PGOS virtual server events `event_item_granted`/`event_currency_changed` will be triggered.
* [DEPRECATED!!!] SyncPlayerPlatformInventory was declared deprecated, consider using SyncSteamPlayerInventory/SyncXboxPlayerInventory instead.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SyncPlayerPlatformInventory(
const FPgosClientSyncPlayerPlatformInventoryParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientSyncPlayerPlatformInventoryResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSyncPlayerPlatformInventoryParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientSyncPlayerPlatformInventoryResult* 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
SyncSteamPlayerInventory
Synchronize the Steam platform's inventory to PGOS. It is recommended to call it once after logging in to PGOS. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered.
/**
* Synchronize the Steam platform's inventory to PGOS.
* It is recommended to call it once after logging in to PGOS.
*
* The PGOS virtual server events `event_item_granted`/`event_currency_changed` will be triggered.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SyncSteamPlayerInventory(
const FPgosClientSyncSteamPlayerInventoryParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientSyncSteamPurchaseResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSyncSteamPlayerInventoryParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientSyncSteamPurchaseResult* 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
SyncSteamPurchase
Synchronize item instances purchased by players from Steam to PGOS. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered.
/**
* Synchronize item instances purchased by players from Steam to PGOS.
*
* The PGOS virtual server events `event_item_granted`/`event_currency_changed` will be triggered.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SyncSteamPurchase(
const FPgosClientSyncSteamPurchaseParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientSyncSteamPurchaseResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSyncSteamPurchaseParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientSyncSteamPurchaseResult* 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
SyncXboxPlayerInventory
Synchronize the Xbox platform's inventory to PGOS. It is recommended to call it once after logging in to PGOS. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered.
/**
* Synchronize the Xbox platform's inventory to PGOS.
* It is recommended to call it once after logging in to PGOS.
*
* The PGOS virtual server events `event_item_granted`/`event_currency_changed` will be triggered.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SyncXboxPlayerInventory(
const FPgosClientSyncXboxPlayerInventoryParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientSyncXboxPurchaseResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSyncXboxPlayerInventoryParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientSyncXboxPurchaseResult* 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
SyncXboxPurchase
Synchronize item instances purchased by players from Xbox to PGOS. The PGOS virtual server events event_item_granted/event_currency_changed will be triggered.
/**
* Synchronize item instances purchased by players from Xbox to PGOS.
*
* The PGOS virtual server events `event_item_granted`/`event_currency_changed` will be triggered.
*
* @param Params Request params.
* @param ResultCallback The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.
*/
void SyncXboxPurchase(
const FPgosClientSyncXboxPurchaseParams& Params,
TFunction<void(const FPgosResult& Ret, const FPgosClientSyncXboxPurchaseResult* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosClientSyncXboxPurchaseParams& | Request params. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosClientSyncXboxPurchaseResult* 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
OnInventoryGranted
The event will be triggered when new item instances are granted to player's inventory.
/**
* OnInventoryGranted:
* The event will be triggered when new item instances are granted to player's inventory.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnInventoryGranted, const FPgosClientInventoryGrantedEvt& /*Event*/);
FOnInventoryGranted& OnInventoryGranted() { return InventoryGrantedDelegate; }
Type Reference:
OnBalanceUpdated
The event will be triggered when any currency amount changed.
/**
* OnBalanceUpdated:
* The event will be triggered when any currency amount changed.
*
* @param Event Event result.
*/
DECLARE_MULTICAST_DELEGATE_OneParam(FOnBalanceUpdated, const FPgosClientBalanceUpdatedEvt& /*Event*/);
FOnBalanceUpdated& OnBalanceUpdated() { return BalanceUpdatedDelegate; }
Type Reference: