Skip to main content

Getting Started with LI PASS Integration

Starting from this article, follow the guide to integrate the PlayerNetwork SDK step by step!

note

If you need human service, you can consult the Player Network Assistant on WeChat Work.

Game Registration & Configuration

To register and configure your game, log in to the Player Network Console. For details, see the Player Network Console Usage Documentation.

Get PlayerNetwork SDK

Enter the PlayerNetwork SDK Download Page and choose the appropriate engine and platform to download the PlayerNetwork SDK.For details, see the PlayerNetwork SDK Download Guide.

Client Integration

Step 1: Import PlayerNetwork SDK into the game project

  1. Player Network SDK Integration

Engine Version Support

SDK VersionSupported Unity Versions
SDK 1.27 and later versionsUnity 2021 ~ Unity 6
SDK 1.24 ~ 1.26Unity 2021 ~ Unity 2022

Player Network SDK supports integration on Android, iOS, Windows, and Console platforms. For details, please refer to the integration documentation: Player Network SDK Integration.

  1. Copy files into the project

After copying the LevelInfinite, INTLSDK, Plugins, and StreamingAssets/LevelInfinite folders into your project's Assets directory, then open the Unity project.

Image: LevelInfinite File Structure
FolderDescription

| LevelInfinite | LI PASS engine layer code | | INTLSDK | Player Network sdk engine layer code | | Plugins | LI PASS platform layer library file | | StreamingAssets/LevelInfinite | LI PASS business logic resources, can be hot updated | | Symbols | Symbol table files for PlayerNetwork SDK, used to restore stack |

note

Files in the Symbols directory must be properly saved; after game launch, these may be needed for online issue troubleshooting with the symbol table.

If you encounter issues during the import process, refer to Possible Issues at the end of the document or consult the Player Network Assistant .

  1. Generate Unity Lua Interface Files

When opening the Unity project, a window to generate C# exported Lua interface files will automatically pop up as shown below. Click Generate to proceed. Image: INTLLua popup window

If no popup appears, in the Unity menu bar, select INTLLua > All > Clear to delete, which will remove the directory Assets/LevelInfinite/Runtime/INTLGameNative/Scripts/LuaObject (or manually delete the directory).
A pop-up will automatically prompt for generating Unity's Lua interface afterwards.If the pop-up does not appear, manually trigger it by selecting INTL > INTLLua > All > Make from Unity's menu bar.

Image: INTLLua menu

You can check in the Assets/LevelInfinite/Runtime/INTLGameNative/Scripts/LuaObject directory whether the interface export file was successfully generated.

Image: INTLLua Directory

Step Two: Configure INTLConfig.ini File

  • The INTLConfig.ini file contains configuration items for the LI PASS service and is essential for using the LI PASS service in the game.
  • When downloading the SDK, the INTLConfig.ini is generated by default along with the necessary configurations, allowing businesses to directly use these configurations to experience SDK functions.
  • If there is a need to modify the INTLConfig.ini configuration items, you can use the game engine's visual configuration editing tool or directly modify the INTLConfig.ini file.

Open the visual configuration editor through the editor toolbar INTL > LI INIConfig Window.

Image: INTLLua menu

For details on each configuration item, you can select an option in the editor to automatically display a brief description of the option or refer to the SDK INTLConfig.ini Configuration to view a complete list of configuration items.

[Optional] Retrieve player email during third-party channel login
note

This setting belongs to the Third-Party Channel Configuration in the Player Network Console. Web-side operations do not have access; please contact your business team to complete configuration.

To use the quick binding feature of the Web binding module, you must first set permission to obtain player email during third-party channel login.

  • For compliance reasons, emails returned from specific sources can be masked as needed; please contact Player Network Assistant to enable this if required.
  • You can report the hash of the email as base64(sha256(email)) in the backend transaction logs; please contact Player Network Assistant to enable this if required.
  • This is used to verify whether the player information or binding list contains email information; please contact Player Network Assistant to enable this if required.
  • Can be used for iOS Firebase's Private Set Membership (PSM) feature. See Firebase iOS Project Configuration.

Below are third-party channels that support returning player email:

Apple

note

Apple requires player authorization to obtain email. If authorization is denied, the email cannot be obtained. See Login API passing email and fullName.

  1. Use the editing tool to add the email permission to [Dynamic] under APPLE_LOGIN_PERMISSION.

  2. Enable the email return feature in the Player Network Console by setting return_email to YES. For details, see Third-Party Channel Configuration.

Firebase

Enable the email return feature in the Player Network Console by setting return_email to YES. For details, see Third-Party Channel Configuration.

Twitter

  1. Use the editing tool to add email permission to [Dynamic] under FACEBOOK_LOGIN_PERMISSION.If INTLConfig.ini does not configure FACEBOOK_LOGIN_PERMISSION, the email permission will be automatically included.

  2. Configure email permission on Meta for Developers.email permission requires Advanced Access Level to allow all apps to obtain the player's email.

    Image: Facebook permission request

  3. Enable email return function in the Player Network Console by setting return_email to YES. For detailed steps, see Third-party Channel Configuration.

Adjust

  1. Under User authentication settings on Twitter Developer Platform, check Request email from users.

    Image: OAUTH1.OA SETTINGS
  2. Enable the email return feature in the Player Network Console by setting return_email to YES. For details, see Third-Party Channel Configuration.

Step Three: Initialize LI PASS

When the game starts, you should call the initialization interfaces provided by PNTSDK INTLAPI.InitSDK and LevelInfinite.InitLIP.

  • The initialization process will first check if there are available hot update resources;
  • If there are resource updates, it will automatically download and then load the new version;
  • After the resource loading is complete, it will trigger the GN_READY event in the LI PASS event callback (LIEventObserver), marking the completion of the LI PASS initialization.
INTLAPI.InitSDK(); // Initialize sdk
Font font = null; // Set font for LI PASS interface
LevelInfinite.InitLIP(font, Application.version, "en");

Step Four: Set LI PASS Interface and Email Language

  • Set the language for the LI PASS interface using the SetLanguage interface.
  • It is recommended to keep the language set here consistent with the game language to ensure uniformity.
  • The set language type will also apply to emails, such as verification code emails.
note

Note that when switching the game language, the SetLanguage interface needs to be set again.

Interface details: SetLanguage.

LevelInfinite.SetLanguage("en");

Step Five: Set UI Root Nodes

Before using other LI PASS features, the SetUIRoot must be called to set the root node for all LI PASS interfaces to ensure proper UI display.

note

设置 UI 根节点后,请不要销毁该节点,否则 LI PASS UI 界面无法挂载,会产生预期外的行为。

Release the LI PASS interface through interface button operations; do not force destroy.If Unity controls GC (garbage collection) during scene switching, an empty pointer error may occur.

Interface details: SetUIRoot.

LevelInfinite.SetUIRoot(uiRoot);
note

Step Six: Open LI PASS Login Panel

Here, the Mobile Account Solution is used as an example to open the LI PASS interface.The game business needs to integrate according to its own needs, following the Login module's corresponding account solution guidance.

LevelInfinite.OpenLoginPanel();

After completing the above steps, running the project should normally open the LI PASS interface.

Possible Issues

1. Unity Assembly Issues When Importing

LI PASS supports assemblies starting from version V1.08.If the project does not support assemblies, follow the steps below to remove them:

  1. Delete the following assembly definition files. Delete Assembly Definition
  2. Edit luaSvr.cs to change the assembly name from LevelInfinite to Assembly-CSharp. Edit assembly name
  3. Contact Player Network Assistant to obtain an AssetBundle package without assemblies.
2. [Optional] Switch Loading Method

LI PASS's default loading method is Editor mode, intended to smoothly run LI PASS processes in the editor.In development, the business can change the loading method to StreamingAssets mode through the menu LevelInfinite > AssetLoadMode.

The choice of loading mode does not affect the loading mode of the build package (default CDN).

Image:LevelInfinite menu

OptionExplanation
EditorCorresponds to INTL_DEBUG_LUA macro, reads local Lua files
StreamingAssetsCorresponds to INTL_USE_LOCAL_ASSETS macro, loads AssetBundle in StreamingAssets
CDNCorresponds to Player Network console AssetBundle, if console resource loading fails, it loads AssetBundle from StreamingAssets

If you encounter problems during the integration process, please refer to Frequently Asked Questions.