//
// GameLevelManager::onBlockUserCompleted from 0x100523950 to 0x100523bfe (686 bytes)
//
// 1 xrefs:
// > GameLevelManager::handleIt @ 0x10051d0fa
//
// 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::onBlockUserCompleted(__int64 a1, unsigned __int8 *a2, __int64 a3, double a4)
{
GameLevelManager *v4; // r12
const char *v5; // r14
size_t v6; // rax
size_t v7; // r13
char *v8; // rbx
size_t v9; // r12
GameLevelManager *v10; // rdi
unsigned int SplitIntFromKey; // r14d
const void *v12; // rdi
unsigned __int64 v13; // rcx
size_t v14; // rdx
UploadActionDelegate *v15; // rdi
cocos2d::CCObject *v16; // rax
UserInfoDelegate *m_userInfoDelegate; // rdi
UploadActionDelegate *m_uploadActionDelegate; // rdi
__int64 m_storedLevels; // rdi
__int64 v20; // rdi
__int64 v21; // r15
unsigned int v22; // ebx
UserListDelegate *m_userListDelegate; // rdi
__int64 v24; // [rsp+0h] [rbp-50h]
__int128 __dst; // [rsp+10h] [rbp-40h] BYREF
void *__p; // [rsp+20h] [rbp-30h]
v4 = (GameLevelManager *)a1;
if ( (*(_BYTE *)a3 & 1) != 0 )
v5 = *(const char **)(a3 + 16);
else
v5 = (const char *)(a3 + 1);
v6 = strlen(v5);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(a4);
v7 = v6;
v24 = *(_QWORD *)(a1 + 608);
if ( v6 >= 0x17 )
{
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
v8 = (char *)operator new(v9);
__p = v8;
*(_QWORD *)&__dst = v9 + 1;
v4 = (GameLevelManager *)a1;
*((_QWORD *)&__dst + 1) = v7;
goto LABEL_11;
}
v8 = (char *)&__dst + 1;
LOBYTE(__dst) = 2 * v6;
if ( v6 )
LABEL_11:
memmove(v8, v5, v7);
v8[v7] = 0;
v10 = (GameLevelManager *)v24;
cocos2d::CCDictionary::removeObjectForKey_1(v24, (char *)&__dst);
if ( (__dst & 1) != 0 )
{
v10 = (GameLevelManager *)__p;
operator delete(__p);
}
SplitIntFromKey = GameLevelManager::getSplitIntFromKey(v10, v5, 1);
*(_WORD *)((char *)&__dst + 1) = 12589;
BYTE3(__dst) = 0;
v12 = a2 + 1;
v13 = *a2 >> 1;
if ( (*a2 & 1) != 0 )
{
v12 = *((const void **)a2 + 2);
v13 = *((_QWORD *)a2 + 1);
}
v14 = 2;
if ( v13 < 2 )
v14 = v13;
if ( (v13 != 2) | (memcmp(v12, (char *)&__dst + 1, v14) != 0) )
{
v16 = cocos2d::CCDictionary::objectForKey(v4->m_storedUserInfo, (int)SplitIntFromKey);
if ( v16 )
{
LODWORD(v16[12].__vftable) = 2;
m_userInfoDelegate = v4->m_userInfoDelegate;
if ( m_userInfoDelegate )
((void (__fastcall *)(UserInfoDelegate *, cocos2d::CCObject *))m_userInfoDelegate->userInfoChanged)(
m_userInfoDelegate,
v16);
}
m_uploadActionDelegate = v4->m_uploadActionDelegate;
if ( m_uploadActionDelegate )
((void (__fastcall *)(UploadActionDelegate *, _QWORD, __int64))m_uploadActionDelegate->uploadActionFinished)(
m_uploadActionDelegate,
SplitIntFromKey,
34);
GameLevelManager::friendRequestWasRemoved(v4, SplitIntFromKey, 0);
m_storedLevels = (__int64)v4->m_storedLevels;
LOBYTE(__dst) = 22;
strcpy((char *)&__dst + 1, "get_blocked");
cocos2d::CCDictionary::removeObjectForKey_1(m_storedLevels, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
GameLevelManager::invalidateMessages(v4, 0, 1);
v20 = (__int64)v4->m_storedLevels;
LOBYTE(__dst) = 22;
strcpy((char *)&__dst + 1, "get_friends");
v21 = cocos2d::CCDictionary::objectForKey_1(v20, (char *)&__dst);
if ( (__dst & 1) != 0 )
operator delete(__p);
if ( v21 && (unsigned int)sub_100720070(v21) )
{
v22 = 0;
while ( *(_DWORD *)(sub_1007200C0(v21, v22) + 376) != SplitIntFromKey )
{
if ( ++v22 >= (unsigned int)sub_100720070(v21) )
return;
}
sub_100720230(v21, v22, 1);
m_userListDelegate = v4->m_userListDelegate;
if ( m_userListDelegate )
((void (__fastcall *)(UserListDelegate *, __int64, _QWORD))m_userListDelegate->userListChanged)(
m_userListDelegate,
v21,
0);
}
}
else
{
v15 = v4->m_uploadActionDelegate;
if ( v15 )
((void (__fastcall *)(UploadActionDelegate *, _QWORD, __int64))v15->uploadActionFailed)(v15, SplitIntFromKey, 34);
}
}