Getting Started
Custom accounts are only available for games released in 2023 or earlier. New games must integrate LI PASS. For more details, see LEVEL INFINITE PASS.
Before you begin
Step 1: Configure the SDK for custom account
Open the project's INTLConfig.ini:
[INTL environment]
# WARNING: You should change this URL to the production environment when you release your game.
INTL_URL = https://test.intlgame.com
GAME_ID = {INTL_GAME_ID}
SDK_KEY = {INTL_SDK_KEY}
[INTL Log]
LOG_LEVEL = 1
LOG_CONSOLE_OUTPUT_ENABLE = 1
LOG_FILE_OUTPUT_ENABLE = 1
LOG_ENCRYPT_ENABLE = 0
LOG_COMPRESS_ENABLE = 0
[Android LifeCycle]
LIFECYCLE = QQ
[Custom Account]
ACCOUNT_SDK_KEY = {YOUR_ACCOUNT_SDK_KEY}
ACCOUNT_APP_ID = {YOUR_ACCOUNT_APP_ID}
ACCOUNT_PASSWORD_VALIDATION = 1
- Set the SDK backend environment to
INTL_URL = https://test.intlgame.com
. - Replace
{INTL_GAME_ID}
and{INTL_SDK_KEY}
with theGAME_ID
andSDK_KEY
assigned by Player Network Console. - Set
LOG_LEVEL = 1
,LOG_CONSOLE_OUTPUT_ENABLE = 1
,LOG_FILE_OUTPUT_ENABLE = 1
,LOG_ENCRYPT_ENABLE = 0
, andLOG_COMPRESS_ENABLE = 0
to output console logs and log files without encrypting or compressing the output. - Replace
{YOUR_ACCOUNT_SDK_KEY}
and{YOUR_ACCOUNT_APP_ID}
with theACCOUNT_SDK_KEY
andACCOUNT_APP_ID
assigned by Player Network Console. - Set
ACCOUNT_PASSWORD_VALIDATION
to 1, which means password validation is done by Player Network SDK. The password must be 8 to 20 digits, contains upper case letters, lower case letters, numbers, or!@#$%^&*()+=\-_/?<>,.:;|
.
For games with specific password validation requirements, setACCOUNT_PASSWORD_VALIDATION
to 0 to skip default password validation, and games should perform password validation on their own before calling Player Network SDK APIs.
Configure multiple custom account channels
By using the channel ID as a suffix, the game can configure multiple custom account channels. When the configuration with the channel ID suffix is not found, the configuration without the suffix will be used.
For example, the game accesses custom account channels with ChannelID 7 and 12, and uses the following configuration:
ACCOUNT_SDK_KEY_7 = {ACCOUNT_SDK_KEY_FOR_7}
ACCOUNT_SDK_KEY_12 = {ACCOUNT_SDK_KEY_FOR_12}
ACCOUNT_PASSWORD_VALIDATION = 1
When a user uses a channel with a ChannelID of 7, the configuration of ACCOUNT_SDK_KEY_7
will be used. When a user uses a channel with a ChannelID of 12, the configuration of ACCOUNT_SDK_KEY_12
will be used.
Because there are no separate configurations of ACCOUNT_PASSWORD_VALIDATION
for ChannelID 7 and 12, the configuration of ACCOUNT_PASSWORD_VALIDATION
will be used when checking whether the password needs to be verified.
Step 2: Implement custom account login
Before calling functions related to custom accounts, call SetAccountInfo
to set login channel information first.
Register an account
Player Network SDK provides two account registration methods: Register
and LoginWithVerifyCode
.
Register
Register
allows players to set user information during registration. Before calling Register
, it is recommended to check whether the account has already been registered.
When requesting a verification code, the CodeType is 0, indicating a registration verification code type.
LoginWithVerifyCode (Register)
LoginWithVerifyCode
does not require players to provide user information or a password when registering for an account. If no password was set, the player must use ResetPasswordWithVerifyCode
to set a password if they wish to use a password for future logins. If this account had already been registered, LoginWithVerifyCode
will only log in to this account.
When requesting for a verification code, the CodeType is 2, indicating a registration and login verification code type.
Log in
Registered users are able to log in with a verification code. If a password was set, they may also log in with the password.
LoginWithPassword
Players are able to log in to their account with a password without requesting for a verification code.
Before calling LoginWithPassword
, ensure players have set login channel information with SetAccountInfo
.
LoginWithVerifyCode (Login)
The login process is a part of the Registration process. If a player has already registered for an account, they can also request a CodeType=2
verification code through RequestVerifyCode
just to log in. In this case, the password provided by the user during login will be ignored.