Skip to main content

Init

AndroidiOSWindows
Deprecated since: LI PASS V1.06.00
If you were looking for the method for use with Unity, see Init for Unity SDK.

It is recommended to initialize LI PASS when starting the game.

  • For LI PASS V1.06 to LI PASS V1.15, see InitLI.
  • For LI PASS V1.16 and above, see InitLIP.

Function definition

UFUNCTION(BlueprintCallable, Category = "LevelInfinite")
static int Init(UGameInstance* instance, const FString &host, const FLIUserData& userData, bool isTest);

Input parameters

ParameterTypeDescription
instanceUGameInstanceUE GameInstance
hostFStringProduction environment URL: https://sg-vas.intlgame.com
Test environment URL: https://test-vas.intlgame.com
userDataFLIUserDataThe rule must be consistent with the rule configured on Player Network Console to get the correct resources
For more information, see UserData.
isTestboolIt doesn't affect the LI PASS environment, and the game doesn't need to worry about it. Just pass false

UserData structure

ParameterTypeDescription
GameIdintActual Game ID
ChannelIdstringLI PASS channel ID 131
OpenIDstringOpenID
Hardcode it to FFFFFFFFFFFFFF
LangTypestringLanguage type which affects multi-language UI display, pass as required
RegionstringISO 3166-1 numeric code for country or region
For example 156 for China, 040 for Austria
AppVersionstringApp Version

Other parameters do not have special requests, pass the value when available.

Code sample

FString host = TEXT("https://test-vas.intlgame.com");
FLIUserData userData = GetUserData();
ULevelInfiniteAPI::Init(GetGameInstance<UGameInstance>(), host, userData, false);