Skip to main content

GUAAccountResultObservers

[MSDK and Player Network SDK] Registers the callback of the custom account module, the game needs to process the callback function. For more information on the callback data structure, see GUAAccountResult.

note

It is strongly recommended to perform registration in the startup function of the game application.

Function Definition

The list of methods used to process the callback events.

Callback EventCommon[Player Network SDK Only][MSDK Only]
AccountEventsResetPassword,
QueryVerifyCodeStatus,
QueryRegisterStatus,
QueryReceiveEmail,
ModifyAccountWithPassword,
ModifyAccountWithVerifyCode
QueryCanBind,
QueryBindInfo,
QueryAccountProfile,
ModifyProfile,
QueryDataProtectionAcceptance,
ModifyDataProtectionAcceptance,
QueryUserNameStatus
CanBind
event OnResultHandler<GUAAccountResult> AccountEvents;

Code Sample

// Add callbacks
UnionAdapterAPI.GetAccountService().AccountEvents += OnAccountResultEvent;

// Remove callbacks
UnionAdapterAPI.GetAccountService().AccountEvents -= OnAccountResultEvent;

// AccountEvents callback
public void OnAccountResultEvent(GUAAccountResult accountRet)
{
Debug.Log("OnAuthAccountResultEvent in Login");
string methodTag = "";
if (accountRet.MethodId == (int)GUAMethodID.GUA_ACCOUNT_RESET_PASSWORD)
{
methodTag = "ResetPassword";
}
else if (accountRet.MethodId == (int)GUAMethodID.GUA_ACCOUNT_MODIFY_ACCOUNT)
{
methodTag = "ModifyAccount";
}
else if (accountRet.MethodId == (int)GUAMethodID.GUA_ACCOUNT_QUERY_REGISTER_STATUS)
{
methodTag = "QueryRegisterStatus";
}
else if (accountRet.MethodId == (int)GUAMethodID.GUA_ACCOUNT_QUERY_VERIFY_CODE_STATUS)
{
methodTag = "QueryVerifyCodeStatus";
}
else if (accountRet.MethodId == (int)GUAMethodID.GUA_ACCOUNT_QUERY_IS_RECEIVE_EMAIL)
{
methodTag = "QueryIsReceiveEmail";
}
Debug.Log("OnLoginResultEvent start format json");
Debug.Log(methodTag + loginRet);
}