Server ServerSDK API Reference
Server sdk api.
API List
| API | Description |
|---|---|
| InitConfig | Init config for PGOS service. Note: InitSdk/InitConfig/Destroy must be called on the main thread. |
| GetConfig | Get configuration value of the specified key, except for "secret_key". |
| GetSDKVersion | Get current PGOS SDK version. |
| 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. |
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:
| Param | Type | Description |
|---|---|---|
| Cfgs | const 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:
| Param | Type | Description |
|---|---|---|
| CfgKey | const 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:
| Param | Type | Description |
|---|---|---|
| Params | const FPgosInitSdkParams& | Request parameters for init sdk. |
Return: void