Skip to main content

Server ServerSDK API Reference

Server sdk api.

API List

APIDescription
InitConfigInit config for PGOS service. Note: InitSdk/InitConfig/Destroy must be called on the main thread.
GetConfigGet configuration value of the specified key, except for "secret_key".
GetSDKVersionGet current PGOS SDK version.
InitSdkForkingProcessInit for PGOS service. Used when fork() function will be called in game server. Note: InitSdkForkingProcess/InitConfig/Destroy must be called on the main thread.

API Details

InitConfig

Init config for PGOS service. Note: InitSdk/InitConfig/Destroy must be called on the main thread.

/**
* Init config for PGOS service.
* Note: InitSdk/InitConfig/Destroy must be called on the main thread.
*
* @param Cfgs A configuration consisting of key/value pairs, such as "title_id", "secret_key", and others.
*/
void InitConfig(
const TMap<FString, FString>& Cfgs) const;

Parameters:

ParamTypeDescription
Cfgsconst TMap<FString, FString>&A configuration consisting of key/value pairs, such as "title_id", "secret_key", and others.

Return: void

GetConfig

Get configuration value of the specified key, except for "secret_key".

/**
* Get configuration value of the specified key, except for "secret_key".
*
* @param CfgKey The specified key, such as "title_id", "log_level", and others.
* @return The configuration value of the specified key.
*/
FString GetConfig(
const FString& CfgKey) const;

Parameters:

ParamTypeDescription
CfgKeyconst FString&The specified key, such as "title_id", "log_level", and others.

Return: FString

The configuration value of the specified key.

GetSDKVersion

Get current PGOS SDK version.

/**
* Get current PGOS SDK version.
*
* @return PGOS SDK version string.
*/
FString GetSDKVersion() const;

Parameters:

(No parameters)

Return: FString

PGOS SDK version string.

InitSdkForkingProcess

Init for PGOS service. Used when fork() function will be called in game server. Note: InitSdkForkingProcess/InitConfig/Destroy must be called on the main thread.

/**
* Init for PGOS service. Used when fork() function will be called in game server.
* Note: InitSdkForkingProcess/InitConfig/Destroy must be called on the main thread.
*
* @param Params Request parameters for init sdk.
*/
void InitSdkForkingProcess(
const FPgosInitSdkParams& Params) const;

Parameters:

ParamTypeDescription
Paramsconst FPgosInitSdkParams&Request parameters for init sdk.

Return: void