跳到主要内容

Client PlayerBlobData API Reference

PGOS provides blob type PlayData to support the use of binary large objects in game.

API List

APIDescription
GetPBDInfoGet the player blob data information of the specified key.
UpdateMyPBDFromBuffUpdate 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.
UpdateMyPBDFromFileUpdate blob data of the current player from a local file.
CancelMyPBDUpdateCancel 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:

ParamTypeDescription
PlayerIdconst FString&The player to query.
BlobKeyconst FString&The blob key to query.
ResultCallbackTFunction<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:

ParamTypeDescription
BlobKeyconst FString&The blob key to update.
BlobBuffconst FPgosBuffer&Blob data buffer to set. If the buffer address pointer is nullptr, the blob data will be reset to 0 bytes.
ProgressCallbackTFunction<void(const FPgosUpdatePBDProgressInfo* data)>Data transfer progress callback, which will be called in an ASYNCHRONOUS CHILD THREAD.
ResultCallbackTFunction<void(const FPgosResult& Ret)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

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:

ParamTypeDescription
BlobKeyconst FString&The blob key to update.
FilePathconst 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).
ProgressCallbackTFunction<void(const FPgosUpdatePBDProgressInfo* data)>Data transfer progress callback, which will be called in an ASYNCHRONOUS CHILD THREAD.
ResultCallbackTFunction<void(const FPgosResult& Ret)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void

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:

ParamTypeDescription
BlobKeyconst FString&The blob key to cancel the update.
ResultCallbackTFunction<void(const FPgosResult& Ret)>The result callback after the API execution ends, and it will be called in the GAME THREAD. For lifetime safety, it is recommended to use the CreateWeakCallback provided in PgosSDKCpp.h to create a lambda bound to an UObject.

Return: void