GUAAccountProfile [Player Network SDK Only]
Data Structures
- Unity
- Unreal Engine
note
The Profile
field in Account callback information GUAAccountResult contains personal data.
GUAAccountProfile
: Personal data.
Parameter | Type | Description |
---|---|---|
UserName | string | Username, which must start with a letter and only contains lowercase letters (from a to z), underscores (_), and digits (from 0 to 9). Its length can be 6 to 16 bytes. |
Birthday | string | Birthday of the user. If an invalid value is entered, the field will be set to 1970-01-01 by default. |
BirthdayYear | int32 | Birth year of the user. If an invalid value is entered, the field will be set to 1970 by default. |
BirthdayMonth | int32 | Birth month of the user. If an invalid value is entered, this field will be set to 1 by default. |
BirthdayDay | int32 | Birth date of the user. If an invalid value is entered, this field will be set to 1 by default. |
IsReceiveEmail | int | Whether to receive marketing emails, 0 for default |
Region | string | ISO 3166-1 numeric code for country or region For example 156 for China, 040 for Austria |
LangType | string | Language type (RFC 4646), such as "en". For details, see Language Type Definition. |
ExtraJson | string | The extended field in 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
The ExtraJson
field in (GUAAccountResult)GUABaseResult contains personal data.
GUAAccountProfile
: Personal data.
Parameter | Type | Description |
---|---|---|
user_name | std::string | Username, which must start with a letter and only contains lowercase letters (from a to z), underscores (_), and digits (from 0 to 9). Its length can be 6 to 16 bytes. |
birthday | std::string | Birthday of the user. If an invalid value is entered, the field will be set to 1970-01-01 by default. |
is_receive_email | int32 | Whether to receive marketing emails, 0 for default |
region | std::string | ISO 3166-1 Alpha 3 code for country or region. For example, 156 for China, 040 for Austria. |
lang_type | std::string | Language type (RFC 4646), such as "en". For details, see Language Type Definition. |
extra_json | std::string | The extended field in JSON format |
Code Sample
- Unity
- Unreal Engine
The Profile
field in Account callback information GUAAccountResult contains personal data.
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;
}
The ExtraJson
field in (GUAAccountResult)GUABaseResult contains personal data.
// accountResult is 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");
}
}