//
// GJMultiplayerManager::joinLobby from 0x100739c90 to 0x100739f71 (737 bytes)
//
// 1 xrefs:
// > MPLobbyLayer::onUpdateLobby @ 0x10048ac77
//
// 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
//
bool __fastcall GJMultiplayerManager::joinLobby(__int64 a1, int a2)
{
__int64 v2; // rax
char *CString; // r14
__int64 v4; // rax
void *v5; // rax
__int64 v6; // rax
__int64 v7; // r13
unsigned int v8; // ebx
int v9; // r12d
int v10; // r14d
unsigned int v11; // eax
__int64 v12; // rax
__int64 v13; // rax
const std::string::value_type *v14; // rax
__int64 v15; // r14
char *v16; // r13
size_t v17; // rax
size_t v18; // r15
char *v19; // rbx
size_t v20; // r12
char v22; // [rsp+0h] [rbp-B0h]
char v23; // [rsp+0h] [rbp-B0h]
std::string v24; // [rsp+18h] [rbp-98h] BYREF
__int128 v25; // [rsp+30h] [rbp-80h] BYREF
void *data; // [rsp+40h] [rbp-70h]
__int64 v27; // [rsp+48h] [rbp-68h]
char *__s; // [rsp+50h] [rbp-60h]
_QWORD __dst[2]; // [rsp+58h] [rbp-58h] BYREF
void *__p; // [rsp+68h] [rbp-48h]
std::string v31; // [rsp+70h] [rbp-40h] BYREF
v2 = sub_10088E820("%i_joinLobby", v22);
CString = (char *)cocos2d::CCString::getCString(v2);
v4 = sub_1007399B0(a1, CString);
if ( !v4 )
{
v5 = cocos2d::CCNode::create();
__s = CString;
sub_100739AC0(a1, CString, (__int64)v5);
GJMultiplayerManager::getBasePostString(&v31);
v27 = a1;
v6 = cocos2d::CCDictionary::objectForKey_1(*(_QWORD *)(a1 + 344), a2);
v7 = v6;
if ( v6 && (unsigned int)sub_1007FEF90(v6) && (unsigned int)sub_1007FEF90(v7) )
{
v8 = 0;
v9 = 0;
do
{
v10 = *(_DWORD *)(sub_1007FEFE0(v7, v8) + 368);
v11 = sub_1007FEF90(v7);
++v8;
if ( v10 > v9 )
v9 = v10;
}
while ( v8 < v11 );
}
v12 = sub_10088E820("%c%s%s%c%c%s", (char)"9");
cocos2d::CCString::getCString(v12);
v13 = sub_10088E820("&gameID=%i&lastCommentID=%i&secret=%s", v23);
v14 = (const std::string::value_type *)cocos2d::CCString::getCString(v13);
std::string::append(&v31, v14);
v24.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x38u);
v24.__r_.__value_.__r.__words[0] = 57;
v24.__r_.__value_.__l.__size_ = 53;
strcpy(v24.__r_.__value_.__l.__data_, "https://www.geometrydash.com/database/joinMPLobby.php");
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) != 0 )
{
sub_10001AD30(&v25, v31.__r_.__value_.__l.__data_, v31.__r_.__value_.__l.__size_);
}
else
{
data = v31.__r_.__value_.__l.__data_;
v25 = *(_OWORD *)&v31.__r_.__value_.__l.0;
}
v15 = v27;
v16 = __s;
v17 = strlen(__s);
if ( v17 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v18 = v17;
if ( v17 >= 0x17 )
{
v20 = 26;
if ( (v17 | 7) != 0x17 )
v20 = (v17 | 7) + 1;
v19 = (char *)operator new(v20);
__p = v19;
__dst[0] = v20 | 1;
__dst[1] = v18;
}
else
{
LOBYTE(__dst[0]) = 2 * v17;
v19 = (char *)__dst + 1;
if ( !v17 )
{
LABEL_20:
v19[v18] = 0;
GJMultiplayerManager::ProcessHttpRequest(v15, &v24, (__int64)&v25, (__int64)__dst, 63);
if ( (__dst[0] & 1) != 0 )
{
operator delete(__p);
if ( (v25 & 1) == 0 )
{
LABEL_22:
if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_23;
goto LABEL_29;
}
}
else if ( (v25 & 1) == 0 )
{
goto LABEL_22;
}
operator delete(data);
if ( (*(_BYTE *)&v24.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_23:
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_25:
v4 = 0;
return v4 == 0;
}
LABEL_24:
operator delete(v31.__r_.__value_.__l.__data_);
goto LABEL_25;
}
LABEL_29:
operator delete(v24.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_25;
goto LABEL_24;
}
}
memmove(v19, v16, v18);
goto LABEL_20;
}
return v4 == 0;
}