//
// GameLevelManager::onUploadCommentCompleted from 0x3c2128 to 0x3c23e6 (702 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x3d71ac
//
// 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
//
void __fastcall GameLevelManager::onUploadCommentCompleted(GameLevelManager *a1, cocos2d::CCArray *a2, char **a3)
{
char *v3; // r9
cocos2d::CCDictionary *m_friendReqAndUserBlocks; // r8
_BOOL4 v7; // r10
GJAccountManager *v8; // r0
const char *v9; // r5
_BOOL4 v10; // r8
CommentUploadDelegate *m_commentUploadDelegate; // r0
int v12; // r8
CommentUploadDelegate *v13; // r0
GameManager *v14; // r0
cocos2d::CCString *v15; // r0
char *CString; // r0
FLAlertLayer *v17; // r5
cocos2d::CCArray *v18; // r10
cocos2d::CCString *v19; // r0
CommentUploadDelegate *v20; // r0
cocos2d::CCString *v21; // r5
const char *v22; // r5
cocos2d::CCString *v23; // r0
const char *v24; // r0
char *v25; // r0
FLAlertLayer *v26; // r5
GameLevelManager *v27; // r4
const char *AccountCommentKey; // r0
int v29; // r6
GameLevelManager *v30; // r8
GameLevelManager *v31; // r0
GameLevelManager *v32; // r8
GameLevelManager *v33; // r0
CommentUploadDelegate *v34; // r0
char v35[4]; // [sp+1Ch] [bp-10h] BYREF
char *v36; // [sp+20h] [bp-Ch] BYREF
v3 = *a3;
m_friendReqAndUserBlocks = a1->m_friendReqAndUserBlocks;
sub_776584((int)&v36, *a3);
cocos2d::CCDictionary::removeObjectForKey(m_friendReqAndUserBlocks);
sub_774008(&v36);
sub_776584((int)v35, v3);
sub_776584((int)&v36, "acc_comment");
v7 = sub_3BE0D8((int)v35, (int)&v36);
sub_774008(&v36);
sub_774008(v35);
if ( v7 )
{
v8 = GJAccountManager::sharedState();
v9 = (const char *)(v8->m_accountID - v8->m_unkInt1);
}
else
{
v9 = (const char *)GameLevelManager::levelIDFromPostCommentKey(a1, v3);
}
sub_776584((int)&v36, "-1");
v10 = sub_3BE0D8((int)a2, (int)&v36);
sub_774008(&v36);
if ( v10 )
{
m_commentUploadDelegate = a1->m_commentUploadDelegate;
if ( m_commentUploadDelegate )
m_commentUploadDelegate->commentUploadFailed(m_commentUploadDelegate, (int)v9, (CommentError)0);
LABEL_19:
GameLevelManager::resetTimerForKey(a1, v3);
return;
}
sub_776584((int)&v36, "-10");
v12 = sub_3BE0D8((int)a2, (int)&v36);
sub_774008(&v36);
if ( v12 )
{
v13 = a1->m_commentUploadDelegate;
if ( v13 )
v13->commentUploadFailed(v13, (int)v9, Banned);
v14 = GameManager::sharedState();
v15 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"You have been banned from making comments. \n"
"Please contact support with ID %i if you have any questions.",
(const char *)(v14->m_playerUserID.random - v14->m_playerUserID.seed));
CString = (char *)cocos2d::CCString::getCString(v15);
sub_776584((int)&v36, CString);
v17 = FLAlertLayer::create(0, (int)"Banned", (int)&v36, (int)"OK", 0);
sub_774008(&v36);
v17->show(v17);
}
else
{
if ( sub_7748A0((int)a2, "temp") != -1 )
{
v18 = sub_3BE530(a2, "_");
if ( cocos2d::CCArray::count(v18) > 1u )
{
v19 = cocos2d::CCArray::stringAtIndex(v18, 1u);
v12 = cocos2d::CCString::intValue(v19);
}
v20 = a1->m_commentUploadDelegate;
if ( v20 )
v20->commentUploadFailed(v20, (int)v9, Banned);
GameToolbox::getTimeString((GameToolbox *)&v36, v12, 0);
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"You have been banned from making comments for: %s",
v36);
sub_774008(&v36);
if ( cocos2d::CCArray::count(v18) > 2u )
{
v22 = cocos2d::CCString::getCString(v21);
v23 = cocos2d::CCArray::stringAtIndex(v18, 2u);
v24 = cocos2d::CCString::getCString(v23);
v21 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s.\n\nReason: %s",
v22,
v24);
}
v25 = (char *)cocos2d::CCString::getCString(v21);
sub_776584((int)&v36, v25);
v26 = FLAlertLayer::create(0, (int)"Banned", (int)&v36, (int)"OK", 0, 380.0);
sub_774008(&v36);
v26->show(v26);
goto LABEL_19;
}
if ( v7 )
{
v27 = GameLevelManager::sharedState();
AccountCommentKey = GameLevelManager::getAccountCommentKey(a1, (int)v9, 0);
GameLevelManager::resetTimerForKey(v27, AccountCommentKey);
}
else
{
if ( (int)v9 >= 0 )
v29 = 0;
else
v29 = 2;
v30 = GameLevelManager::sharedState();
v31 = GameLevelManager::sharedState();
GameLevelManager::getCommentKey((int)&v36, (int)v31, v9, 0, 0, v29);
GameLevelManager::resetTimerForKey(v30, v36);
sub_774008(&v36);
v32 = GameLevelManager::sharedState();
v33 = GameLevelManager::sharedState();
GameLevelManager::getCommentKey((int)&v36, (int)v33, v9, 0, 1, v29);
GameLevelManager::resetTimerForKey(v32, v36);
sub_774008(&v36);
}
v34 = a1->m_commentUploadDelegate;
if ( v34 )
v34->commentUploadFinished(v34, (int)v9);
}
}