Skip to main content

INTLConfig 配置

动态获取配置(GetConfig)

[Player Network SDK] 动态获取配置值

支持的平台

支持Android, iOS, Windows 平台。

函数定义

T GetConfig<T>(string key, T defValue, string project = "INTL")

入参说明

参数类型说明
keybool, int, string配置的 key
defValuebool, int, string获取失败后的返回值,非必传入
projectstring默认参数,保持不变

代码示例

int gameID = INTLAPI.GetConfig(GAME_ID_KEY, 0);

动态更新配置(UpdateConfig)

[Player Network SDK] 动态更新配置。

支持的平台

支持Android, iOS, Windows 平台。

函数定义

bool UpdateConfig(Dictionary<string, string> configsDic, string project = "")

入参说明

参数类型说明
configsDicDictionary<string, string>配置内容
projectstring默认参数,保持不变

代码示例

Dictionary<string, string> config = new Dictionary<string, string>();
config.Add("LOG_LEVEL", "1");
INTLAPI.UpdateConfigs(config);

云控配置

配置在Player Network Console的云控配置会在SDK初始化、登录成功后自动进行拉取,也可通过配置开启固定定时拉取。 参考 Player Network SDK 云控