//
// GJMultiplayerManager::handleIt from 0x140282ab0 to 0x140282d40 (656 bytes)
//
// 2 xrefs:
// > GJMultiplayerManager::onProcessHttpRequestCompleted @ 0x140282a69
// > ??> @ 0x1406d1490
//
// 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
//
// Hidden C++ exception states: #wind=6
void __fastcall GJMultiplayerManager::handleIt(GJMultiplayerManager *a1, __int64 a2, __int64 a3, __int64 a4, int a5)
{
const char *v8; // rbx
const void **v9; // rsi
const char *v10; // rdx
const char *v11; // rcx
unsigned int v12; // r13d
const void *v13; // rcx
unsigned __int64 v14; // r14
size_t v15; // r8
UploadActionDelegate *v16; // rcx
UploadActionDelegate *m_uploadDelegate; // rcx
__int64 v18; // rbx
__int64 v19; // rax
const char *v20; // rdx
const char *v21; // rcx
unsigned int v22; // r13d
const void *v23; // rcx
unsigned __int64 v24; // r14
size_t v25; // r8
GJMPDelegate *m_mpDelegate; // rcx
_BYTE v27[32]; // [rsp+30h] [rbp-61h] BYREF
_BYTE v28[32]; // [rsp+50h] [rbp-41h] BYREF
__int64 v29; // [rsp+70h] [rbp-21h]
__int64 v30; // [rsp+78h] [rbp-19h]
__int128 Buf2; // [rsp+80h] [rbp-11h] BYREF
__int64 v32; // [rsp+90h] [rbp-1h]
__int64 v33; // [rsp+98h] [rbp+7h]
v29 = a3;
v30 = a4;
switch ( a5 )
{
case 13:
v8 = (const char *)sub_14003BDB0((__int64)v28, a4);
v9 = (const void **)sub_14003BDB0((__int64)v27, a3);
v20 = v8;
if ( *((_QWORD *)v8 + 3) > 0xFu )
v20 = *(const char **)v8;
GJMultiplayerManager::removeDLFromActive(a1, v20);
v21 = v8;
if ( *((_QWORD *)v8 + 3) > 0xFu )
v21 = *(const char **)v8;
v22 = atoi(v21);
Buf2 = 0;
v32 = 2;
v33 = 15;
strcpy((char *)&Buf2, "-1");
v23 = v9;
if ( (unsigned __int64)v9[3] > 0xF )
v23 = *v9;
v24 = (unsigned __int64)v9[2];
v25 = v24;
if ( v24 > 2 )
v25 = 2;
if ( memcmp(v23, &Buf2, v25) || v24 != 2 )
{
m_mpDelegate = a1->m_mpDelegate;
if ( m_mpDelegate )
m_mpDelegate->didUploadMPComment(m_mpDelegate, v22);
}
goto LABEL_32;
case 57:
v18 = sub_14003BDB0((__int64)v28, a4);
v19 = sub_14003BDB0((__int64)v27, a3);
GJMultiplayerManager::onJoinLobbyCompleted(a1, v19, v18);
break;
case 58:
v8 = (const char *)sub_14003BDB0((__int64)v27, a4);
v9 = (const void **)sub_14003BDB0((__int64)v28, a3);
v10 = v8;
if ( *((_QWORD *)v8 + 3) > 0xFu )
v10 = *(const char **)v8;
GJMultiplayerManager::removeDLFromActive(a1, v10);
v11 = v8;
if ( *((_QWORD *)v8 + 3) > 0xFu )
v11 = *(const char **)v8;
v12 = atoi(v11);
Buf2 = 0;
v32 = 2;
v33 = 15;
strcpy((char *)&Buf2, "-1");
v13 = v9;
if ( (unsigned __int64)v9[3] > 0xF )
v13 = *v9;
v14 = (unsigned __int64)v9[2];
v15 = v14;
if ( v14 > 2 )
v15 = 2;
if ( !memcmp(v13, &Buf2, v15) && v14 == 2 )
{
m_uploadDelegate = a1->m_uploadDelegate;
if ( m_uploadDelegate )
m_uploadDelegate->uploadActionFailed(m_uploadDelegate, v12, 58);
}
else
{
v16 = a1->m_uploadDelegate;
if ( v16 )
v16->uploadActionFinished(v16, v12, 58);
}
LABEL_32:
sub_14003A830((__int64)v9);
sub_14003A830((__int64)v8);
break;
}
sub_14003A830(a3);
sub_14003A830(a4);
}