//
// GJMultiplayerManager::onJoinLobbyCompleted from 0x641a30 to 0x641d7e (846 bytes)
//
// 1 xrefs:
// > GJMultiplayerManager::handleIt @ 0x641df2
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:55:29 +0000
//
int __fastcall GJMultiplayerManager::onJoinLobbyCompleted(int a1, unsigned __int8 *a2, int a3)
{
const char *v6; // r1
const char *v7; // r0
_BOOL4 v8; // r7
int result; // r0
int (*v10)(void); // r3
cocos2d::CCArray *v11; // r6
cocos2d::CCString *v12; // r0
const char *CString; // r8
size_t v14; // r0
cocos2d::CCString *v15; // r0
cocos2d::CCArray *v16; // r10
cocos2d::CCString *v17; // r0
const char *v18; // r8
size_t v19; // r0
cocos2d::CCArray *v20; // r11
unsigned int i; // r9
cocos2d::CCString *v22; // r0
const char *v23; // r8
size_t v24; // r0
cocos2d::CCArray *v25; // r7
cocos2d::CCString *v26; // r0
cocos2d::CCString *v27; // r0
const char *v28; // r8
size_t v29; // r0
cocos2d::CCString *v30; // r0
GJUserScore *v31; // s16
cocos2d::CCNode *v32; // r7
cocos2d::CCString *v33; // r0
const char *v34; // r6
size_t v35; // r0
int v36; // r3
unsigned int v37; // r6
cocos2d::CCArray *v38; // r11
cocos2d::CCString *v39; // r0
size_t v40; // r0
void (__fastcall ***v41)(_DWORD, cocos2d::CCArray *); // r0
cocos2d::CCArray *v42; // [sp+0h] [bp-5Ch]
cocos2d::CCArray *v43; // [sp+0h] [bp-5Ch]
int v44; // [sp+4h] [bp-58h]
int v45; // [sp+10h] [bp-4Ch] BYREF
int v46; // [sp+14h] [bp-48h]
int v47[3]; // [sp+18h] [bp-44h] BYREF
int v48[3]; // [sp+24h] [bp-38h] BYREF
int v49; // [sp+30h] [bp-2Ch] BYREF
int v50; // [sp+34h] [bp-28h]
int v51; // [sp+38h] [bp-24h]
int v52[3]; // [sp+3Ch] [bp-20h] BYREF
int v53; // [sp+48h] [bp-14h] BYREF
int v54; // [sp+4Ch] [bp-10h]
int v55; // [sp+50h] [bp-Ch]
if ( (*(_BYTE *)a3 & 1) != 0 )
v6 = *(const char **)(a3 + 8);
else
v6 = (const char *)(a3 + 1);
GJMultiplayerManager::removeDLFromActive((GJMultiplayerManager *)a1, v6);
if ( (*(_BYTE *)a3 & 1) != 0 )
v7 = *(const char **)(a3 + 8);
else
v7 = (const char *)(a3 + 1);
v53 = 0;
v54 = 0;
v55 = 0;
atoi(v7);
std::string::__init(&v53, "-1", 2u);
v8 = sub_641032(a2, (unsigned __int8 *)&v53);
std::string::~string((int)&v53);
if ( v8 )
{
result = *(_DWORD *)(a1 + 280);
if ( !result )
return result;
v10 = *(int (**)(void))(*(_DWORD *)result + 4);
return v10();
}
v11 = sub_641444((cocos2d::CCArray *)a2, "#");
if ( cocos2d::CCArray::count(v11) <= 2u )
{
result = *(_DWORD *)(a1 + 280);
if ( !result )
return result;
v10 = *(int (**)(void))(*(_DWORD *)result + 4);
return v10();
}
v12 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v11, 0);
memset(v47, 0, sizeof(v47));
CString = (const char *)cocos2d::CCString::getCString(v12);
v14 = strlen(CString);
std::string::__init(v47, CString, v14);
v15 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v11, 1u);
v16 = (cocos2d::CCArray *)cocos2d::CCString::intValue(v15);
v42 = (cocos2d::CCArray *)cocos2d::CCArray::create(v16);
v17 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v11, 2u);
v18 = (const char *)cocos2d::CCString::getCString(v17);
memset(v48, 0, sizeof(v48));
v19 = strlen(v18);
std::string::__init(v48, v18, v19);
v20 = sub_641444((cocos2d::CCArray *)v48, ";");
for ( i = 0; i < cocos2d::CCArray::count(v20); ++i )
{
v22 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v20, i);
v23 = (const char *)cocos2d::CCString::getCString(v22);
v49 = 0;
v50 = 0;
v51 = 0;
v24 = strlen(v23);
std::string::__init(&v49, v23, v24);
v25 = sub_641444((cocos2d::CCArray *)&v49, ",");
if ( cocos2d::CCArray::count(v25) > 2u )
{
v26 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v25, 0);
v44 = cocos2d::CCString::intValue(v26);
v27 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v25, 1u);
v28 = (const char *)cocos2d::CCString::getCString(v27);
v53 = 0;
v54 = 0;
v55 = 0;
v29 = strlen(v28);
std::string::__init(&v53, v28, v29);
v30 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v25, 2u);
v31 = (GJUserScore *)cocos2d::CCString::intValue(v30);
v32 = GJUserScore::create(v31);
*((_DWORD *)v32 + 74) = v44;
std::string::basic_string(v52, (int)&v53);
std::string::operator=((unsigned __int8 *)v32 + 264, (unsigned __int8 *)v52);
std::string::~string((int)v52);
clock_gettime(0, (struct timespec *)&v45);
*((double *)v32 + 72) = (double)v45 + (double)v46 / 1000000000.0 - (float)((float)(int)v31 * 1000.0);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 268), v32, v44);
cocos2d::CCArray::addObject(v42, v32);
std::string::~string((int)&v53);
}
std::string::~string((int)&v49);
}
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 272), v42, (int)v16);
if ( cocos2d::CCArray::count(v11) > 3u )
{
v33 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v11, 3u);
v34 = (const char *)cocos2d::CCString::getCString(v33);
v49 = 0;
v50 = 0;
v51 = 0;
v35 = strlen(v34);
std::string::__init(&v49, v34, v35);
if ( (v49 & 1) != 0 )
v36 = v50;
else
v36 = (int)(unsigned __int8)v49 >> 1;
if ( v36 )
{
v37 = 0;
v38 = sub_641444((cocos2d::CCArray *)&v49, "|");
while ( v37 < cocos2d::CCArray::count(v38) )
{
v39 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v38, v37);
v43 = (cocos2d::CCArray *)cocos2d::CCString::getCString(v39);
memset(v52, 0, sizeof(v52));
v40 = strlen((const char *)v43);
std::string::__init(v52, v43, v40);
std::string::basic_string(&v53, (int)v52);
GJMultiplayerManager::addComment(a1, (int)&v53, (int)v16);
++v37;
std::string::~string((int)&v53);
std::string::~string((int)v52);
}
}
std::string::~string((int)&v49);
}
v41 = *(void (__fastcall ****)(_DWORD, cocos2d::CCArray *))(a1 + 280);
if ( v41 )
(**v41)(v41, v16);
std::string::~string((int)v48);
return std::string::~string((int)v47);
}