//
// GJMultiplayerManager::addComment from 0x641868 to 0x641974 (268 bytes)
//
// 2 xrefs:
// > GJMultiplayerManager::createAndAddComment @ 0x6419e0
// > GJMultiplayerManager::onJoinLobbyCompleted @ 0x641ce4
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:55:28 +0000
//
int __fastcall GJMultiplayerManager::addComment(int a1, int a2, int a3)
{
cocos2d::CCObject *v6; // r8
GJComment *v7; // r0
cocos2d::CCDictionary *v8; // r1
int *v9; // r5
GJAccountManager *v10; // r0
int v11; // r6
int v12; // r0
int v13; // r1
int v14; // r0
unsigned int i; // r6
GJAccountManager *v16; // r0
int v17; // r11
GJAccountManager *v18; // r9
int result; // r0
int v20[3]; // [sp+0h] [bp-14h] BYREF
v6 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 276), a3);
if ( !v6 )
{
v6 = (cocos2d::CCObject *)cocos2d::CCArray::create(nullptr);
cocos2d::CCDictionary::setObject(*(cocos2d::CCDictionary **)(a1 + 276), v6, a3);
}
std::string::basic_string(v20, a2);
v7 = (GJComment *)GameLevelManager::responseToDict((cocos2d::CCDictionary *)v20, 1);
v9 = GJComment::create(v7, v8);
v10 = (GJAccountManager *)std::string::~string((int)v20);
v11 = v9[77];
v12 = GJAccountManager::sharedState(v10);
if ( v11 == *(_DWORD *)(v12 + 280) - *(_DWORD *)(v12 + 284) && v9[72] != -1 )
{
for ( i = 0; i < cocos2d::CCArray::count(v6); ++i )
{
v16 = (GJAccountManager *)cocos2d::CCArray::objectAtIndex(v6, i);
v17 = *((_DWORD *)v16 + 77);
v18 = v16;
result = GJAccountManager::sharedState(v16);
if ( v17 == *(_DWORD *)(result + 280) - *(_DWORD *)(result + 284) && *((_DWORD *)v18 + 72) == -1 )
{
*((_DWORD *)v18 + 72) = v9[72];
return result;
}
}
}
v13 = v9[77];
*((_BYTE *)v9 + 341) = 1;
v14 = cocos2d::CCDictionary::objectForKey(*(cocos2d::CCDictionary **)(a1 + 268), v13);
if ( v14 )
{
std::string::basic_string(v20, v14 + 264);
std::string::operator=((unsigned __int8 *)v9 + 276, (unsigned __int8 *)v20);
std::string::~string((int)v20);
}
return cocos2d::CCArray::addObject(v6, (cocos2d::CCObject *)v9);
}