//
// GJMultiplayerManager::onJoinLobbyCompleted from 0x100738d90 to 0x10073958e (2046 bytes)
//
// 1 xrefs:
// > GJMultiplayerManager::handleIt @ 0x100738a25
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 12:36:26 +0000
//
void __fastcall GJMultiplayerManager::onJoinLobbyCompleted(__int64 *a1, unsigned __int8 *a2, __int64 a3)
{
const char *v4; // rbx
unsigned int v5; // r15d
const void *v6; // rdi
unsigned __int64 v7; // rcx
char *v8; // rbx
size_t v9; // rdx
__int64 v10; // r13
__int64 v11; // rax
const char *CString; // r15
size_t v13; // rax
size_t v14; // r14
__int64 v15; // rdi
size_t v16; // r12
__int64 v17; // rdi
__int64 v18; // rax
const char *v19; // rbx
size_t v20; // rax
size_t v21; // r14
char *v22; // r15
size_t v23; // r12
unsigned int v24; // r15d
__int64 v25; // rax
const char *v26; // rbx
size_t v27; // rax
size_t v28; // r14
char *v29; // r12
size_t v30; // r15
__int64 v31; // r14
unsigned int v32; // eax
int v33; // r15d
__int64 v34; // rax
__int64 v35; // rax
const char *v36; // r12
size_t v37; // rax
size_t v38; // r13
char *v39; // r15
size_t v40; // rbx
__int64 v41; // rax
int v42; // r12d
char *v43; // rax
__int64 v44; // r14
char v45; // bl
__int64 v46; // rax
const char *v47; // rbx
size_t v48; // rax
size_t v49; // r14
char *v50; // r15
size_t v51; // r12
char v52; // al
unsigned int v53; // r14d
__int128 *v54; // rbx
__int64 v55; // rsi
__int128 *v56; // r14
__int64 v57; // rax
const char *v58; // r12
size_t v59; // rax
size_t v60; // r13
char *v61; // r15
__int64 v62; // rax
size_t v63; // rbx
char v64; // r12
int v65; // r14d
void (__fastcall ***v66)(_QWORD, _QWORD); // rdi
timeb v67; // [rsp+8h] [rbp-108h] BYREF
__int64 v68; // [rsp+18h] [rbp-F8h]
__int128 v69; // [rsp+20h] [rbp-F0h] BYREF
void *v70; // [rsp+30h] [rbp-E0h]
std::string __str; // [rsp+40h] [rbp-D0h] BYREF
__int64 v72; // [rsp+58h] [rbp-B8h]
_QWORD __dst[2]; // [rsp+60h] [rbp-B0h] BYREF
void *v74; // [rsp+70h] [rbp-A0h]
_QWORD __s2[2]; // [rsp+78h] [rbp-98h] BYREF
void *v76; // [rsp+88h] [rbp-88h]
__int64 v77; // [rsp+90h] [rbp-80h]
int v78; // [rsp+9Ch] [rbp-74h]
__int64 v79; // [rsp+A0h] [rbp-70h]
__int64 v80; // [rsp+A8h] [rbp-68h] BYREF
size_t v81; // [rsp+B0h] [rbp-60h]
void *v82; // [rsp+B8h] [rbp-58h]
unsigned int v83; // [rsp+C4h] [rbp-4Ch]
__int64 *v84; // [rsp+C8h] [rbp-48h]
__int128 v85; // [rsp+D0h] [rbp-40h] BYREF
void *__p; // [rsp+E0h] [rbp-30h]
v84 = a1;
if ( (*(_BYTE *)a3 & 1) != 0 )
{
GJMultiplayerManager::removeDLFromActive(v84, *(_QWORD *)(a3 + 16));
if ( (*(_BYTE *)a3 & 1) != 0 )
goto LABEL_3;
}
else
{
GJMultiplayerManager::removeDLFromActive(v84, a3 + 1);
if ( (*(_BYTE *)a3 & 1) != 0 )
{
LABEL_3:
v4 = *(const char **)(a3 + 16);
goto LABEL_6;
}
}
v4 = (const char *)(a3 + 1);
LABEL_6:
v5 = atoi(v4);
LOBYTE(__s2[0]) = 4;
*(_WORD *)((char *)__s2 + 1) = 12589;
BYTE3(__s2[0]) = 0;
v6 = a2 + 1;
v7 = *a2 >> 1;
if ( (*a2 & 1) != 0 )
v6 = *((const void **)a2 + 2);
v8 = (char *)__s2 + 1;
if ( (*a2 & 1) != 0 )
v7 = *((_QWORD *)a2 + 1);
v9 = 2;
if ( v7 < 2 )
v9 = v7;
if ( !((v7 != 2) | (memcmp(v6, (char *)__s2 + 1, v9) != 0))
|| (v10 = sub_10073A180(a2, "#"), (unsigned int)sub_1007FEF90(v10) < 3) )
{
v15 = v84[44];
if ( v15 )
(*(void (__fastcall **)(__int64, _QWORD, _QWORD))(*(_QWORD *)v15 + 8LL))(v15, v5, 0);
return;
}
v11 = cocos2d::CCArray::stringAtIndex(v10, 0);
CString = (const char *)cocos2d::CCString::getCString(v11);
v13 = strlen(CString);
if ( v13 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v14 = v13;
if ( v13 >= 0x17 )
{
v16 = 26;
if ( (v13 | 7) != 0x17 )
v16 = (v13 | 7) + 1;
v8 = (char *)operator new(v16);
v76 = v8;
__s2[0] = v16 + 1;
__s2[1] = v14;
goto LABEL_23;
}
LOBYTE(__s2[0]) = 2 * v13;
if ( v13 )
LABEL_23:
memmove(v8, CString, v14);
v8[v14] = 0;
v17 = cocos2d::CCArray::stringAtIndex(v10, 1);
v83 = cocos2d::CCString::intValue(v17);
v72 = sub_1007FE900(v17);
v18 = cocos2d::CCArray::stringAtIndex(v10, 2);
v19 = (const char *)cocos2d::CCString::getCString(v18);
v20 = strlen(v19);
if ( v20 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v21 = v20;
if ( v20 >= 0x17 )
{
v23 = 26;
if ( (v20 | 7) != 0x17 )
v23 = (v20 | 7) + 1;
v22 = (char *)operator new(v23);
v74 = v22;
__dst[0] = v23 | 1;
__dst[1] = v21;
}
else
{
LOBYTE(__dst[0]) = 2 * v20;
v22 = (char *)__dst + 1;
if ( !v20 )
goto LABEL_32;
}
memmove(v22, v19, v21);
LABEL_32:
v22[v21] = 0;
v77 = sub_10073A180(__dst, ";");
v24 = 0;
v68 = v10;
while ( v24 < (unsigned int)sub_1007FEF90(v77) )
{
LODWORD(v79) = v24;
v25 = cocos2d::CCArray::stringAtIndex(v77, v24);
v26 = (const char *)cocos2d::CCString::getCString(v25);
v27 = strlen(v26);
if ( v27 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v28 = v27;
if ( v27 >= 0x17 )
{
v30 = (v27 | 7) + 1;
if ( (v27 | 7) == 0x17 )
v30 = 26;
v29 = (char *)operator new(v30);
v82 = v29;
v80 = v30 | 1;
v81 = v28;
LABEL_42:
memmove(v29, v26, v28);
goto LABEL_43;
}
LOBYTE(v80) = 2 * v27;
v29 = (char *)&v80 + 1;
if ( v27 )
goto LABEL_42;
LABEL_43:
v29[v28] = 0;
v31 = sub_10073A180(&v80, ",");
v32 = sub_1007FEF90(v31);
v33 = v79;
if ( v32 < 3 )
goto LABEL_59;
v34 = cocos2d::CCArray::stringAtIndex(v31, 0);
v78 = cocos2d::CCString::intValue(v34);
v35 = cocos2d::CCArray::stringAtIndex(v31, 1);
v36 = (const char *)cocos2d::CCString::getCString(v35);
v37 = strlen(v36);
if ( v37 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v38 = v37;
if ( v37 >= 0x17 )
{
v40 = (v37 | 7) + 1;
if ( (v37 | 7) == 0x17 )
v40 = 26;
v39 = (char *)operator new(v40);
__p = v39;
*(_QWORD *)&v85 = v40 | 1;
*((_QWORD *)&v85 + 1) = v38;
}
else
{
LOBYTE(v85) = 2 * v37;
v39 = (char *)&v85 + 1;
if ( !v37 )
goto LABEL_52;
}
memmove(v39, v36, v38);
LABEL_52:
v39[v38] = 0;
v41 = cocos2d::CCArray::stringAtIndex(v31, 2);
v42 = cocos2d::CCString::intValue(v41);
v43 = GJUserScore::create_1();
v10 = v68;
v33 = v79;
v44 = (__int64)v43;
*((_DWORD *)v43 + 94) = v78;
v45 = v85;
if ( (v85 & 1) != 0 )
{
sub_10001AD30(&__str, __p, *((unsigned __int64 *)&v85 + 1));
}
else
{
__str.__r_.__value_.__r.__words[2] = (std::string::size_type)__p;
*(_OWORD *)&__str.__r_.__value_.__l.0 = v85;
}
std::string::operator=((std::string *)(v44 + 320), &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__str.__r_.__value_.__l.__data_);
ftime(&v67);
*(double *)(v44 + 752) = (float)((float)v42 * -1000.0) + (double)v67.millitm / 1000.0 + (double)SLODWORD(v67.time);
cocos2d::CCDictionary::setObject_1(v84[41], v44, v78);
sub_1007FEBF0(v72, v44);
if ( (v45 & 1) != 0 )
operator delete(__p);
LABEL_59:
if ( (v80 & 1) != 0 )
operator delete(v82);
v24 = v33 + 1;
}
cocos2d::CCDictionary::setObject_1(v84[42], v72, (int)v83);
if ( (unsigned int)sub_1007FEF90(v10) < 4 )
goto LABEL_95;
v46 = cocos2d::CCArray::stringAtIndex(v10, 3);
v47 = (const char *)cocos2d::CCString::getCString(v46);
v48 = strlen(v47);
if ( v48 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v49 = v48;
if ( v48 >= 0x17 )
{
v51 = 26;
if ( (v48 | 7) != 0x17 )
v51 = (v48 | 7) + 1;
v50 = (char *)operator new(v51);
v82 = v50;
v80 = v51 | 1;
v81 = v49;
goto LABEL_69;
}
LOBYTE(v80) = 2 * v48;
v50 = (char *)&v80 + 1;
if ( v48 )
LABEL_69:
memmove(v50, v47, v49);
v50[v49] = 0;
v52 = v80 & 1;
if ( (v80 & 1) != 0 )
{
if ( !v81 )
goto LABEL_93;
LABEL_74:
v79 = sub_10073A180(&v80, "|");
v53 = 0;
v54 = &v69;
while ( 2 )
{
if ( v53 >= (unsigned int)sub_1007FEF90(v79) )
{
v52 = v80 & 1;
goto LABEL_93;
}
v55 = v53;
v56 = v54;
LODWORD(v77) = v55;
v57 = cocos2d::CCArray::stringAtIndex(v79, v55);
v58 = (const char *)cocos2d::CCString::getCString(v57);
v59 = strlen(v58);
if ( v59 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v60 = v59;
if ( v59 >= 0x17 )
{
v62 = v59 | 7;
v63 = 26;
if ( (v60 | 7) != 0x17 )
v63 = v62 + 1;
v61 = (char *)operator new(v63);
__p = v61;
*(_QWORD *)&v85 = v63 | 1;
*((_QWORD *)&v85 + 1) = v60;
v54 = v56;
}
else
{
LOBYTE(v85) = 2 * v59;
v61 = (char *)&v85 + 1;
if ( !v59 )
goto LABEL_85;
}
memmove(v61, v58, v60);
LABEL_85:
v61[v60] = 0;
v64 = v85;
v65 = v77;
if ( (v85 & 1) != 0 )
{
sub_10001AD30(v54, __p, *((unsigned __int64 *)&v85 + 1));
}
else
{
v70 = __p;
v69 = v85;
}
GJMultiplayerManager::addComment(v84, v54, v83);
if ( (v69 & 1) != 0 )
operator delete(v70);
if ( (v64 & 1) != 0 )
operator delete(__p);
v53 = v65 + 1;
continue;
}
}
if ( (unsigned __int8)v80 >> 1 )
goto LABEL_74;
LABEL_93:
if ( v52 )
operator delete(v82);
LABEL_95:
v66 = (void (__fastcall ***)(_QWORD, _QWORD))v84[44];
if ( v66 )
(**v66)(v66, v83);
if ( (__dst[0] & 1) != 0 )
operator delete(v74);
if ( (__s2[0] & 1) != 0 )
operator delete(v76);
}