Server ServerSDK API Reference
Server sdk api.
API List
| API | Description |
|---|---|
| InitSdk | Init modules for PGOS service. Note: InitSdk/InitConfig/Destroy must be called on the main thread. |
| 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. |
| Destroy | Shutdown PGOS service, should be called during process shutdown if possible. Note: InitSdk/InitConfig/Destroy must be called on the main thread. |
API Details
InitSdk
Init modules for PGOS service. Note: InitSdk/InitConfig/Destroy must be called on the main thread.
/// <summary>
/// Init modules for PGOS service.
/// Note: InitSdk/InitConfig/Destroy must be called on the main thread.
/// </summary>
/// <param name="pgos_params">Request parameters for init sdk.</param>
public void InitSdk(InitSdkParams pgos_params);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | InitSdkParams | Request parameters for init sdk. |
Return: void
InitConfig
Init config for PGOS service. Note: InitSdk/InitConfig/Destroy must be called on the main thread.
/// <summary>
/// Init config for PGOS service.
/// Note: InitSdk/InitConfig/Destroy must be called on the main thread.
/// </summary>
/// <param name="cfgs">A configuration consisting of key/value pairs, such as "title_id", "secret_key", and others.</param>
public void InitConfig(Dictionary<string, string> cfgs);
Parameters:
| Param | Type | Description |
|---|---|---|
| cfgs | Dictionary<string, string> | 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".
/// <summary>Get configuration value of the specified key, except for "secret_key".</summary>
/// <param name="cfg_key">The specified key, such as "title_id", "log_level", and others.</param>
public string GetConfig(string cfg_key);
Parameters:
| Param | Type | Description |
|---|---|---|
| cfg_key | string | The specified key, such as "title_id", "log_level", and others. |
Return: string
The configuration value of the specified key.
GetSDKVersion
Get current PGOS SDK version.
/// <summary>Get current PGOS SDK version.</summary>
public string GetSDKVersion();
Parameters:
(No parameters)
Return: string
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.
/// <summary>
/// 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.
/// </summary>
/// <param name="pgos_params">Request parameters for init sdk.</param>
public void InitSdkForkingProcess(InitSdkParams pgos_params);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | InitSdkParams | Request parameters for init sdk. |
Return: void
Destroy
Shutdown PGOS service, should be called during process shutdown if possible. Note: InitSdk/InitConfig/Destroy must be called on the main thread.
/// <summary>
/// Shutdown PGOS service, should be called during process shutdown if possible.
/// Note: InitSdk/InitConfig/Destroy must be called on the main thread.
/// </summary>
public void Destroy();
Parameters:
(No parameters)
Return: void