INTLConfig 配置
动态获取配置(GetConfig)
[Player Network SDK] 动态获取配置值
支持的平台
支持Android, iOS, Windows 平台。
函数定义
- Unity
- Unreal Engine
T GetConfig<T>(string key, T defValue, string project = "INTL")
static std::string GetConfig(const std::string &key, const std::string &default_value, const std::string &project = "INTL");
入参说明
- Unity
- Unreal Engine
| 参数 | 类型 | 说明 |
|---|---|---|
| key | bool, int, string | 配置的 key |
| defValue | bool, int, string | 获取失败后的返回值,非必传入 |
| project | string | 默认参数,保持不变 |
| 参数 | 类型 | 说明 |
|---|---|---|
| key | std::string | 配置的 key |
| default_value | std::string | 获取失败后的返回值,非必传入 |
| project | std::string | 默认参数,保持不变 |
代码示例
- Unity
- Unreal Engine
int gameID = INTLAPI.GetConfig(GAME_ID_KEY, 0);
LILanguage = UINTLSDKAPI::GetConfig(GAME_ID_KEY, 0);
动态更新配置(UpdateConfig)
[Player Network SDK] 动态更新配置。
支持的平台
支持Android, iOS, Windows 平台。
函数定义
- Unity
- Unreal Engine
bool UpdateConfig(Dictionary<string, string> configsDic, string project = "")
static bool UpdateConfig(const std::map<std::string, std::string> &config, const std::string &project = "");
入参说明
- Unity
- Unreal Engine
| 参数 | 类型 | 说明 |
|---|---|---|
| configsDic | Dictionary<string, string> | 配置内容 |
| project | string | 默认参数,保持不变 |
| 参数 | 类型 | 说明 |
|---|---|---|
| config | std::map<std::string, std::string> | 配置内容 |
| project | std::string | 默认参数,保持不变 |
代码示例
- Unity
- Unreal Engine
Dictionary<string, string> config = new Dictionary<string, string>();
config.Add("LOG_LEVEL", "1");
INTLAPI.UpdateConfigs(config);
std::map<std::string, std::string> config;
config.Add("LOG_LEVEL", "1");
UINTLSDKAPI::UpdateConfig(config);
云控配置
配置在Player Network Console的云控配置会在SDK初始化、登录成功后自动进行拉取,也可通过配置开启固定定时拉取。 参考 Player Network SDK 云控。