Set up custom account information (SetAccountInfo)
To create a custom account, first call SetAccountInfo to set necessary information.This method has no callback.If you don't call this method first, and use other methods to create a custom account, an error message will appear on the console.
caution
- After calling LevelInfinite.AutoLogin, do not call the old auto-login interface INTLAPI.AutoLogin, or it will trigger auto-login twice.
- If the game is linked to a custom account, ensure the local login status before calling auto-login.If the login status is a custom account,
INTLAPI.SetAccountInfoneeds to be invoked.(The original custom account channel information,lang_typeparameter should remain consistent with the SetLanguage above.)If the local login status is another channel, there's no need forSetAccountInfosince it was called during LI PASS initialization.Ignore this note if the game hasn't integrated with a custom account. - Auto-login must be called in the callback of
LevelInfinite.Initafter receivingGN_READY.
Function Definition
public static void SetAccountInfo(
string channel,
int channelId,
string langType,
int accountPlatType,
string extraJson="{}");
Input Parameters
| Parameters | Type | Explanation |
|---|---|---|
| channel | String | Channel for the custom account, related to the platform account, e.g., CustomAccount, EGame, etc. |
| channelId | int | ACCOUNT_PLAT_TYPE assigned by the Player Network Console |
| langType | string | Language type (RFC 4646), e.g., "en".Used to define the language for sending emails and SMS For details, please see Language Type Definition. |
| accountPlatType | int | ACCOUNT_PLAT_TYPE assigned by the Player Network Console |
| extraJson | int | Extended information |
Code example
string channel = INTLChannel.CustomAccount;
int channelId = {YOUR_ACCOUNT_PLAT_TYPE};
string langType = "zh-Hans";
int accountPlatType = {YOUR_ACCOUNT_PLAT_TYPE};
INTLAPI.SetAccountInfo(channel, channelId, langType, accountPlatType);
- Replace
{YOUR_ACCOUNT_PLAT_TYPE}withACCOUNT_PLAT_TYPE.