Initialization (InitLIP)
Supported in: LI PASS V1.16
If you are using Unreal Engine, see Unreal Engine SDK's InitLIP.
It is recommended to call InitLIP to initialize LI PASS at the start of the game.
Function Definition
public static void InitLIP(Font font, string appVersion = "appVersion", string langType = "en");
Starting from LI PASS V1.28.00, the input parameter appVersion is optional with the default value of "appVersion".If the business does not pass appVersion or passes appVersion="appVersion", LI PASS will automatically handle the related logic.
Initializing LI PASS involves the following steps:
- Obtain hotfix version information
- Download updated resources
- Load resources
- After loading is complete, the GN_READY event of LI PASS event callback (LIEventObserver) is triggered.
The callback timeout feedback for the GN_READY event in case of network exception is 60s*3.After initialization, the game can directly call AutoLogin, OpenLoginPanel, or LoginChannelWithLIPass to promptly respond to players, 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
| Parameter | Type | Description | Remark |
|---|---|---|---|
| font | Font | Font collection used by LI PASS UI | Requir ed |
| appVersion | String | Game version number, cannot contain spaces. | Starting from LI PASS V1.28.00, this parameter is optional, default value: "appVersion"; previous versions are required. |
| langType | String | LI PASS UI display language | Optional, default value: "en" |
If you use a font not provided by LI PASS, please send the font to Player Network Assistant.
Code example
Font font = GetFont();
string appVersion="appVersion"
LevelInfinite.InitLIP(font, appVersion, "en");