//
// GameLevelManager::rateDemon from 0x3d09c0 to 0x3d0b36 (374 bytes)
//
// 1 xrefs:
// > RateDemonLayer::onRate @ 0x4e6158
//
// 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
//
bool GameLevelManager::rateDemon(GameLevelManager *a1, int a2, int a3, bool a4)
{
_BOOL4 v7; // r10
cocos2d::CCString *v9; // r0
char *CString; // r0
cocos2d::CCDictionary *m_friendReqAndUserBlocks; // r5
char *v12; // r8
int v13; // r5
cocos2d::CCDictionary *v14; // r5
cocos2d::CCString *v15; // r0
const char *v16; // r0
cocos2d::CCString *v17; // r0
char *v18; // r0
cocos2d::CCNode *v19; // [sp+14h] [bp-28h]
char *v20; // [sp+24h] [bp-18h] BYREF
char *v21; // [sp+28h] [bp-14h] BYREF
const char *v22; // [sp+2Ch] [bp-10h] BYREF
std::string v23; // [sp+30h] [bp-Ch] BYREF
v7 = a4;
if ( !a4 )
{
if ( GameLevelManager::hasRatedDemon(a1, a2) )
return 0;
GameLevelManager::markLevelAsRatedDemon(a1, a2);
}
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"rd_%i_%i", (const char *)a2, a3);
CString = (char *)cocos2d::CCString::getCString(v9);
m_friendReqAndUserBlocks = a1->m_friendReqAndUserBlocks;
v12 = CString;
sub_776584((int)&v23, CString);
v13 = cocos2d::CCDictionary::objectForKey(m_friendReqAndUserBlocks, &v23);
sub_774008(&v23);
if ( v13 )
return 0;
v14 = a1->m_friendReqAndUserBlocks;
v19 = cocos2d::CCNode::create();
sub_776584((int)&v23, v12);
cocos2d::CCDictionary::setObject((int)v14, v19);
sub_774008(&v23);
GameLevelManager::getBasePostString((GameLevelManager *)&v20);
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%c%s%s%c%c%s",
(const char *)&dword_54 + 3,
"mfp",
"3879",
103,
99,
&aO1i2r3e45s7t89[5]);
v16 = cocos2d::CCString::getCString(v15);
v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&levelID=%i&rating=%i&secret=%s",
(const char *)a2,
a3,
v16);
v18 = (char *)cocos2d::CCString::getCString(v17);
sub_774544((int)&v20, v18);
if ( v7 )
sub_774544((int)&v20, "&mode=1");
sub_776584((int)&v21, "https://www.boomlings.com/database/rateGJDemon21.php");
sub_776584((int)&v22, v20);
sub_776584((int)&v23, v12);
GameLevelManager::ProcessHttpRequest(a1, &v21, &v22, (char **)&v23, 50);
sub_774008(&v23);
sub_774008(&v22);
sub_774008(&v21);
sub_774008(&v20);
return 1;
}