//
// GameLevelManager::getLevelComments from 0x3d1d90 to 0x3d1f54 (452 bytes)
//
// 2 xrefs:
// > InfoLayer::updateUserScoreFinished @ 0x42f33c
// > InfoLayer::loadPage @ 0x42feac
//
// 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::getLevelComments(GameLevelManager *a1, int a2, int a3, int a4, int a5, CommentKeyType a6)
{
cocos2d::CCString *v10; // r0
const char *CString; // r0
cocos2d::CCString *v12; // r0
char *v13; // r0
char *v14; // r1
cocos2d::CCString *v15; // r0
char *v16; // r0
GameManager *v17; // r0
int v19; // r9
GameManager *v20; // r0
cocos2d::CCString *v21; // r0
char *v22; // r1
char *v23; // r0
char *v24; // [sp+14h] [bp-20h] BYREF
char *v25; // [sp+18h] [bp-1Ch] BYREF
_BYTE v26[4]; // [sp+1Ch] [bp-18h] BYREF
char *v27; // [sp+20h] [bp-14h] BYREF
const char *v28; // [sp+24h] [bp-10h] BYREF
char *v29; // [sp+28h] [bp-Ch] BYREF
GameLevelManager::getCommentKey((int)&v24, (int)a1, (const char *)a2, a3, a5, a6);
if ( GameLevelManager::isDLActive(a1, v24) )
goto LABEL_18;
GameLevelManager::addDLToActive(a1, v24);
GameLevelManager::getBasePostString((GameLevelManager *)&v25);
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfd",
"2893",
103,
98,
&aO1i2r3e45s7t89[10]);
CString = cocos2d::CCString::getCString(v10);
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&page=%i&total=%i&secret=%s&mode=%i",
(const char *)a3,
a4,
CString,
a5);
v13 = (char *)cocos2d::CCString::getCString(v12);
sub_774544((int)&v25, v13);
if ( a6 == 1 )
v14 = "&userID=";
else
v14 = "&levelID=";
sub_774544((int)&v25, v14);
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", (const char *)a2);
v16 = (char *)cocos2d::CCString::getCString(v15);
sub_774544((int)&v25, v16);
v17 = GameManager::sharedState();
if ( GameManager::getGameVariable(v17, "0088") )
v19 = 20;
else
v19 = 10;
v20 = GameManager::sharedState();
if ( GameManager::getGameVariable(v20, "0094") )
{
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&count=%i",
(const char *)(2 * v19));
LABEL_15:
v23 = (char *)cocos2d::CCString::getCString(v21);
sub_774544((int)&v25, v23);
goto LABEL_12;
}
if ( v19 != 10 )
{
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"&count=%i", (const char *)v19);
goto LABEL_15;
}
LABEL_12:
if ( a6 == 1 )
v22 = "https://www.boomlings.com/database/getGJCommentHistory.php";
else
v22 = "https://www.boomlings.com/database/getGJComments21.php";
sub_776584((int)v26, v22);
sub_775C20(&v27);
sub_776584((int)&v28, v25);
sub_775C20(&v29);
GameLevelManager::ProcessHttpRequest(a1, &v27, &v28, &v29, 12);
sub_774008(&v29);
sub_774008(&v28);
sub_774008(&v27);
sub_774008(v26);
sub_774008(&v25);
LABEL_18:
sub_774008(&v24);
}