//
// GameLevelManager::uploadUserMessage from 0x3d1974 to 0x3d1b2a (438 bytes)
//
// 1 xrefs:
// > GJWriteMessagePopup::onSend @ 0x4ac882
//
// 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
//
int __fastcall GameLevelManager::uploadUserMessage(
GameLevelManager *a1,
const char *a2,
int *a3,
const std::string *a4)
{
char *UploadMessageKey; // r0
cocos2d::CCDictionary *m_friendReqAndUserBlocks; // r6
char *v9; // r9
int v10; // r6
int result; // r0
int v12; // r6
cocos2d::CCNode *v13; // r8
int v14; // r11
std::string v15; // r10
cocos2d::CCString *v16; // r0
const char *CString; // r0
cocos2d::CCString *v18; // r0
char *v19; // r0
char *v21; // [sp+24h] [bp-18h] BYREF
char *v22; // [sp+28h] [bp-14h] BYREF
std::string v23; // [sp+2Ch] [bp-10h] BYREF
std::string v24; // [sp+30h] [bp-Ch] BYREF
UploadMessageKey = (char *)GameLevelManager::getUploadMessageKey(a1, (int)a2);
m_friendReqAndUserBlocks = a1->m_friendReqAndUserBlocks;
v9 = UploadMessageKey;
sub_776584((int)&v24, UploadMessageKey);
v10 = cocos2d::CCDictionary::objectForKey(m_friendReqAndUserBlocks, &v24);
result = sub_774008(&v24);
if ( !v10 )
{
v12 = (int)a1->m_friendReqAndUserBlocks;
v13 = cocos2d::CCNode::create();
sub_776584((int)&v24, v9);
cocos2d::CCDictionary::setObject(v12, v13);
sub_774008(&v24);
GameLevelManager::makeTimeStamp(a1, v9);
sub_775C20(&v23);
LevelTools::base64EncodeString((cocos2d::ZipUtils *)&v24, &v23);
sub_774794(a3, &v24);
sub_774008(&v24);
sub_774008(&v23);
sub_776584((int)&v23, "14251");
cocos2d::ZipUtils::base64EncodeEnc((cocos2d::ZipUtils *)&v24, a4, (std::string)&v23);
sub_774794(a4, &v24);
sub_774008(&v24);
sub_774008(&v23);
GameLevelManager::getBasePostString((GameLevelManager *)&v21);
v14 = *a3;
v15.m_data.m_data = a4->m_data.m_data;
v16 = (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(v16);
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"&toAccountID=%i&subject=%s&body=%s&secret=%s",
a2,
v14,
v15.m_data.m_data,
CString);
v19 = (char *)cocos2d::CCString::getCString(v18);
sub_774544((int)&v21, v19);
sub_776584((int)&v22, "https://www.boomlings.com/database/uploadGJMessage20.php");
sub_776584((int)&v23, v21);
sub_776584((int)&v24, v9);
GameLevelManager::ProcessHttpRequest(a1, &v22, (const char **)&v23, (char **)&v24, 40);
sub_774008(&v24);
sub_774008(&v23);
sub_774008(&v22);
return sub_774008(&v21);
}
return result;
}