Client PlayerBlobData API Reference
PGOS provides blob type PlayData to support the use of binary large objects in game.
API List
| API | Description |
|---|---|
| GetPBDInfo | Get the player blob data information of the specified key. |
| UpdateMyPBDFromBuff | Update blob data of the current player from a memory buffer. The function will create a copy of blob data internally, if the buffer is very large, this may lead to high memory usage. So for the blob buffer with large size, consider using the UpdateMyPBDFromFile API instead. |
| UpdateMyPBDFromFile | Update blob data of the current player from a local file. |
| CancelMyPBDUpdate | Cancel the blob data update operation of the current player. |
API Details
GetPBDInfo
Get the player blob data information of the specified key.
/**
* Get the player blob data information of the specified key.
*
* @param PlayerId The player to query.
* @param BlobKey The blob key to query.
* @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 GetPBDInfo(
const FString& PlayerId,
const FString& BlobKey,
TFunction<void(const FPgosResult& Ret, const FPgosPlayerBlobDataInfo* Data)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| PlayerId | const FString& | The player to query. |
| BlobKey | const FString& | The blob key to query. |
| ResultCallback | TFunction<void(const FPgosResult& Ret, const FPgosPlayerBlobDataInfo* 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
UpdateMyPBDFromBuff
Update blob data of the current player from a memory buffer. The function will create a copy of blob data internally, if the buffer is very large, this may lead to high memory usage. So for the blob buffer with large size, consider using the UpdateMyPBDFromFile API instead.
/**
* Update blob data of the current player from a memory buffer.
* The function will create a copy of blob data internally, if the buffer is very large, this may lead to high memory usage.
* So for the blob buffer with large size, consider using the UpdateMyPBDFromFile API instead.
*
* @param BlobKey The blob key to update.
* @param BlobBuff Blob data buffer to set. If the buffer address pointer is nullptr, the blob data will be reset to 0 bytes.
* @param ProgressCallback Data transfer progress callback, which will be called in an ASYNCHRONOUS CHILD THREAD.
* @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 UpdateMyPBDFromBuff(
const FString& BlobKey,
const FPgosBuffer& BlobBuff,
TFunction<void(const FPgosUpdatePBDProgressInfo* data)> ProgressCallback,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| BlobKey | const FString& | The blob key to update. |
| BlobBuff | const FPgosBuffer& | Blob data buffer to set. If the buffer address pointer is nullptr, the blob data will be reset to 0 bytes. |
| ProgressCallback | TFunction<void(const FPgosUpdatePBDProgressInfo* data)> | Data transfer progress callback, which will be called in an ASYNCHRONOUS CHILD THREAD. |
| 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
UpdateMyPBDFromFile
Update blob data of the current player from a local file.
/**
* Update blob data of the current player from a local file.
*
* @param BlobKey The blob key to update.
* @param FilePath The full path to the file to upload. If it is not a UE project (FString), please pass in a full local path (not in utf8 format).
* @param ProgressCallback Data transfer progress callback, which will be called in an ASYNCHRONOUS CHILD THREAD.
* @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 UpdateMyPBDFromFile(
const FString& BlobKey,
const FString& FilePath,
TFunction<void(const FPgosUpdatePBDProgressInfo* data)> ProgressCallback,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| BlobKey | const FString& | The blob key to update. |
| FilePath | const FString& | The full path to the file to upload. If it is not a UE project (FString), please pass in a full local path (not in utf8 format). |
| ProgressCallback | TFunction<void(const FPgosUpdatePBDProgressInfo* data)> | Data transfer progress callback, which will be called in an ASYNCHRONOUS CHILD THREAD. |
| 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
CancelMyPBDUpdate
Cancel the blob data update operation of the current player.
/**
* Cancel the blob data update operation of the current player.
*
* @param BlobKey The blob key to cancel the update.
* @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 CancelMyPBDUpdate(
const FString& BlobKey,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;
Parameters:
| Param | Type | Description |
|---|---|---|
| BlobKey | const FString& | The blob key to cancel the update. |
| 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