跳到主要内容

Client Settings API Reference

The Setttings module provides the game with the ability to manage player-related settings. Currently, it consists of two sections: Privacy Settings and Local Cache Management.

API List

APIDescription
GetPrivacySettingsQuery privacy settings of the currently logged in player.
SetPrivacySettingsSet privacy settings of the currently logged in player (all fields must be set together).
SetPrivacyItemSet privacy settings of the currently logged in player (Set one of the privacy options).
GetLocalCacheSizeGet total bytes of local cache files
ClearLocalCacheClear local cache files

API Details

GetPrivacySettings

Query privacy settings of the currently logged in player.

/**
* Query privacy settings of the currently logged in player.
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void GetPrivacySettings(
PgosDataCallback<PrivacySettingInfo> result_callback);

Parameters:

ParamTypeDescription
result_callbackPgosDataCallback<PrivacySettingInfo>The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetPrivacySettings

Set privacy settings of the currently logged in player (all fields must be set together).

/**
* Set privacy settings of the currently logged in player (all fields must be set together).
*
* @param settings New settings to be set.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetPrivacySettings(
const PrivacySettingInfo& settings,
PgosCallback result_callback);

Parameters:

ParamTypeDescription
settingsconst PrivacySettingInfo&New settings to be set.
result_callbackPgosCallbackThe result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

SetPrivacyItem

Set privacy settings of the currently logged in player (Set one of the privacy options).

/**
* Set privacy settings of the currently logged in player (Set one of the privacy options).
*
* @param settings New settings to be set. Only the item corresponding to 'valid_item_type' will be modified.
* @param valid_item_type Specify a privacy item for modification.
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void SetPrivacyItem(
const PrivacySettingInfo& settings,
PrivacyItemType valid_item_type,
PgosCallback result_callback);

Parameters:

ParamTypeDescription
settingsconst PrivacySettingInfo&New settings to be set. Only the item corresponding to 'valid_item_type' will be modified.
valid_item_typePrivacyItemTypeSpecify a privacy item for modification.
result_callbackPgosCallbackThe result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void

GetLocalCacheSize

Get total bytes of local cache files

/**
* Get total bytes of local cache files
*
* @return Bytes of local cache file
*/
int64_t GetLocalCacheSize();

Parameters:

(No parameters)

Return: int64_t

Bytes of local cache file

ClearLocalCache

Clear local cache files

/**
* Clear local cache files
*
* @param result_callback The result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.
*/
void ClearLocalCache(
PgosCallback result_callback);

Parameters:

ParamTypeDescription
result_callbackPgosCallbackThe result callback after the API execution ends, and it will be called in an ASYNCHRONOUS CHILD THREAD.

Return: void