注册并登录(Register)[仅限 Player Network SDK]
[仅限 Player Network SDK] 注册并登录账号。
支持的平台
- Unity
- Unreal Engine
支持
Android, iOS, Windows 平台。支持
Android, iOS, Windows 平台。函数定义
- Unity
- Unreal Engine
void Register(
string account,
string password,
string verifyCode,
string phoneAreaCode,
GUAAccountProfile userProfile,
string extraJson = "{}");
static void Register(
const std::string &account,
const std::string &password,
const std::string &verify_code,
const std::string &phone_area_code,
const GUAAccountProfile &user_profile,
const std::string &extra_json = GUA_DEFAULT_JSON_STRING);
入参说明
注意
请注意用户名和密码的规则。
- Unity
- Unreal Engine
| 参数 | 类型 | 说明 |
|---|---|---|
| account | string | 账号,可用邮箱和手机号注册 |
| password | string | 更多信息,请参见 密码规则。 |
| verifyCode | string | 验证码 |
| phoneAreaCode | string | 手机区域码例如中国为"86",如果账号为邮箱则填空。 |
| userProfile | GUAAccountProfile | 账号的个人信息,包含,用户名,生日,国家地区等。 |
| extraJson | string | 扩展信息 |
| 参数 | 类型 | 说明 |
|---|---|---|
| account | std::string | 账号,可用邮箱和手机号注册 |
| password | std::string | 更多信息,请参见 密码规则。 |
| verify_code | std::string | 验证码 |
| phone_area_code | std::string | 手机区域码例如中国为"86",如果账号为邮箱则填空。 |
| user_profile | GUAAccountProfile | 账号的个人信息,包含,用户名,生日,国家地区等。 |
| extra_json | std::string | 扩展信息 |
回调处理
回调处理接口是 GUALoginResultObservers。回调数据结构是 GUALoginResult。
- Unity
- Unreal Engine
回调事件是 LoginResultEvents。 回调 ID 是 GUA_ACCOUNT_REGISTER。
回调事件是 OnLoginResultNotify。 回调 ID 是 kMethodIDAccountRegister。
代码示例
- Unity
- Unreal Engine
GUAAccountProfile accountProfile = new GUAAccountProfile();
// TODO: Set accountProfile
UnionAdapterAPI.GetAccountService().Register("account", "password", "verifyCode", "86", accountProfile);
GUA_NAMESPACE::GUAAccountProfile AccountProfile;
// TODO: Set AccountProfile
GUA_NAMESPACE::GUAAccountService::Register("Account", "PassWord", "VerifyCode", "86", AccountProfile);