Initialization (InitLIP)
Supported in: LI PASS V1.16
If you are using the Unity engine, see InitLIP for Unity SDK.
It is recommended to call InitLIP to initialize LI PASS at the start of the game.
Function Definition
UFUNCTION(BlueprintCallable, Category = "LevelInfinite")
static int InitLIP(UGameInstance* instance, const FString& appVersion = "appVersion", const FString& langType = "en");
Starting from LI PASS V1.28.00, the input parameter appVersion is optional; the default value is "appVersion".If the business does not pass appVersion or passes appVersion="appVersion", LI PASS will automatically handle the relevant 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 time for the GN_READY event under network exception conditions is 60s*3.After initialization, the game can directly call AutoLogin, OpenLoginPanel or Login and Launch LI PASS Binding Page (LoginChannelWithLIPass) to provide a timely response 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 |
|---|---|---|---|
| instance | UGameInstance | UE GameInstance | Requir ed |
| appVersion | String | Game version number, cannot contain spaces. | LI PASS V1.28.00 and above: Optional, default value: "appVersion" LI PASS below V1.28.00: Required |
| langType | String | LI PASS UI display language | Optional, default value: "en" |
Code Sample
FString Version = "appVersion";
ULevelInfiniteAPI::InitLIP(GetGameInstance<UGameInstance>(), Version, TEXT("en"));