Account Personal Information (GUAAccountProfile) [Player Network SDK only]
Data Structure
- Unity
- Unreal Engine
note
Account callback information GUAAccountResult The member variable Profile contains account personal information.
GUAAccountProfile: Account personal information.
| Parameters | Type | Description |
|---|---|---|
| UserName | string | Username must start with a letter, containing only lowercase letters (a to z), underscores (_) and digits (0 to 9).Its length can be 6 to 16 characters. |
| Birthday | string | User’s Date of Birth. If an invalid date is provided, the birth year defaults to 1970-01-01 |
| BirthdayYear | int32 | The year of the user's birthday; if entered illegally, the default birthday year is 1970 |
| Birthday Month | int32 | The month of the user's birthday; if entered illegally, the default birthday month is 1 |
| BirthdayDay | int32 | The day of the user's birthday; if entered illegally, the default birthday day is 1 |
| IsReceiveEmail | int | Whether to receive marketing emails, default is 0 |
| Region | string | ISO 3166-1 Numeric code for country or region For example, 156 represents China, 040 represents Austria |
| LangType | string | Language Type (RFC 4646), e.g. "en", see Language Type Definition for details. |
| ExtraJson | string | Additional parameters (JSON format) |
| string | Email address | |
| Phone | string | Phone number |
| PhoneAreaCode | string | Phone area code |
| AccountType | string | Account type |
| NickName | string | Nickname |
| UsernamePassVerify | string | Verification Code |
note
Account personal information is included in (GUAAccountResult)GUABaseResult`extended fields.
GUAAccountProfile: Account personal information.
| Parameters | Type | Description |
|---|---|---|
| user_name | std::string | Username must start with a letter, containing only lowercase letters (a to z), underscores (_) and digits (0 to 9).Its length can be 6 to 16 characters. |
| birthday | std::string | User’s Date of Birth. If an invalid date is provided, the birth year defaults to 1970-01-01 |
| is_receive_email | int32 | Whether to receive marketing emails, default is 0 |
| region | std::string | ISO 3166-1 Alpha 3 numeric code for country or region For example, 156 represents China, 040 represents Austria |
| lang_type | std::string | Language Type (RFC 4646), e.g. "en", see Language Type Definition for details. |
| extra_json | std::string | Additional parameters (JSON format) |
Code Example
- Unity
- Unreal Engine
Account callback information [GUAAccountResult](/docs/resources/api/UnionAdapter/AccountServ(/docs/resources/api/ountResult) The member variable Profile contains account personal information.
public static GUAAccountResult ConvertToGUA(INTLAccountResult ret)
{
if (ret == null) return null;
GUAAccountResult accountResult = new GUAAccountResult();
accountResult.ChannelID = ret.ChannelID;
accountResult.Channel = ret.Token;
accountResult.SeqID = ret.SeqID;
accountResult.Username = ret.Username;
accountResult.Uid = ret.Uid;
accountResult.Token = ret.Token;
accountResult.Expiretime = ret.Expiretime;
accountResult.IsRegister = ret.IsRegister;
accountResult.IsSetPassword = ret.IsSetPassword;
accountResult.IsReceiveEmail = ret.IsReceiveEmail;
accountResult.VerifyCodeExpireTime = (int)ret.VerifyCodeExpireTime;
accountResult.CanBind = ret.CanBind;
accountResult.IsUserNameAvailable = ret.IsUserNameAvailable;
accountResult.Profile = ConvertToGUA(ret.Profile);
ConvertToGUA(ret, accountResult);
return accountResult;
}
Account personal information is contained in (GUAAccountResult)GUABaseResult ExtraJson as account callback information
void OnAccountResultNotify(const AccountResult &account_result)
{
TSharedPtr<FJsonObject> json;
TSharedRef<TJsonReader<TCHAR>> jsonReader = TJsonReaderFactory<TCHAR>::Create(accountResult.ExtraJson);
if(FJsonSerializer::Deserialize(jsonReader, json))
{
GUAAccountProfile profile;
profile.user_name = json->GetStringField("user_name");
profile.birthday = json->GetStringField("birthday");
profile.is_receive_email = json->GetIntegerField("is_receive_email");
profile.region = json->GetStringField("region");
profile.lang_type = json->GetStringField("lang_type");
profile.extra_json = json->GetStringField("extra_json");
}
}