//
// GameLevelManager::getUsers from 0x721d00 to 0x7220f8 (1016 bytes)
//
// 2 xrefs:
// > LevelBrowserLayer::loadPage @ 0x6ea834
// > ??> @ 0x870d8
//
// 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
//
void GameLevelManager::getUsers(GameLevelManager *a1, GJSearchObject *a2)
{
char *Key; // x23
double v5; // d0
unsigned int m_total; // w22
const char *v7; // x25
unsigned int m_page; // w21
cocos2d::CCString *v9; // x0
const char *CString; // x0
cocos2d::CCString *v11; // x0
size_t v12; // x0
char *v13; // x0
int *p_m_unknown2; // x0
char *v15; // x0
char *v16; // x0
char *v17; // x0
unsigned int *v18; // x20
int v19; // w1
unsigned int *v20; // x1
int v21; // w2
unsigned int *v22; // x1
int v23; // w2
unsigned int *p_timeoutForConnect; // x1
int timeoutForConnect; // w2
unsigned int *v26; // x1
int v27; // w2
const char *v28; // [xsp+58h] [xbp+58h]
char *v29; // [xsp+80h] [xbp+80h] BYREF
const char *v30; // [xsp+88h] [xbp+88h] BYREF
const char *v31; // [xsp+90h] [xbp+90h] BYREF
const char *v32; // [xsp+98h] [xbp+98h] BYREF
cocos2d::extension::CCHttpClient *v33; // [xsp+A0h] [xbp+A0h] BYREF
Key = (char *)GJSearchObject::getKey(a2);
if ( !GameLevelManager::isDLActive(a1, Key) )
{
GameLevelManager::addDLToActive(a1, Key);
GameLevelManager::getBasePostString(a1, (__int64)&v29);
*(_QWORD *)&v5 = sub_D18D28(&v30).n128_u64[0];
m_total = a2->m_total;
v7 = v30;
m_page = a2->m_page;
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)off_50 + 7,
"mfd",
"2893",
103,
98,
"7",
v5);
CString = cocos2d::CCString::getCString(v9);
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&str=%s&total=%i&page=%i&secret=%s",
v7,
m_total,
m_page,
CString);
v28 = cocos2d::CCString::getCString(v11);
v12 = strlen(v28);
sub_D15FD4(&v29, v28, v12);
v13 = (char *)(v30 - 24);
if ( v30 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v20 = (unsigned int *)(v30 - 8);
do
v21 = __ldaxr(v20);
while ( __stlxr(v21 - 1, v20) );
}
else
{
v21 = *((_DWORD *)v30 - 2);
*((_DWORD *)v30 - 2) = v21 - 1;
}
if ( v21 <= 0 )
operator delete(v13);
}
sub_D153B8((int)&v31, "https://www.boomlings.com/database/getGJUsers20.php");
sub_D153B8((int)&v32, v29);
sub_D153B8((int)&v33, Key);
GameLevelManager::ProcessHttpRequest(a1, &v31, &v32, &v33, 41);
p_m_unknown2 = &v33[-1].m_unknown2;
if ( &v33[-1].m_unknown2 != (int *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_timeoutForConnect = (unsigned int *)&v33[-1]._timeoutForConnect;
do
timeoutForConnect = __ldaxr(p_timeoutForConnect);
while ( __stlxr(timeoutForConnect - 1, p_timeoutForConnect) );
}
else
{
timeoutForConnect = v33[-1]._timeoutForConnect;
v33[-1]._timeoutForConnect = timeoutForConnect - 1;
}
if ( timeoutForConnect <= 0 )
operator delete(p_m_unknown2);
}
v15 = (char *)(v32 - 24);
if ( v32 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v22 = (unsigned int *)(v32 - 8);
do
v23 = __ldaxr(v22);
while ( __stlxr(v23 - 1, v22) );
}
else
{
v23 = *((_DWORD *)v32 - 2);
*((_DWORD *)v32 - 2) = v23 - 1;
}
if ( v23 <= 0 )
operator delete(v15);
}
v16 = (char *)(v31 - 24);
if ( v31 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v26 = (unsigned int *)(v31 - 8);
do
v27 = __ldaxr(v26);
while ( __stlxr(v27 - 1, v26) );
}
else
{
v27 = *((_DWORD *)v31 - 2);
*((_DWORD *)v31 - 2) = v27 - 1;
}
if ( v27 <= 0 )
operator delete(v16);
}
v17 = v29 - 24;
if ( v29 - 24 != (char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v18 = (unsigned int *)(v29 - 8);
do
v19 = __ldaxr(v18);
while ( __stlxr(v19 - 1, v18) );
}
else
{
v19 = *((_DWORD *)v29 - 2);
*((_DWORD *)v29 - 2) = v19 - 1;
}
if ( v19 <= 0 )
operator delete(v17);
}
}
}