//
// GameLevelManager::acceptFriendRequest from 0x1000a8ce4 to 0x1000a8ec4 (480 bytes)
//
// 1 xrefs:
// > FriendRequestPopup::onAccept @ 0x1002d9ac8
//
// 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 __fastcall GameLevelManager::acceptFriendRequest(GameLevelManager *a1, int a2, int a3)
{
bool result; // w0
cocos2d::CCString *v7; // x0
char *CString; // x20
cocos2d::CCDictionary *m_friendReqAndUserBlocks; // x23
__int64 v10; // x0
__int64 v11; // x23
cocos2d::CCDictionary *v12; // x23
cocos2d::CCNode *v13; // x24
cocos2d::CCString *v14; // x0
const char *v15; // x0
cocos2d::CCString *v16; // x0
const char *v17; // x0
std::string *v18; // x1
void *__p[2]; // [xsp+30h] [xbp-90h] BYREF
char v20; // [xsp+47h] [xbp-79h]
void *v21[2]; // [xsp+48h] [xbp-78h] BYREF
char v22; // [xsp+5Fh] [xbp-61h]
std::string v23; // [xsp+60h] [xbp-60h] BYREF
std::string v24; // [xsp+78h] [xbp-48h] BYREF
result = 0;
if ( a2 >= 1 && a3 >= 1 )
{
v7 = (cocos2d::CCString *)sub_100268F4C("accFriendReq_%i_%i", a2, a3);
CString = (char *)cocos2d::CCString::getCString(v7);
m_friendReqAndUserBlocks = a1->m_friendReqAndUserBlocks;
sub_100009900(&v24, CString);
v10 = cocos2d::CCDictionary::objectForKey_1(m_friendReqAndUserBlocks, &v24);
v11 = v10;
if ( SHIBYTE(v24.__r_.__value_.__r.__words[2]) < 0 )
{
operator delete(v24.__r_.__value_.__l.__data_);
if ( v11 )
return 0;
}
else if ( v10 )
{
return 0;
}
v12 = a1->m_friendReqAndUserBlocks;
v13 = cocos2d::CCNode::create();
sub_100009900(&v24, CString);
cocos2d::CCDictionary::setObject_1(v12, v13, &v24);
if ( SHIBYTE(v24.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v24.__r_.__value_.__l.__data_);
GameLevelManager::getBasePostString(&v24);
v14 = (cocos2d::CCString *)sub_100268F4C("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, "7");
v15 = cocos2d::CCString::getCString(v14);
v16 = (cocos2d::CCString *)sub_100268F4C("&targetAccountID=%i&requestID=%i&secret=%s", a2, a3, v15);
v17 = cocos2d::CCString::getCString(v16);
std::string::append(&v24, v17);
sub_100009900(&v23, "https://www.boomlings.com/database/acceptGJFriendRequest20.php");
if ( (v24.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v18 = &v24;
else
v18 = (std::string *)v24.__r_.__value_.__r.__words[0];
sub_100009900(v21, (char *)v18);
sub_100009900(__p, CString);
GameLevelManager::ProcessHttpRequest(a1, &v23, (char *)v21, (const std::string::value_type *)__p, 31);
if ( v20 < 0 )
operator delete(__p[0]);
if ( v22 < 0 )
operator delete(v21[0]);
if ( SHIBYTE(v23.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v23.__r_.__value_.__l.__data_);
if ( SHIBYTE(v24.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v24.__r_.__value_.__l.__data_);
return 1;
}
return result;
}