//
// GameLevelManager::messageWasRemoved from 0x10054f570 to 0x10054f733 (451 bytes)
//
// 1 xrefs:
// > GameLevelManager::onDeleteUserMessagesCompleted @ 0x100525614
//
// 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::messageWasRemoved(GameLevelManager *a1, int a2, bool a3)
{
double v3; // xmm0_8
cocos2d::CCString *v4; // rax
const char *CString; // rbx
cocos2d::CCArray *StoredOnlineLevels; // rax
cocos2d::CCArray *v7; // r14
int v8; // r12d
cocos2d::CCString *v9; // rax
unsigned int v10; // r15d
MessageListDelegate *m_messageListDelegate; // rdi
cocos2d::CCDictionary *m_storedLevels; // r14
size_t v13; // rax
size_t v14; // r15
char *v15; // r13
size_t v16; // r12
_QWORD __dst[2]; // [rsp+0h] [rbp-50h] BYREF
void *__p; // [rsp+10h] [rbp-40h]
_BOOL4 v19; // [rsp+1Ch] [rbp-34h]
GameLevelManager *v20; // [rsp+20h] [rbp-30h]
v19 = a3;
v4 = (cocos2d::CCString *)sub_1007AB580("messages_%i_%i", __dst[0]);
CString = cocos2d::CCString::getCString(v4);
v20 = a1;
StoredOnlineLevels = GameLevelManager::getStoredOnlineLevels(a1, CString);
if ( StoredOnlineLevels )
{
v7 = StoredOnlineLevels;
v8 = 0;
while ( !(unsigned int)sub_100720070(v7) )
{
LABEL_3:
++v8;
v9 = (cocos2d::CCString *)sub_1007AB580("messages_%i_%i", __dst[0]);
CString = cocos2d::CCString::getCString(v9);
v7 = GameLevelManager::getStoredOnlineLevels(v20, CString);
if ( !v7 )
return;
}
v10 = 0;
while ( *(_DWORD *)(sub_1007200C0(v7, v10) + 316) != a2 )
{
if ( ++v10 >= (unsigned int)sub_100720070(v7) )
goto LABEL_3;
}
sub_100720230(v7, v10, 1);
m_messageListDelegate = v20->m_messageListDelegate;
if ( m_messageListDelegate )
{
((void (__fastcall *)(MessageListDelegate *, cocos2d::CCArray *, const char *))m_messageListDelegate->loadMessagesFinished)(
m_messageListDelegate,
v7,
CString);
if ( !(unsigned int)sub_100720070(v7) )
{
m_storedLevels = v20->m_storedLevels;
v13 = strlen(CString);
if ( v13 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v3);
v14 = v13;
v15 = (char *)__dst + 1;
if ( v13 >= 0x17 )
{
v16 = 26;
if ( (v13 | 7) != 0x17 )
v16 = (v13 | 7) + 1;
v15 = (char *)operator new(v16);
__p = v15;
__dst[0] = v16 + 1;
__dst[1] = v14;
}
else
{
LOBYTE(__dst[0]) = 2 * v13;
if ( !v13 )
{
LABEL_19:
v15[v14] = 0;
cocos2d::CCDictionary::removeObjectForKey_1((__int64)m_storedLevels, (char *)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
return;
}
}
memmove(v15, CString, v14);
goto LABEL_19;
}
}
}
}