Login Access
Client Login Access
Proceed with the following steps immediately after Step Five
Step 6: Add Callback Handling
- Unity
- Unreal Engine
-
You need to add the AuthResultObserver and LIEventObserver callbacks to handle login component events;
-
The callback data structure is INTLAuthResult, which contains login information and account details, such as OpenID, account binding information, and account deactivation status.
// Add callbacks
INTLAPI.AddAuthResultObserver(OnAuthResultEvent);
LevelInfinite.AddLIEventObserver(OnLIBaseEventResult);
// Handle AuthResultObserver callback result
private void OnAuthResultEvent(INTLAuthResult AuthResult)
{
switch (AuthResult.MethodId)
{
case (int)INTLMethodID.LI_LOGIN_ENTER_GAME:
if(AuthResult.RetCode == (int)ERROR_CODE.SUCCESS) {
Debug.Log("LI PASS Login success");
} else {
Debug.Log("LI PASS Login failed, ret_code = " + AuthResult.RetCode + ", ret_msg = " + AuthResult.RetMsg);
}
break;
default:
break;
}
}
// Handle LIEventObserver callback result
private void OnLIBaseEventResult(LIBaseEventResult liRet)
{
switch (liRet.lIEventType)
{
case LIEventType.GN_READY:
break;
default:
break;
}
}
-
You need to add the AuthResultObserver and LIEventObserver callbacks to handle login component events;
-
The callback data structure is INTLAuthResult, which contains login information and account details, such as OpenID, account binding information, and account deactivation status.
// Add callbacks
AuthResultObserver = UINTLSDKAPI::GetAuthResultObserver().AddUObject(this, &ULevelInfiniteWindow::OnAuthResult_Callback);
// Handle AuthResultObserver callback result
void ULevelInfiniteWindow::OnAuthResult_Callback(FINTLAuthResult AuthResult)
{
if(AuthResult.MethodId == (int32)LIEnterGameMethodId::kLILoginEnterGame)
{
}
else if (AuthResult.MethodId == (int32)LIEnterGameMethodId::kLIAutoLoginEnterGame)
{
}
}
// Add callbacks
FDelegateHandle LIEventObserver;
LIEventObserver = ULevelInfiniteAPI::GetEventDelegate().AddUObject(this, &ULevelInfiniteWindow::OnLIEvent_Callback);
// Handle LIEventObserver callback result
void ULevelInfiniteWindow::OnLIEvent_Callback(FLIBaseEvent Event)
{
FString logStr;
switch(Event.EventType){
case ELIEventType::GN_READY:
{
break;
}
}
}
Step 7: Complete LI PASS Login Process
- Unity
- Unreal Engine
- Call the
LoginChannelWithLIPassinterface and specify the login channel to perform third-party authorized login;
LevelInfinite.LoginChannelWithLIPass(INTLChannel.Steam);
- Call the
LoginChannelWithLIPassinterface and specify the login channel to perform third-party authorized login;
ULevelInfiniteAPI::LoginChannelWithLIPass(EINTLLoginChannel::kChannelSteam);
- After third-party channel authorization, if the current account is not yet associated with an LI PASS account and the player is entering the game for the first time, the interface for associating the LI PASS account will be displayed;
- After login is complete, if the current player's compliance process is not yet completed, they will automatically enter the LI PASS compliance process.
Step 8: Configure Third-party Channel Information
For example, Steam
- Tutorial for Steam Channel Game Application
- Configure the Steam Channel Parameters on the Player Network Console
- Configuration of steam_appid.txt, refer to Steam Login and Configuration
For more Steam channel integration information, see Steam Channel Integration.
For more Epic channel integration information, see Epic Channel Integration.
Step 9: Other Configurations
Configure Skip Association
- If your game does not want to force users to link their LI PASS account on first login, you can configure Skip LI PASS account link in Player Network Console;
- If the skip association LI PASS account configuration is enabled, the LI PASS login panel will display a
Skipbutton that players can press to skip the association.
Store Channel Number Configuration
For games planned to be listed on the Steam or Epic stores, add the store channel number in the INTLConfig.ini:
- Steam
- Epic
[INTL Tools]
WINDOWS_STORE_CHANNEL = 101
[INTL Tools]
WINDOWS_STORE_CHANNEL = 102
Backend Login Access
Please refer to Backend Integration in the integration overview.