//
// GJAccountManager::onLoginAccountCompleted from 0x4645ac to 0x4646f2 (326 bytes)
//
// 1 xrefs:
// > GJAccountManager::handleIt @ 0x465bd8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
GJAccountLoginDelegate *__fastcall GJAccountManager::onLoginAccountCompleted(
GJAccountManager *a1,
cocos2d::CCArray *a2,
int a3,
int a4)
{
cocos2d::CCString *v6; // r0
char *CString; // r0
int v8; // r10
int v9; // r2
GJAccountLoginDelegate *result; // r0
cocos2d::CCString *v11; // r0
char *v12; // r0
int v13; // r9
int v14; // r2
int v15; // r8
int v16; // r2
cocos2d::CCArray *v17; // r6
cocos2d::CCString *v18; // r0
int v19; // r4
cocos2d::CCString *v20; // r0
int m_accountID; // r3
int v24; // [sp+8h] [bp-8h] BYREF
int v25; // [sp+Ch] [bp-4h]
v24 = a3;
v25 = a4;
GJAccountManager::removeDLFromActive(a1, "login_account");
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)0xFFFFFFF4);
CString = (char *)cocos2d::CCString::getCString(v6);
sub_776584((int)&v24, CString);
v8 = sub_774DBC(a2, &v24);
sub_774008(&v24);
if ( !v8 )
{
result = a1->m_accountLoginDelegate;
if ( result )
return (GJAccountLoginDelegate *)((int (__fastcall *)(GJAccountLoginDelegate *, int, int, void (__fastcall *)(GJAccountLoginDelegate *__hidden, AccountError)))result->loginAccountFailed)(
result,
-12,
v9,
result->loginAccountFailed);
return result;
}
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)0xFFFFFFF3);
v12 = (char *)cocos2d::CCString::getCString(v11);
sub_776584((int)&v24, v12);
v13 = sub_774DBC(a2, &v24);
sub_774008(&v24);
if ( !v13 )
{
result = a1->m_accountLoginDelegate;
if ( result )
return (GJAccountLoginDelegate *)((int (__fastcall *)(GJAccountLoginDelegate *, int, int, void (__fastcall *)(GJAccountLoginDelegate *__hidden, AccountError)))result->loginAccountFailed)(
result,
-13,
v14,
result->loginAccountFailed);
return result;
}
sub_776584((int)&v24, "-1");
v15 = sub_774DBC(a2, &v24);
sub_774008(&v24);
if ( !v15 || (v17 = sub_464224(a2, ","), cocos2d::CCArray::count(v17) <= 1u) )
{
result = a1->m_accountLoginDelegate;
goto LABEL_12;
}
v18 = cocos2d::CCArray::stringAtIndex(v17, 0);
v19 = cocos2d::CCString::intValue(v18);
v20 = cocos2d::CCArray::stringAtIndex(v17, 1u);
v16 = cocos2d::CCString::intValue(v20);
result = a1->m_accountLoginDelegate;
if ( v19 <= 0 )
{
LABEL_12:
if ( result )
return (GJAccountLoginDelegate *)((int (__fastcall *)(GJAccountLoginDelegate *, int, int, void (__fastcall *)(GJAccountLoginDelegate *__hidden, AccountError)))result->loginAccountFailed)(
result,
-1,
v16,
result->loginAccountFailed);
return result;
}
m_accountID = a1->m_accountID;
if ( !m_accountID || m_accountID == v19 )
{
if ( result )
return (GJAccountLoginDelegate *)((int (__fastcall *)(GJAccountLoginDelegate *, int, int, void (__fastcall *)(GJAccountLoginDelegate *__hidden, int, int), GJAccountManager *, cocos2d::CCArray *, int, int))result->loginAccountFinished)(
result,
v19,
v16,
result->loginAccountFinished,
a1,
a2,
v24,
v25);
}
else if ( result )
{
return (GJAccountLoginDelegate *)((int (__fastcall *)(GJAccountLoginDelegate *, int, int, void (__fastcall *)(GJAccountLoginDelegate *__hidden, AccountError)))result->loginAccountFailed)(
result,
-10,
v16,
result->loginAccountFailed);
}
return result;
}