Skip to content

Instantly share code, notes, and snippets.

@JonMagon
Last active June 26, 2018 21:06
Show Gist options
  • Save JonMagon/ff95033ba42cdb29b41f74438035045e to your computer and use it in GitHub Desktop.
Save JonMagon/ff95033ba42cdb29b41f74438035045e to your computer and use it in GitHub Desktop.
S2C::CMD::Make<S2C::CMD::player_enter_slice>
packet_raw_wrapper *__cdecl S2C::CMD::MakePlayerExtendState<packet_raw_wrapper>(packet_raw_wrapper *const ar, gplayer_4 *pPlayer, unsigned int state, unsigned int state2)
{
int v4; // ST54_4
packet_raw_wrapper *v5; // eax
unsigned int v6; // ST54_4
unsigned int v7; // ST44_4
unsigned int v8; // ST34_4
unsigned int v9; // ST24_4
unsigned int v10; // ST14_4
packet_raw_wrapper *v11; // eax
packet_raw_wrapper *v12; // eax
packet_raw_wrapper *v13; // eax
packet_raw_wrapper *v14; // eax
packet_raw_wrapper *v15; // eax
unsigned __int8 v16; // ST54_1
packet_raw_wrapper *v17; // eax
char v18; // ST54_1
packet_raw_wrapper *v19; // eax
int v20; // eax
int v21; // ST54_4
packet_raw_wrapper *v22; // eax
int i; // [esp+Ch] [ebp-Ch]
int count_0; // [esp+10h] [ebp-8h]
unsigned __int8 count; // [esp+17h] [ebp-1h]
if ( state & 0x400 )
{
v4 = *(_DWORD *)&(*pPlayer)[256];
v5 = packet_raw_wrapper::operator<<(ar, *(_DWORD *)&(*pPlayer)[252]);
packet_raw_wrapper::operator<<(v5, v4);
}
if ( state & 1 )
packet_raw_wrapper::operator<<(ar, (*pPlayer)[100]);
if ( state & 2 )
packet_raw_wrapper::operator<<(ar, (*pPlayer)[101]);
if ( state & 0x40 )
{
v6 = *(_DWORD *)&(*pPlayer)[124];
v7 = *(_DWORD *)&(*pPlayer)[120];
v8 = *(_DWORD *)&(*pPlayer)[116];
v9 = *(_DWORD *)&(*pPlayer)[112];
v10 = *(_DWORD *)&(*pPlayer)[108];
v11 = packet_raw_wrapper::operator<<(ar, *(_DWORD *)&(*pPlayer)[104]);
v12 = packet_raw_wrapper::operator<<(v11, v10);
v13 = packet_raw_wrapper::operator<<(v12, v9);
v14 = packet_raw_wrapper::operator<<(v13, v8);
v15 = packet_raw_wrapper::operator<<(v14, v7);
packet_raw_wrapper::operator<<(v15, v6);
}
if ( state & 0x800 )
{
v16 = (*pPlayer)[244];
v17 = packet_raw_wrapper::operator<<(ar, *(_DWORD *)&(*pPlayer)[176]);
packet_raw_wrapper::operator<<(v17, v16);
}
if ( state & 0x1000 )
packet_raw_wrapper::operator<<(ar, (*pPlayer)[245]);
if ( state & 0x10000 )
{
count = (*pPlayer)[102];
packet_raw_wrapper::operator<<(ar, count);
if ( count )
packet_raw_wrapper::push_back(ar, &(*pPlayer)[180], 2 * count);
}
if ( state & 8 )
packet_raw_wrapper::operator<<(ar, (*pPlayer)[260]);
if ( state & 0x80000 )
{
packet_raw_wrapper::operator<<(ar, *(_WORD *)&(*pPlayer)[266]);
packet_raw_wrapper::operator<<(ar, *(_DWORD *)&(*pPlayer)[272]);
}
if ( state & 0x100000 )
{
packet_raw_wrapper::operator<<(ar, (*pPlayer)[265]);
packet_raw_wrapper::operator<<(ar, *(_DWORD *)&(*pPlayer)[268]);
}
if ( state & 0x800000 )
packet_raw_wrapper::operator<<(ar, *(_DWORD *)&(*pPlayer)[276]);
if ( state & 0x8000000 )
packet_raw_wrapper::operator<<(ar, *(_QWORD *)&(*pPlayer)[284]);
if ( state & 0x20000000 )
packet_raw_wrapper::operator<<(ar, *(_DWORD *)&(*pPlayer)[292]);
if ( state & 0x40000000 )
{
count_0 = *(_DWORD *)&(*pPlayer)[136];
packet_raw_wrapper::operator<<(ar, count_0);
for ( i = 0; i < count_0; ++i )
{
v18 = (*pPlayer)[8 * i + 144];
v19 = packet_raw_wrapper::operator<<(ar, *(_DWORD *)&(*pPlayer)[8 * i + 140]);
packet_raw_wrapper::operator<<(v19, v18);
}
}
if ( (state & 0x80000000) != 0 )
{
v20 = gplayer::GetCountryId(pPlayer);
packet_raw_wrapper::operator<<(ar, v20);
}
if ( state2 & 2 )
packet_raw_wrapper::operator<<(ar, *(_WORD *)&(*pPlayer)[300]);
if ( state2 & 4 )
packet_raw_wrapper::operator<<(ar, (*pPlayer)[302]);
if ( state2 & 8 )
packet_raw_wrapper::operator<<(ar, (*pPlayer)[303]);
if ( state2 & 0x20 )
packet_raw_wrapper::operator<<(ar, (*pPlayer)[304]);
if ( state2 & 0x80 )
packet_raw_wrapper::operator<<(ar, *(_QWORD *)&(*pPlayer)[308]);
if ( state2 & 0x100 )
{
v21 = *(_DWORD *)&(*pPlayer)[320];
v22 = packet_raw_wrapper::operator<<(ar, *(_DWORD *)&(*pPlayer)[316]);
packet_raw_wrapper::operator<<(v22, v21);
}
if ( state2 & 0x200 )
packet_raw_wrapper::operator<<(ar, *(_DWORD *)&(*pPlayer)[328]);
return ar;
}
packet_wrapper *__cdecl S2C::CMD::Make<S2C::CMD::player_enter_slice>::From<packet_raw_wrapper>(packet_wrapper *const wrapper, gplayer_5 *pPlayer, const A3DVECTOR *const pos)
{
S2C::CMD::Make<S2C::single_data_header>::From<packet_raw_wrapper>(wrapper, 12);
S2C::CMD::Make<S2C::INFO::player_info_1>::From<packet_raw_wrapper>(wrapper, pPlayer, pos);
if ( (*pPlayer)[247] )
*ASSERT_FAIL("pPlayer->gm_invisible == false", "/home/developer/cgame/common/protocol_imp.h", 85) = 0;
return wrapper;
}
bool __cdecl S2C::CMD::Make<S2C::INFO::player_info_1>::From<packet_raw_wrapper>(packet_raw_wrapper *const wrapper, gplayer_5 *pObject, const A3DVECTOR *const newpos)
{
unsigned int v3; // eax
int state; // ST84_4
unsigned int v5; // ST74_4
int v6; // ST64_4
unsigned __int8 v7; // ST54_1
unsigned __int8 v8; // ST44_1
unsigned __int16 v9; // ST34_2
unsigned __int16 v10; // ST24_2
packet_raw_wrapper *v11; // eax
packet_raw_wrapper *v12; // eax
packet_raw_wrapper *v13; // eax
packet_raw_wrapper *v14; // eax
packet_raw_wrapper *v15; // eax
packet_raw_wrapper *v16; // eax
packet_raw_wrapper *v17; // eax
if ( (*pObject)[247] )
return 0;
v3 = S2C::CMD::MakeObjectState<gplayer>(pObject);
state = *(_DWORD *)&(*pObject)[92] | v3;
v5 = *(_DWORD *)&(*pObject)[96];
v6 = *(_DWORD *)&(*pObject)[92] | v3;
v7 = (*pObject)[264];
v8 = (*pObject)[15];
v9 = *(_WORD *)&(*pObject)[248];
v10 = *(_WORD *)&(*pObject)[8];
v11 = packet_raw_wrapper::operator<<(wrapper, *(_DWORD *)&(*pObject)[48]);
v12 = packet_raw_wrapper::operator<<(v11, newpos);
v13 = packet_raw_wrapper::operator<<(v12, v10);
v14 = packet_raw_wrapper::operator<<(v13, v9);
v15 = packet_raw_wrapper::operator<<(v14, v8);
v16 = packet_raw_wrapper::operator<<(v15, v7);
v17 = packet_raw_wrapper::operator<<(v16, v6);
packet_raw_wrapper::operator<<(v17, v5);
S2C::CMD::MakePlayerExtendState<packet_raw_wrapper>(wrapper, pObject, state, *(_DWORD *)&(*pObject)[96]);
return 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment