Skip to main content

Server ServerSDK API Reference

Server sdk api.

API List

APIDescription
InitSdkInit modules for PGOS service. Note: InitSdk/InitConfig/Destroy must be called on the main thread.
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.
DestroyShutdown 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:

ParamTypeDescription
pgos_paramsInitSdkParamsRequest 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:

ParamTypeDescription
cfgsDictionary<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:

ParamTypeDescription
cfg_keystringThe 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:

ParamTypeDescription
pgos_paramsInitSdkParamsRequest 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