//
// GameLevelManager::acceptFriendRequest from 0x140255710 to 0x140255a58 (840 bytes)
//
// 2 xrefs:
// > FriendRequestPopup::onAccept @ 0x1403a2a8b
// > ??> @ 0x14091c5a4
//
// This function is hookable on this platform (idp: pc, 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 11:28:44 +0000
//
// Hidden C++ exception states: #wind=4
char __fastcall GameLevelManager::acceptFriendRequest(__int64 a1, int a2, int a3)
{
cocos2d::CCString *v6; // rax
const char *CString; // rax
const char *v8; // rsi
size_t v9; // rdi
size_t v10; // r8
__int64 v11; // rbx
void *v12; // r8
size_t v13; // r8
__int64 v14; // rbx
__int64 v15; // rax
__int64 v16; // rcx
void *v17; // rcx
cocos2d::CCString *v18; // rax
const char *v19; // rax
cocos2d::CCString *v20; // rax
char *v21; // rax
size_t v22; // r8
size_t v23; // r8
_QWORD *v24; // rdx
__int128 v26; // [rsp+40h] [rbp-79h] BYREF
__int64 v27; // [rsp+50h] [rbp-69h]
__int64 v28; // [rsp+58h] [rbp-61h]
__int128 v29; // [rsp+60h] [rbp-59h] BYREF
__int64 v30; // [rsp+70h] [rbp-49h]
__int64 v31; // [rsp+78h] [rbp-41h]
__int128 *v32; // [rsp+80h] [rbp-39h]
__int128 *v33; // [rsp+88h] [rbp-31h]
void *Block[2]; // [rsp+98h] [rbp-21h] BYREF
__int128 v35; // [rsp+A8h] [rbp-11h]
_QWORD Src[4]; // [rsp+B8h] [rbp-1h] BYREF
if ( a2 <= 0 || a3 <= 0 )
return 0;
v6 = cocos2d::CCString::createWithFormat("accFriendReq_%i_%i", a2, a3);
CString = cocos2d::CCString::getCString(v6);
v8 = CString;
*(_OWORD *)Block = 0;
v35 = 0;
v9 = -1;
v10 = -1;
do
++v10;
while ( CString[v10] );
sub_14003D230(Block, CString, v10);
v11 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 1200), Block);
if ( *((_QWORD *)&v35 + 1) > 0xFu )
{
v12 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v35 + 1) + 1LL) >= 0x1000 )
{
v12 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v12);
}
if ( v11 )
return 0;
*(_OWORD *)Block = 0;
v35 = 0;
v13 = -1;
do
++v13;
while ( v8[v13] );
sub_14003D230(Block, v8, v13);
v14 = *(_QWORD *)(a1 + 1200);
v15 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(v14, v15, Block);
if ( *((_QWORD *)&v35 + 1) > 0xFu )
{
v17 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v35 + 1) + 1LL) >= 0x1000 )
{
v17 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v17 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v17);
}
GameLevelManager::getBasePostString(v16, Src);
v18 = cocos2d::CCString::createWithFormat("%c%s%s%c%c%s", 87, "mfd", "2893", 103, 98, (const char *)&word_14070D040);
v19 = cocos2d::CCString::getCString(v18);
v20 = cocos2d::CCString::createWithFormat("&targetAccountID=%i&requestID=%i&secret=%s", a2, a3, v19);
v21 = (char *)cocos2d::CCString::getCString(v20);
v22 = -1;
do
++v22;
while ( v21[v22] );
sub_140044D80(Src, v21, v22);
v32 = &v26;
v33 = &v29;
v26 = 0;
v27 = 0;
v28 = 0;
v23 = -1;
do
++v23;
while ( v8[v23] );
sub_14003D230(&v26, v8, v23);
v24 = Src;
if ( Src[3] > 0xFu )
v24 = (_QWORD *)Src[0];
v29 = 0;
v30 = 0;
v31 = 0;
do
++v9;
while ( *((_BYTE *)v24 + v9) );
sub_14003D230(&v29, v24, v9);
*(_OWORD *)Block = 0;
v35 = 0u;
Block[0] = sub_14003D460(0x40u);
*(_QWORD *)&v35 = 62;
*((_QWORD *)&v35 + 1) = 63;
strcpy((char *)Block[0], "https://www.boomlings.com/database/acceptGJFriendRequest20.php");
GameLevelManager::ProcessHttpRequest(
(cocos2d::CCActionManager **)a1,
(__int64)Block,
(const char *)&v29,
(const char *)&v26,
0x25u);
sub_14003D310((__int64)Src);
return 1;
}