//
// GJMultiplayerManager::joinLobby from 0xac68c4 to 0xac6b44 (640 bytes)
//
// 2 xrefs:
// > MPLobbyLayer::onUpdateLobby @ 0xb0562c
// > ??> @ 0xada70
//
// This function is hookable on this platform (idp: arm, 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 13:01:07 +0000
//
__int64 __fastcall GJMultiplayerManager::joinLobby(GJMultiplayerManager *this, const char *a2)
{
unsigned int v3; // w22
cocos2d::CCString *v4; // x0
char *CString; // x21
_BOOL4 isDLActive; // w1
__int64 result; // x0
unsigned int LastCommentIDForGame; // w24
cocos2d::CCString *v9; // x0
__int64 v10; // x0
cocos2d::CCString *v11; // x0
size_t v12; // x0
size_t v13; // x0
char *v14; // [xsp+58h] [xbp+58h]
__int64 v15; // [xsp+68h] [xbp+68h] BYREF
size_t v16; // [xsp+70h] [xbp+70h]
void *v17; // [xsp+78h] [xbp+78h]
__int64 v18[2]; // [xsp+80h] [xbp+80h] BYREF
void *v19; // [xsp+90h] [xbp+90h]
__int64 v20; // [xsp+98h] [xbp+98h] BYREF
size_t v21; // [xsp+A0h] [xbp+A0h]
void *v22; // [xsp+A8h] [xbp+A8h]
__int64 v23[2]; // [xsp+B0h] [xbp+B0h] BYREF
void *v24; // [xsp+C0h] [xbp+C0h]
v3 = (unsigned int)a2;
v4 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i_joinLobby", a2);
CString = (char *)cocos2d::CCString::getCString(v4);
isDLActive = GJMultiplayerManager::isDLActive(this, CString);
result = 0;
if ( !isDLActive )
{
GJMultiplayerManager::addDLToActive(this, CString);
GJMultiplayerManager::getBasePostString(&v15);
LastCommentIDForGame = GJMultiplayerManager::getLastCommentIDForGame((cocos2d::CCDictionary **)this, v3);
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfv",
"3899",
103,
99,
"9");
v10 = cocos2d::CCString::getCString(v9);
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&gameID=%i&lastCommentID=%i&secret=%s",
(const char *)v3,
LastCommentIDForGame,
v10);
v14 = (char *)cocos2d::CCString::getCString(v11);
v12 = strlen(v14);
std::string::append((__int64)&v15, v14, v12);
v18[0] = 0;
v18[1] = 0;
v19 = nullptr;
std::string::__init(v18, "https://www.geometrydash.com/database/joinMPLobby.php", 0x35u);
v20 = 0;
v21 = 0;
v22 = nullptr;
if ( (v15 & 1) != 0 )
{
std::string::__init(&v20, v17, v16);
}
else
{
v22 = v17;
v20 = v15;
v21 = v16;
}
v23[0] = 0;
v23[1] = 0;
v24 = nullptr;
v13 = strlen(CString);
std::string::__init(v23, CString, v13);
GJMultiplayerManager::ProcessHttpRequest(this, v18, (__int64)&v20, (__int64)v23, 63);
if ( (v23[0] & 1) != 0 )
operator delete(v24);
if ( (v20 & 1) != 0 )
operator delete(v22);
if ( (v18[0] & 1) != 0 )
operator delete(v19);
if ( (v15 & 1) != 0 )
operator delete(v17);
return 1;
}
return result;
}