Skip to main content

GUAAccountResultObservers

[Shared by Player Network SDK and MSDK] Register the callback for the custom account module. The game needs to handle the callback.For more information about the callback data structure, see GUAAccountResult.

note

It is strongly recommended that games register in the application startup function.

Function Definition

List of methods used to handle callback events

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

Code Example

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

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

// AccountEvents callback handling
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);
}