Skip to main content

Server 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.
UpdatePBDFromBuffUpdate the player blob data 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 UpdatePBDFromFile API instead.
UpdatePBDFromFileUpdate the player blob data from a local file.
CancelPBDUpdateCancel the update operation of the player blob data.

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

UpdatePBDFromBuff

Update the player blob data 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 UpdatePBDFromFile API instead.

/**
* Update the player blob data 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 UpdatePBDFromFile API instead.
*
* @param PlayerId The player to update blob data.
* @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 UpdatePBDFromBuff(
const FString& PlayerId,
const FString& BlobKey,
const FPgosBuffer& BlobBuff,
TFunction<void(const FPgosUpdatePBDProgressInfo* data)> ProgressCallback,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;

Parameters:

ParamTypeDescription
PlayerIdconst FString&The player to update blob data.
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

UpdatePBDFromFile

Update the player blob data from a local file.

/**
* Update the player blob data from a local file.
*
* @param PlayerId The player to update blob data.
* @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 UpdatePBDFromFile(
const FString& PlayerId,
const FString& BlobKey,
const FString& FilePath,
TFunction<void(const FPgosUpdatePBDProgressInfo* data)> ProgressCallback,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;

Parameters:

ParamTypeDescription
PlayerIdconst FString&The player to update blob data.
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

CancelPBDUpdate

Cancel the update operation of the player blob data.

/**
* Cancel the update operation of the player blob data.
*
* @param PlayerId The player to be cancelled from updating blob data.
* @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 CancelPBDUpdate(
const FString& PlayerId,
const FString& BlobKey,
TFunction<void(const FPgosResult& Ret)> ResultCallback) const;

Parameters:

ParamTypeDescription
PlayerIdconst FString&The player to be cancelled from updating blob data.
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