//
// MemberListPopup::threadUpdateFinished from 0x1400ee880 to 0x1400eec83 (1027 bytes)
//
// 2 xrefs:
// > ??> @ 0x140728640
// > ??> @ 0x140915044
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:26:35 +0000
//
// Hidden C++ exception states: #wind=4
void __fastcall MemberListPopup::threadUpdateFinished(__int64 a1, int a2, int a3)
{
__int64 v5; // rcx
cocos2d::CCArray *ThreadMembers; // rax
cocos2d::CCArray *v7; // rsi
unsigned int v8; // ebx
const char *v9; // rcx
int v10; // eax
const char *v11; // rbx
int v12; // ecx
__int64 v13; // rcx
cocos2d::CCArray *ThreadPendingInvites; // rax
cocos2d::CCArray *v15; // rsi
unsigned int v16; // ebx
__int64 *v17; // rsi
size_t v18; // r8
__int64 v19; // rbx
__int64 v20; // rdx
__int64 v21; // r8
__int64 v22; // rax
__int64 v23; // rcx
__int64 v24; // rax
__int64 v25; // rbx
__int64 v26; // rax
cocos2d::CCNotificationCenter *v27; // rax
__int128 v28; // [rsp+30h] [rbp-58h] BYREF
__int64 v29; // [rsp+40h] [rbp-48h]
__int64 v30; // [rsp+48h] [rbp-40h]
__int128 v31; // [rsp+50h] [rbp-38h] BYREF
__int64 v32; // [rsp+60h] [rbp-28h]
__int64 v33; // [rsp+68h] [rbp-20h]
void *v34; // [rsp+90h] [rbp+8h]
void *v35; // [rsp+90h] [rbp+8h]
void *v36; // [rsp+90h] [rbp+8h]
if ( a2 == *(_DWORD *)(*(_QWORD *)(a1 + 24) + 56LL)
&& (*(_BYTE *)(a1 + 88)
|| *(int *)(a1 + 92) > 0
|| *(int *)(a1 + 96) > 0
|| *(int *)(a1 + 100) > 0
|| *(_BYTE *)(a1 + 72)) )
{
v5 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v34 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v34);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v5 = *(_QWORD *)&qword_14090BFB0;
}
ThreadMembers = (cocos2d::CCArray *)GameLevelManager::getThreadMembers(
v5,
*(unsigned int *)(*(_QWORD *)(a1 + 24) + 56LL));
v7 = ThreadMembers;
if ( a3 == 4 )
{
if ( !*(_BYTE *)(a1 + 88) )
return;
*(_BYTE *)(a1 + 88) = 0;
MemberListPopup::applyAddOutcome(*(_QWORD *)(a1 + 24));
}
else
{
switch ( a3 )
{
case 6:
if ( *(int *)(a1 + 92) <= 0 )
return;
if ( ThreadMembers )
{
v8 = 0;
if ( (int)cocos2d::CCArray::count(ThreadMembers) > 0 )
{
while ( *((_DWORD *)cocos2d::CCArray::objectAtIndex(v7, v8) + 98) != *(_DWORD *)(a1 + 92) )
{
if ( (int)++v8 >= (int)cocos2d::CCArray::count(v7) )
goto LABEL_20;
}
cocos2d::CCArray::removeObjectAtIndex(v7, v8, 1);
}
}
LABEL_20:
v9 = *(const char **)(a1 + 24);
v10 = *((_DWORD *)v9 + 50) - 1;
if ( v10 < 1 )
v10 = 1;
*((_DWORD *)v9 + 50) = v10;
*(_DWORD *)(a1 + 92) = 0;
v11 = "Member removed";
break;
case 7:
v12 = *(_DWORD *)(a1 + 96);
if ( v12 <= 0 )
return;
*(_DWORD *)(*(_QWORD *)(a1 + 24) + 240LL) = v12;
*(_DWORD *)(a1 + 96) = 0;
MemberListPopup::refreshPolicyBtn(a1 - 776);
v11 = "Owner changed";
break;
case 13:
if ( !*(_BYTE *)(a1 + 72) )
return;
*(_DWORD *)(*(_QWORD *)(a1 + 24) + 248LL) = *(_DWORD *)(*(_QWORD *)(a1 + 24) + 248LL) != 1;
*(_BYTE *)(a1 + 72) = 0;
MemberListPopup::refreshPolicyBtn(a1 - 776);
v9 = "Only the owner can add";
v11 = "Anyone can add";
if ( *(_DWORD *)(*(_QWORD *)(a1 + 24) + 248LL) == 1 )
v11 = "Only the owner can add";
break;
default:
if ( a3 != 11 || *(int *)(a1 + 100) <= 0 )
return;
v13 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v35 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v35);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v13 = *(_QWORD *)&qword_14090BFB0;
}
ThreadPendingInvites = (cocos2d::CCArray *)GameLevelManager::getThreadPendingInvites(
v13,
*(unsigned int *)(*(_QWORD *)(a1 + 24) + 56LL));
v15 = ThreadPendingInvites;
if ( ThreadPendingInvites )
{
v16 = 0;
if ( (int)cocos2d::CCArray::count(ThreadPendingInvites) > 0 )
{
while ( *((_DWORD *)cocos2d::CCArray::objectAtIndex(v15, v16) + 98) != *(_DWORD *)(a1 + 100) )
{
if ( (int)++v16 >= (int)cocos2d::CCArray::count(v15) )
goto LABEL_41;
}
cocos2d::CCArray::removeObjectAtIndex(v15, v16, 1);
}
}
LABEL_41:
*(_DWORD *)(a1 + 100) = 0;
v11 = "Invite cancelled";
break;
}
v17 = *(__int64 **)(cocos2d::CCDirector::sharedDirector(v9) + 272);
v28 = 0;
v29 = 0;
v30 = 15;
LOBYTE(v28) = 0;
v31 = 0;
v32 = 0;
v33 = 0;
v18 = -1;
do
++v18;
while ( v11[v18] );
sub_14003D230(&v31, v11, v18);
v19 = *v17;
v22 = TextAlertPopup::create(&v31, v20, v21, 150, &v28);
(*(void (__fastcall **)(__int64 *, __int64, __int64))(v19 + 456))(v17, v22, 1000);
}
v23 = *(_QWORD *)(a1 + 32);
if ( v23 )
ThreadViewPopup::buildMemberButton(v23);
MemberListPopup::buildRows(a1 - 776);
v24 = *(_QWORD *)(a1 + 32);
if ( v24 )
{
v25 = v24 + 672;
v26 = *(_QWORD *)&qword_14090BFB0;
if ( !*(_QWORD *)&qword_14090BFB0 )
{
v36 = operator new(0x690u);
*(_QWORD *)&qword_14090BFB0 = GameLevelManager::GameLevelManager(v36);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)&qword_14090BFB0 + 72LL))(*(_QWORD *)&qword_14090BFB0);
v26 = *(_QWORD *)&qword_14090BFB0;
}
*(_QWORD *)(v26 + 1392) = v25;
if ( ((a3 - 4) & 0xFFFFFFFC) == 0 )
ThreadViewPopup::refetchLatest(*(_QWORD *)(a1 + 32));
}
else
{
v27 = (cocos2d::CCNotificationCenter *)cocos2d::CCNotificationCenter::sharedNotificationCenter();
cocos2d::CCNotificationCenter::postNotification(v27, "ThreadsChangedNotification", nullptr);
}
}
}