Initialization (Init)
AndroidiOSWindows
Deprecated in: LI PASS V1.06.00
If you are using the Unity engine, refer to Unity SDK's Init.
Deprecated in: LI PASS V1.06.00
If you are using the Unity engine, refer to Unity SDK's Init.
It is recommended to initialize LI PASS at game launch.
- LI PASS V1.06 to LI PASS V1.15, you can call
InitLI - LI PASS 1.16 and later versions, you can call
InitLIP
Function Definition
UFUNCTION(BlueprintCallable, Category = "LevelInfinite")
static int Init(UGameInstance* instance, const FString &host, const FLIUserData& userData, bool isTest);
Input Parameters
| Parameters | Type | Explanation |
|---|---|---|
| instance | UGameInstance | UE GameInstance |
| host | FString | Production URL: https://sg-vas.intlgame.com Test URL: https://test-vas.intlgame.com |
| userData | FLIUserData | This rule must be consistent with the one configured in the Player Network console to get the correct resources. For more information, see UserData. |
| isTest | bool | Does not affect the LI PASS environment; the game doesn't need to worry, just pass false |
User data structure
| Parameter | Type | Explanation |
|---|---|---|
| GameId | int | Actual Game ID |
| ChannelId | String | LI PASS Channel ID 131 |
| OpenID | String | OpenID, fixed as FFFFFFFFFFFFFF |
| LangType | String | Language type affecting multi-language UI display, provide as needed. |
| Region | String | Numeric codes of countries or regions as per ISO 3166-1 For example, 156 represents China, and 040 represents Austria. |
| AppVersion | string | Game version number |
Other parameters have no special requirements. Pass values when available.
Code example
FString host = TEXT("https://test-vas.intlgame.com");
FLIUserData userData = GetUserData();
ULevelInfiniteAPI::Init(GetGameInstance<UGameInstance>(), host, userData, false);