Skip to main content

Login Integration

Client Login Access

Proceed with the following steps immediately after Step Five

Step Six: Host Game Project Configuration

  1. Install and activate the Input System package:
note

Input System requires Unity 2019.1 or newer and .NET Framework 4 to run; it is not suitable for projects running on .NET Framework 3.5.

The XSX real machine requires version 1.6.1 of the Input System, and comes with the `com.unity.inputsystem.gxdk-1.0.1` extension, please contact the Player Network Assistant if you encounter any problems with the introduction.

For more information, see the Input System Installation Guide (https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Installation.html).
1. From Unity's main menu, go to **Window > Package Manager** to open the Unity Package Manager.
2. Click **Advanced** to make sure **Show Preview Packages** is enabled. 3.
3. From the list on the left, select the latest **Input System** package and click **Install**.

Click **Install**. [Image:Introducing InputSystem](/Images2/account/playernetwork/thirdparties/LevelInfinite/GetStarted/22.png)

4. From Unity's main menu, go to **Edit > Project Settings** and then click **Player**. 5.
5. Set the value of **Active Input Handling** to `Input System Package (New)`.

![Image:Setting Active Input Handling](/Images2/account/playernetwork/thirdparties/LevelInfinite/GetStarted/23.png)
  1. Add Macro Definitions:
    1. From Unity's main menu, go to Edit > Project Settings and click Player.

    2. Open the Other Settings panel and navigate to Scripting Define Symbols.

    3. Add INTL_CONSOLE_GAME_INPUT to the text box, separated by a semicolon.

          ![Image:Add INTL_CONSOLE_GAME_INPUT macro definition](/Images2/account/playernetwork/thirdparties/LevelInfinite/GetStarted/24.png)

      4. Open the assembly definition file `LevelInfinite.asmdef` in `Assets/LevelInfinite` and add `Unity. Definition References** and add `Unity.InputSystem`.

      ![Image:bug](/Images2/account/playernetwork/thirdparties/LevelInfinite/GetStarted/get-started-7-2-3b.png)

Step Seven: Add Callback Handling

You need to add the AuthResultObserver and LIEventObserver callbacks to handle login component events.

The callback data structure is INTLAuthResult, which includes login and account information, such as OpenID, account binding details, and account logout 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;
}
}

Step Eight: Complete the Login Process

Call the LoginChannelWithLIPass interface to open the LI PASS login component and specify the login channel for the player.

If the current account is not yet linked with LI PASS and the player is entering the game for the first time, the login component will display the interface for linking LI PASS.

LevelInfinite.LoginChannelWithLIPass(INTLChannel.PlayStation);

Step Nine: Configure Third-Party Channel Information

LI Pass supports multiple console-end third-party channels:

PlayStation

Nintendo Switch

XSX and WinGDK

Backend Login Access

Please refer to Backend Integration in the Integration Overview.