Initialization (InitLI)
Deprecated in: LI PASS V1.16.00
If you are using Unreal Engine, see Unreal Engine SDK's InitLI.
It is recommended to initialize LI PASS at game launch.For LI PASS V1.16.00 and later versions, please call InitLIP.
Function Definition
public static void InitLI(Font font, bool isTestEnv, string appVersion, string langType = "en");
Initialize LI PASS through the following steps:
- Retrieve hotfix version information
- Download the new version of resources
- Load resources
- After loading is complete, trigger the LI PASS event callback (LIEventObserver) for the GN_READY event.
The callback timeout feedback for the GN_READY event under network exception is 60s*3.The game can directly call Auto Login, Open Login Panel, or Login and open LI PASS binding screen after initialization to provide prompt feedback to the player, without waiting for the GN_READY event.
Retrieve hotfix version information
Request Info
You can search for gnconfig to locate the request URL:
2023-06-08 09:54:20.948 25151-26800 INTL com.intlgame.demo I [INTL][1806][A.I.A][2023-06-08 09:54:20.948][25151, 26800, 539607522480][ (intl_http_manager.cpp:328) OnHTTPClientCallBack]:
[http] request url: https://test-vas.intlgame.com/v2/gnconfig/acquire_config?area_id=0&channelid=131&gameid=11&openid=FFFFFFFFFFFFFF&os=1&sdk_version=1.3.00&seq=11-7a08fc1d06ea8e62b6ea3e626ed61c8f2398c981bc6d8d0dfa30681a3d05616e-1686189260-717&source=37&token=&ts=1686189260&sig=6dc2bb8968cfe28fab5138e2342f327d,
Response Info
If LI PASS does not perform as expected, please check the hot update version information to ensure the correct resources are running.
If a match to the rule is found, you can search for rule_id to locate the response information:
response_body: {
"ret":0,
"msg":"",
"rule_id":"1063",
"resource_list":"[{\"dependency\":[],\"file_list\":[{\"md5\":\"968F1A3E16AB6041F504E29DEFB348DD\",\"size\":1747648,\"url\":\"https://sg-gamenative001-1300342648.file.myqcloud.com/gamenative-files/11/LI_107_UE_Android/1686187421509627102/LevelInfinite_Android.pak\"}],\"is_public\":0,\"name\":\"LI_107_UE_Android\"}]",
"sdk_enable":1,
"sdk_debug_enable":1,
"report_log_enable":1,
"log_level":1,
"inner_seq":"ac097e19-772b-4069-948d-78e21821ac15",
"seq":"11-7a08fc1d06ea8e62b6ea3e626ed61c8f2398c981bc6d8d0dfa30681a3d05616e-1686189260-717"
}
If no match to the rule is found:
response_body: {
"ret":23111202,
"msg":"no matched config error( [match logic]no match )",
"rule_id":"",
"resource_list":"",
"sdk_enable":0,
"sdk_debug_enable":0,
"report_log_enable":0,
"log_level":0,
"inner_seq":"ca3fa94a-0be7-4325-aa90-a5bc36d7c502",
"seq":"11-7a08fc1d06ea8e62b6ea3e626ed61c8f2398c981bc6d8d0dfa30681a3d05616e-1686189018-705"
}
Input Parameters
| Parameters | Type | Description |
|---|---|---|
| font | Font | Font collection used by LI PASS UI |
| isTest | boolean | Is it a test environment? false for a production environment, true for a test environment. |
| appVersion | String | Game version number, cannot contain spaces. |
| langType | String | LI PASS UI display language |
If you use a font not provided by LI PASS, please send the font to the Player Network Assistant.
Code Example
Font font = GetFont();
LevelInfinite.InitLI(font, true, Application.version, "en");