diff --git a/src/game/client/c_baseentity.cpp b/src/game/client/c_baseentity.cpp index 288bd7df45..0d326dc08a 100644 --- a/src/game/client/c_baseentity.cpp +++ b/src/game/client/c_baseentity.cpp @@ -439,19 +439,21 @@ void RecvProxy_EffectFlags( const CRecvProxyData *pData, void *pStruct, void *pO ( ( C_BaseEntity * )pStruct )->SetEffects( pData->m_Value.m_Int ); } +// clang-format off + BEGIN_RECV_TABLE_NOBASE( C_BaseEntity, DT_AnimTimeMustBeFirst ) -RecvPropInt( RECVINFO( m_flAnimTime ), 0, RecvProxy_AnimTime ), - END_RECV_TABLE() + RecvPropInt( RECVINFO( m_flAnimTime ), 0, RecvProxy_AnimTime ), +END_RECV_TABLE() #ifndef NO_ENTITY_PREDICTION - BEGIN_RECV_TABLE_NOBASE( C_BaseEntity, DT_PredictableId ) - RecvPropPredictableId( RECVINFO( m_PredictableID ) ), +BEGIN_RECV_TABLE_NOBASE( C_BaseEntity, DT_PredictableId ) + RecvPropPredictableId( RECVINFO( m_PredictableID ) ), RecvPropInt( RECVINFO( m_bIsPlayerSimulated ) ), - END_RECV_TABLE() +END_RECV_TABLE() #endif - BEGIN_RECV_TABLE_NOBASE( C_BaseEntity, DT_BaseEntity ) - RecvPropDataTable( "AnimTimeMustBeFirst", 0, 0, &REFERENCE_RECV_TABLE( DT_AnimTimeMustBeFirst ) ), +BEGIN_RECV_TABLE_NOBASE( C_BaseEntity, DT_BaseEntity ) + RecvPropDataTable( "AnimTimeMustBeFirst", 0, 0, &REFERENCE_RECV_TABLE( DT_AnimTimeMustBeFirst ) ), RecvPropInt( RECVINFO( m_flSimulationTime ), 0, RecvProxy_SimulationTime ), RecvPropInt( RECVINFO( m_ubInterpolationFrame ) ), @@ -487,24 +489,23 @@ RecvPropInt( RECVINFO( m_flAnimTime ), 0, RecvProxy_AnimTime ), #if !defined( NO_ENTITY_PREDICTION ) RecvPropDataTable( "predictable_id", 0, 0, &REFERENCE_RECV_TABLE( DT_PredictableId ) ), #endif - + RecvPropInt( RECVINFO( m_bSimulatedEveryTick ), 0, RecvProxy_InterpolationAmountChanged ), RecvPropInt( RECVINFO( m_bAnimatedEveryTick ), 0, RecvProxy_InterpolationAmountChanged ), RecvPropBool( RECVINFO( m_bAlternateSorting ) ), #ifdef TF_CLIENT_DLL RecvPropArray3( RECVINFO_ARRAY( m_nModelIndexOverrides ), - RecvPropInt( RECVINFO( m_nModelIndexOverrides[0] ) ) ), + RecvPropInt( RECVINFO( m_nModelIndexOverrides[0] ) ) ), #endif +END_RECV_TABLE() - END_RECV_TABLE() - - const float coordTolerance = 2.0f / ( float )( 1 << COORD_FRACTIONAL_BITS ); +const float coordTolerance = 2.0f / ( float )( 1 << COORD_FRACTIONAL_BITS ); BEGIN_PREDICTION_DATA_NO_BASE( C_BaseEntity ) -// These have a special proxy to handle send/receive -DEFINE_PRED_TYPEDESCRIPTION( m_Collision, CCollisionProperty ), + // These have a special proxy to handle send/receive + DEFINE_PRED_TYPEDESCRIPTION( m_Collision, CCollisionProperty ), DEFINE_PRED_FIELD( m_MoveType, FIELD_CHARACTER, FTYPEDESC_INSENDTABLE ), DEFINE_PRED_FIELD( m_MoveCollide, FIELD_CHARACTER, FTYPEDESC_INSENDTABLE ), @@ -558,35 +559,36 @@ DEFINE_PRED_TYPEDESCRIPTION( m_Collision, CCollisionProperty ), DEFINE_FIELD( m_flGravity, FIELD_FLOAT ), // DEFINE_FIELD( m_ModelInstance, FIELD_SHORT ), DEFINE_FIELD( m_flProxyRandomValue, FIELD_FLOAT ), -// DEFINE_FIELD( m_PredictableID, FIELD_INTEGER ), -// DEFINE_FIELD( m_pPredictionContext, FIELD_POINTER ), -// Stuff specific to rendering and therefore not to be copied back and forth -// DEFINE_PRED_FIELD( m_clrRender, color32, FTYPEDESC_INSENDTABLE ), -// DEFINE_FIELD( m_bReadyToDraw, FIELD_BOOLEAN ), -// DEFINE_FIELD( anim, CLatchedAnim ), -// DEFINE_FIELD( mouth, CMouthInfo ), -// DEFINE_FIELD( GetAbsOrigin(), FIELD_VECTOR ), -// DEFINE_FIELD( GetAbsAngles(), FIELD_VECTOR ), -// DEFINE_FIELD( m_nNumAttachments, FIELD_SHORT ), -// DEFINE_FIELD( m_pAttachmentAngles, FIELD_VECTOR ), -// DEFINE_FIELD( m_pAttachmentOrigin, FIELD_VECTOR ), -// DEFINE_FIELD( m_listentry, CSerialEntity ), -// DEFINE_FIELD( m_ShadowHandle, ClientShadowHandle_t ), -// DEFINE_FIELD( m_hThink, ClientThinkHandle_t ), -// Definitely private and not copied around -// DEFINE_FIELD( m_bPredictable, FIELD_BOOLEAN ), -// DEFINE_FIELD( m_CollisionGroup, FIELD_INTEGER ), -// DEFINE_FIELD( m_DataChangeEventRef, FIELD_INTEGER ), + // DEFINE_FIELD( m_PredictableID, FIELD_INTEGER ), + // DEFINE_FIELD( m_pPredictionContext, FIELD_POINTER ), + // Stuff specific to rendering and therefore not to be copied back and forth + // DEFINE_PRED_FIELD( m_clrRender, color32, FTYPEDESC_INSENDTABLE ), + // DEFINE_FIELD( m_bReadyToDraw, FIELD_BOOLEAN ), + // DEFINE_FIELD( anim, CLatchedAnim ), + // DEFINE_FIELD( mouth, CMouthInfo ), + // DEFINE_FIELD( GetAbsOrigin(), FIELD_VECTOR ), + // DEFINE_FIELD( GetAbsAngles(), FIELD_VECTOR ), + // DEFINE_FIELD( m_nNumAttachments, FIELD_SHORT ), + // DEFINE_FIELD( m_pAttachmentAngles, FIELD_VECTOR ), + // DEFINE_FIELD( m_pAttachmentOrigin, FIELD_VECTOR ), + // DEFINE_FIELD( m_listentry, CSerialEntity ), + // DEFINE_FIELD( m_ShadowHandle, ClientShadowHandle_t ), + // DEFINE_FIELD( m_hThink, ClientThinkHandle_t ), + // Definitely private and not copied around + // DEFINE_FIELD( m_bPredictable, FIELD_BOOLEAN ), + // DEFINE_FIELD( m_CollisionGroup, FIELD_INTEGER ), + // DEFINE_FIELD( m_DataChangeEventRef, FIELD_INTEGER ), #if !defined( CLIENT_DLL ) -// DEFINE_FIELD( m_bPredictionEligible, FIELD_BOOLEAN ), + // DEFINE_FIELD( m_bPredictionEligible, FIELD_BOOLEAN ), #endif - END_PREDICTION_DATA() +END_PREDICTION_DATA() - //----------------------------------------------------------------------------- - // Helper functions. - //----------------------------------------------------------------------------- +static void* WORKAROUND_NASTY_FORMATTING_BUG; // clang-format on - void SpewInterpolatedVar( CInterpolatedVar< Vector > *pVar ) +//----------------------------------------------------------------------------- +// Helper functions. +//----------------------------------------------------------------------------- +void SpewInterpolatedVar( CInterpolatedVar< Vector > *pVar ) { Msg( "--------------------------------------------------\n" ); int i = pVar->GetHead(); @@ -1015,7 +1017,7 @@ C_BaseEntity::~C_BaseEntity() RemoveFromTeleportList(); #ifdef LUA_SDK - if( L ) + if ( L ) lua_unref( L, m_nTableReference ); #endif } diff --git a/src/game/client/c_baseplayer.cpp b/src/game/client/c_baseplayer.cpp index 84d65889ae..87b632c9ae 100644 --- a/src/game/client/c_baseplayer.cpp +++ b/src/game/client/c_baseplayer.cpp @@ -196,17 +196,18 @@ void RecvProxy_ObserverMode( const CRecvProxyData *pData, void *pStruct, void *p // -------------------------------------------------------------------------------- // // RecvTable for CPlayerState. // -------------------------------------------------------------------------------- -// // + +// clang-format off BEGIN_RECV_TABLE_NOBASE( CPlayerState, DT_PlayerState ) -RecvPropInt( RECVINFO( deadflag ) ), - END_RECV_TABLE() + RecvPropInt( RECVINFO( deadflag ) ), +END_RECV_TABLE() - BEGIN_RECV_TABLE_NOBASE( CPlayerLocalData, DT_Local ) - RecvPropArray3( RECVINFO_ARRAY( m_chAreaBits ), - RecvPropInt( RECVINFO( m_chAreaBits[0] ) ) ), +BEGIN_RECV_TABLE_NOBASE( CPlayerLocalData, DT_Local ) + RecvPropArray3( RECVINFO_ARRAY( m_chAreaBits ), + RecvPropInt( RECVINFO( m_chAreaBits[0] ) ) ), RecvPropArray3( RECVINFO_ARRAY( m_chAreaPortalBits ), - RecvPropInt( RECVINFO( m_chAreaPortalBits[0] ) ) ), + RecvPropInt( RECVINFO( m_chAreaPortalBits[0] ) ) ), RecvPropInt( RECVINFO( m_iHideHUD ) ), // View @@ -221,17 +222,17 @@ RecvPropInt( RECVINFO( deadflag ) ), #if PREDICTION_ERROR_CHECK_LEVEL > 1 RecvPropFloat( RECVINFO_NAME( m_vecPunchAngle.m_Value[0], - m_vecPunchAngle[0] ) ), + m_vecPunchAngle[0] ) ), RecvPropFloat( RECVINFO_NAME( m_vecPunchAngle.m_Value[1], - m_vecPunchAngle[1] ) ), + m_vecPunchAngle[1] ) ), RecvPropFloat( RECVINFO_NAME( m_vecPunchAngle.m_Value[2], - m_vecPunchAngle[2] ) ), + m_vecPunchAngle[2] ) ), RecvPropFloat( RECVINFO_NAME( m_vecPunchAngleVel.m_Value[0], - m_vecPunchAngleVel[0] ) ), + m_vecPunchAngleVel[0] ) ), RecvPropFloat( RECVINFO_NAME( m_vecPunchAngleVel.m_Value[1], - m_vecPunchAngleVel[1] ) ), + m_vecPunchAngleVel[1] ) ), RecvPropFloat( RECVINFO_NAME( m_vecPunchAngleVel.m_Value[2], - m_vecPunchAngleVel[2] ) ), + m_vecPunchAngleVel[2] ) ), #else RecvPropVector( RECVINFO( m_vecPunchAngle ) ), RecvPropVector( RECVINFO( m_vecPunchAngleVel ) ), @@ -272,16 +273,16 @@ RecvPropInt( RECVINFO( deadflag ) ), RecvPropInt( RECVINFO( m_audio.soundscapeIndex ) ), RecvPropInt( RECVINFO( m_audio.localBits ) ), RecvPropEHandle( RECVINFO( m_audio.ent ) ), - END_RECV_TABLE() +END_RECV_TABLE() - // -------------------------------------------------------------------------------- - // // This data only gets sent to clients that ARE this player entity. - // -------------------------------------------------------------------------------- - // // +// -------------------------------------------------------------------------------- +// // This data only gets sent to clients that ARE this player entity. +// -------------------------------------------------------------------------------- +// // - BEGIN_RECV_TABLE_NOBASE( C_BasePlayer, DT_LocalPlayerExclusive ) +BEGIN_RECV_TABLE_NOBASE( C_BasePlayer, DT_LocalPlayerExclusive ) - RecvPropDataTable( RECVINFO_DT( m_Local ), 0, &REFERENCE_RECV_TABLE( DT_Local ) ), + RecvPropDataTable( RECVINFO_DT( m_Local ), 0, &REFERENCE_RECV_TABLE( DT_Local ) ), RecvPropFloat( RECVINFO( m_vecViewOffset[0] ) ), RecvPropFloat( RECVINFO( m_vecViewOffset[1] ) ), @@ -314,7 +315,7 @@ RecvPropInt( RECVINFO( deadflag ) ), RecvPropInt( RECVINFO( m_nWaterLevel ) ), RecvPropFloat( RECVINFO( m_flLaggedMovementValue ) ), - END_RECV_TABLE() +END_RECV_TABLE() // -------------------------------------------------------------------------------- // // DT_BasePlayer datatable. @@ -322,13 +323,13 @@ RecvPropInt( RECVINFO( deadflag ) ), // // #if defined USES_ECON_ITEMS - EXTERN_RECV_TABLE( DT_AttributeList ); +EXTERN_RECV_TABLE( DT_AttributeList ); #endif IMPLEMENT_CLIENTCLASS_DT( C_BasePlayer, DT_BasePlayer, CBasePlayer ) -// We have both the local and nonlocal data in here, but the server proxies -// only send one. -RecvPropDataTable( "localdata", 0, 0, &REFERENCE_RECV_TABLE( DT_LocalPlayerExclusive ) ), + // We have both the local and nonlocal data in here, but the server proxies + // only send one. + RecvPropDataTable( "localdata", 0, 0, &REFERENCE_RECV_TABLE( DT_LocalPlayerExclusive ) ), #if defined USES_ECON_ITEMS RecvPropDataTable( RECVINFO_DT( m_AttributeList ), 0, &REFERENCE_RECV_TABLE( DT_AttributeList ) ), @@ -364,25 +365,25 @@ RecvPropDataTable( "localdata", 0, 0, &REFERENCE_RECV_TABLE( DT_LocalPlayerExclu #if defined USES_ECON_ITEMS RecvPropUtlVector( RECVINFO_UTLVECTOR( m_hMyWearables ), - MAX_WEARABLES_SENT_FROM_SERVER, - RecvPropEHandle( NULL, 0, 0 ) ), + MAX_WEARABLES_SENT_FROM_SERVER, + RecvPropEHandle( NULL, 0, 0 ) ), #endif RecvPropEHandle( RECVINFO( m_hHandsEntity ) ), - END_RECV_TABLE() +END_RECV_TABLE() - BEGIN_PREDICTION_DATA_NO_BASE( CPlayerState ) +BEGIN_PREDICTION_DATA_NO_BASE( CPlayerState ) - DEFINE_PRED_FIELD( deadflag, FIELD_BOOLEAN, FTYPEDESC_INSENDTABLE ), + DEFINE_PRED_FIELD( deadflag, FIELD_BOOLEAN, FTYPEDESC_INSENDTABLE ), // DEFINE_FIELD( netname, string_t ), // DEFINE_FIELD( fixangle, FIELD_INTEGER ), // DEFINE_FIELD( anglechange, FIELD_FLOAT ), // DEFINE_FIELD( v_angle, FIELD_VECTOR ), - END_PREDICTION_DATA() +END_PREDICTION_DATA() - BEGIN_PREDICTION_DATA_NO_BASE( CPlayerLocalData ) +BEGIN_PREDICTION_DATA_NO_BASE( CPlayerLocalData ) // DEFINE_PRED_TYPEDESCRIPTION( m_skybox3d, sky3dparams_t ), // DEFINE_PRED_TYPEDESCRIPTION( m_fog, fogparams_t ), @@ -415,9 +416,9 @@ RecvPropDataTable( "localdata", 0, 0, &REFERENCE_RECV_TABLE( DT_LocalPlayerExclu DEFINE_PRED_FIELD( m_flStepSize, FIELD_FLOAT, FTYPEDESC_INSENDTABLE ), DEFINE_FIELD( m_flFOVRate, FIELD_FLOAT ), - END_PREDICTION_DATA() +END_PREDICTION_DATA() - BEGIN_PREDICTION_DATA( C_BasePlayer ) +BEGIN_PREDICTION_DATA( C_BasePlayer ) DEFINE_PRED_TYPEDESCRIPTION( m_Local, CPlayerLocalData ), DEFINE_PRED_TYPEDESCRIPTION( pl, CPlayerState ), @@ -472,9 +473,11 @@ RecvPropDataTable( "localdata", 0, 0, &REFERENCE_RECV_TABLE( DT_LocalPlayerExclu DEFINE_FIELD( m_surfaceFriction, FIELD_FLOAT ), - END_PREDICTION_DATA() +END_PREDICTION_DATA() + +LINK_ENTITY_TO_CLASS( player, C_BasePlayer ); - LINK_ENTITY_TO_CLASS( player, C_BasePlayer ); +// clang-format on // -------------------------------------------------------------------------------- // // Functions. diff --git a/src/game/client/recvproxy.h b/src/game/client/recvproxy.h index 67d5d52e01..b25b41e6d7 100644 --- a/src/game/client/recvproxy.h +++ b/src/game/client/recvproxy.h @@ -8,12 +8,10 @@ #ifndef RECVPROXY_H #define RECVPROXY_H - #include "dt_recv.h" class CRecvProxyData; - // This converts the int stored in pData to an EHANDLE in pOut. void RecvProxy_IntToEHandle( const CRecvProxyData *pData, void *pStruct, void *pOut ); @@ -26,33 +24,32 @@ void RecvProxy_IntToModelIndex16_BackCompatible( const CRecvProxyData *pData, vo void RecvProxy_IntToModelIndex32_BackCompatible( const CRecvProxyData *pData, void *pStruct, void *pOut ); RecvProp RecvPropTime( - const char *pVarName, - int offset, - int sizeofVar=SIZEOF_IGNORE ); + const char *pVarName, + int offset, + int sizeofVar = SIZEOF_IGNORE ); #if !defined( NO_ENTITY_PREDICTION ) RecvProp RecvPropPredictableId( - const char *pVarName, - int offset, - int sizeofVar=SIZEOF_IGNORE ); + const char *pVarName, + int offset, + int sizeofVar = SIZEOF_IGNORE ); #endif RecvProp RecvPropEHandle( - const char *pVarName, - int offset, - int sizeofVar=SIZEOF_IGNORE, - RecvVarProxyFn proxyFn=RecvProxy_IntToEHandle ); + const char *pVarName, + int offset, + int sizeofVar = SIZEOF_IGNORE, + RecvVarProxyFn proxyFn = RecvProxy_IntToEHandle ); RecvProp RecvPropBool( - const char *pVarName, - int offset, - int sizeofVar ); + const char *pVarName, + int offset, + int sizeofVar ); RecvProp RecvPropIntWithMinusOneFlag( - const char *pVarName, - int offset, - int sizeofVar=SIZEOF_IGNORE, - RecvVarProxyFn proxyFn=RecvProxy_IntSubOne ); - -#endif // RECVPROXY_H + const char *pVarName, + int offset, + int sizeofVar = SIZEOF_IGNORE, + RecvVarProxyFn proxyFn = RecvProxy_IntSubOne ); +#endif // RECVPROXY_H diff --git a/src/game/server/baseentity.cpp b/src/game/server/baseentity.cpp index 49857ac25f..ab56258964 100644 --- a/src/game/server/baseentity.cpp +++ b/src/game/server/baseentity.cpp @@ -157,23 +157,26 @@ void *SendProxy_ClientSideAnimation( const SendProp *pProp, const void *pStruct, else return NULL; // Don't send animtime unless the client needs it. } + +// clang-format off + REGISTER_SEND_PROXY_NON_MODIFIED_POINTER( SendProxy_ClientSideAnimation ); BEGIN_SEND_TABLE_NOBASE( CBaseEntity, DT_AnimTimeMustBeFirst ) -// NOTE: Animtime must be sent before origin and angles ( from pev ) because it has a -// proxy on the client that stores off the old values before writing in the new values and -// if it is sent after the new values, then it will only have the new origin and studio model, etc. -// interpolation will be busted -SendPropInt( SENDINFO( m_flAnimTime ), 8, SPROP_UNSIGNED | SPROP_CHANGES_OFTEN | SPROP_ENCODED_AGAINST_TICKCOUNT, SendProxy_AnimTime ), - END_SEND_TABLE() + // NOTE: Animtime must be sent before origin and angles ( from pev ) because it has a + // proxy on the client that stores off the old values before writing in the new values and + // if it is sent after the new values, then it will only have the new origin and studio model, etc. + // interpolation will be busted + SendPropInt( SENDINFO( m_flAnimTime ), 8, SPROP_UNSIGNED | SPROP_CHANGES_OFTEN | SPROP_ENCODED_AGAINST_TICKCOUNT, SendProxy_AnimTime ), +END_SEND_TABLE() #if !defined( NO_ENTITY_PREDICTION ) - BEGIN_SEND_TABLE_NOBASE( CBaseEntity, DT_PredictableId ) - SendPropPredictableId( SENDINFO( m_PredictableID ) ), +BEGIN_SEND_TABLE_NOBASE( CBaseEntity, DT_PredictableId ) + SendPropPredictableId( SENDINFO( m_PredictableID ) ), SendPropInt( SENDINFO( m_bIsPlayerSimulated ), 1, SPROP_UNSIGNED ), - END_SEND_TABLE() +END_SEND_TABLE() - static void *SendProxy_SendPredictableId( const SendProp *pProp, const void *pStruct, const void *pVarData, CSendProxyRecipients *pRecipients, int objectID ) +static void *SendProxy_SendPredictableId( const SendProp *pProp, const void *pStruct, const void *pVarData, CSendProxyRecipients *pRecipients, int objectID ) { CBaseEntity *pEntity = ( CBaseEntity * )pStruct; if ( !pEntity || !pEntity->m_PredictableID->IsActive() ) @@ -187,6 +190,8 @@ SendPropInt( SENDINFO( m_flAnimTime ), 8, SPROP_UNSIGNED | SPROP_CHANGES_OFTEN | REGISTER_SEND_PROXY_NON_MODIFIED_POINTER( SendProxy_SendPredictableId ); #endif +static void* WORKAROUND_NASTY_FORMATTING_BUG; // clang-format on + void SendProxy_Origin( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ) { CBaseEntity *entity = ( CBaseEntity * )pStruct; @@ -258,9 +263,11 @@ void SendProxy_Angles( const SendProp *pProp, const void *pStruct, const void *p pOut->m_Vector[2] = anglemod( a->z ); } +// clang-format off + // This table encodes the CBaseEntity data. IMPLEMENT_SERVERCLASS_ST_NOBASE( CBaseEntity, DT_BaseEntity ) -SendPropDataTable( "AnimTimeMustBeFirst", 0, &REFERENCE_SEND_TABLE( DT_AnimTimeMustBeFirst ), SendProxy_ClientSideAnimation ), + SendPropDataTable( "AnimTimeMustBeFirst", 0, &REFERENCE_SEND_TABLE( DT_AnimTimeMustBeFirst ), SendProxy_ClientSideAnimation ), SendPropInt( SENDINFO( m_flSimulationTime ), SIMULATION_TIME_WINDOW_BITS, SPROP_UNSIGNED | SPROP_CHANGES_OFTEN | SPROP_ENCODED_AGAINST_TICKCOUNT, SendProxy_SimulationTime ), #if PREDICTION_ERROR_CHECK_LEVEL > 1 @@ -308,10 +315,12 @@ SendPropDataTable( "AnimTimeMustBeFirst", 0, &REFERENCE_SEND_TABLE( DT_AnimTimeM SendPropArray3( SENDINFO_ARRAY3( m_nModelIndexOverrides ), SendPropInt( SENDINFO_ARRAY( m_nModelIndexOverrides ), SP_MODEL_INDEX_BITS, 0 ) ), #endif - END_SEND_TABLE() +END_SEND_TABLE() - // dynamic models - class CBaseEntityModelLoadProxy +static void* WORKAROUND_NASTY_FORMATTING_BUG2; // clang-format on + +// dynamic models +class CBaseEntityModelLoadProxy { protected: class Handler : public IModelLoadCallback @@ -1817,26 +1826,28 @@ class CThinkContextsSaveDataOps : public CDefSaveRestoreOps CThinkContextsSaveDataOps g_ThinkContextsSaveDataOps; ISaveRestoreOps *thinkcontextFuncs = &g_ThinkContextsSaveDataOps; +// clang-format off + BEGIN_SIMPLE_DATADESC( thinkfunc_t ) -DEFINE_FIELD( m_iszContext, FIELD_STRING ), + DEFINE_FIELD( m_iszContext, FIELD_STRING ), // DEFINE_FIELD( m_pfnThink, FIELD_FUNCTION ), // Manually written DEFINE_FIELD( m_nNextThinkTick, FIELD_TICK ), DEFINE_FIELD( m_nLastThinkTick, FIELD_TICK ), - END_DATADESC() +END_DATADESC() - BEGIN_SIMPLE_DATADESC( ResponseContext_t ) +BEGIN_SIMPLE_DATADESC( ResponseContext_t ) - DEFINE_FIELD( m_iszName, FIELD_STRING ), + DEFINE_FIELD( m_iszName, FIELD_STRING ), DEFINE_FIELD( m_iszValue, FIELD_STRING ), DEFINE_FIELD( m_fExpirationTime, FIELD_TIME ), - END_DATADESC() +END_DATADESC() - BEGIN_DATADESC_NO_BASE( CBaseEntity ) +BEGIN_DATADESC_NO_BASE( CBaseEntity ) - DEFINE_KEYFIELD( m_iClassname, FIELD_STRING, "classname" ), + DEFINE_KEYFIELD( m_iClassname, FIELD_STRING, "classname" ), DEFINE_GLOBAL_KEYFIELD( m_iGlobalname, FIELD_STRING, "globalname" ), DEFINE_KEYFIELD( m_iParent, FIELD_STRING, "parentname" ), @@ -1857,8 +1868,9 @@ DEFINE_FIELD( m_iszContext, FIELD_STRING ), DEFINE_KEYFIELD( m_clrRender, FIELD_COLOR32, "rendercolor" ), DEFINE_GLOBAL_KEYFIELD( m_nModelIndex, FIELD_SHORT, "modelindex" ), #if !defined( NO_ENTITY_PREDICTION ) -// DEFINE_FIELD( m_PredictableID, CPredictableId ), + // DEFINE_FIELD( m_PredictableID, CPredictableId ), #endif + DEFINE_FIELD( touchStamp, FIELD_INTEGER ), DEFINE_CUSTOM_FIELD( m_aThinkFunctions, thinkcontextFuncs ), // m_iCurrentThinkContext (not saved, debug field only, and think transient to boot) @@ -1951,8 +1963,8 @@ DEFINE_FIELD( m_iszContext, FIELD_STRING ), DEFINE_FIELD( m_fFlags, FIELD_INTEGER ), #if !defined( NO_ENTITY_PREDICTION ) -// DEFINE_FIELD( m_bIsPlayerSimulated, FIELD_INTEGER ), -// DEFINE_FIELD( m_hPlayerSimulationOwner, FIELD_EHANDLE ), + // DEFINE_FIELD( m_bIsPlayerSimulated, FIELD_INTEGER ), + // DEFINE_FIELD( m_hPlayerSimulationOwner, FIELD_EHANDLE ), #endif // DEFINE_FIELD( m_pTimedOverlay, TimedOverlay_t* ), DEFINE_FIELD( m_nSimulationTick, FIELD_TICK ), @@ -2021,17 +2033,19 @@ DEFINE_FIELD( m_iszContext, FIELD_STRING ), DEFINE_FIELD( m_hEffectEntity, FIELD_EHANDLE ), -// DEFINE_FIELD( m_DamageModifiers, FIELD_?? ), // can't save? -// DEFINE_FIELD( m_fDataObjectTypes, FIELD_INTEGER ), + // DEFINE_FIELD( m_DamageModifiers, FIELD_?? ), // can't save? + // DEFINE_FIELD( m_fDataObjectTypes, FIELD_INTEGER ), #ifdef TF_DLL DEFINE_ARRAY( m_nModelIndexOverrides, FIELD_INTEGER, MAX_VISION_MODES ), #endif - END_DATADESC() +END_DATADESC() + +static void *WORKAROUND_NASTY_FORMATTING_BUG3; // clang-format on - // For code error checking - extern bool g_bReceivedChainedUpdateOnRemove; +// For code error checking +extern bool g_bReceivedChainedUpdateOnRemove; //----------------------------------------------------------------------------- // Purpose: Called just prior to object destruction diff --git a/src/game/server/sendproxy.h b/src/game/server/sendproxy.h index 99527b1eee..2a378a2553 100644 --- a/src/game/server/sendproxy.h +++ b/src/game/server/sendproxy.h @@ -8,10 +8,8 @@ #ifndef SENDPROXY_H #define SENDPROXY_H - #include "dt_send.h" - class DVariant; void SendProxy_Color32ToInt( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); @@ -20,36 +18,42 @@ void SendProxy_IntAddOne( const SendProp *pProp, const void *pStruct, const void void SendProxy_ShortAddOne( const SendProp *pProp, const void *pStruct, const void *pVarData, DVariant *pOut, int iElement, int objectID ); SendProp SendPropBool( - const char *pVarName, - int offset, - int sizeofVar ); + const char *pVarName, + int offset, + int sizeofVar ); SendProp SendPropEHandle( - const char *pVarName, - int offset, - int sizeofVar=SIZEOF_IGNORE, - int flags = 0, - SendVarProxyFn proxyFn=SendProxy_EHandleToInt ); + const char *pVarName, + int offset, + int sizeofVar = SIZEOF_IGNORE, + int flags = 0, + SendVarProxyFn proxyFn = SendProxy_EHandleToInt ); SendProp SendPropTime( - const char *pVarName, - int offset, - int sizeofVar=SIZEOF_IGNORE ); + const char *pVarName, + int offset, + int sizeofVar = SIZEOF_IGNORE ); #if !defined( NO_ENTITY_PREDICTION ) SendProp SendPropPredictableId( - const char *pVarName, - int offset, - int sizeofVar=SIZEOF_IGNORE ); + const char *pVarName, + int offset, + int sizeofVar = SIZEOF_IGNORE ); #endif -SendProp SendPropIntWithMinusOneFlag( - const char *pVarName, - int offset, - int sizeofVar=SIZEOF_IGNORE, - int bits=-1, - SendVarProxyFn proxyFn=SendProxy_IntAddOne ); +#ifdef LUA_SDK +SendProp SendPropLuaNetworkVariables( + const char *pVarName, + int offset, + int sizeofVar = SIZEOF_IGNORE ); +#endif +SendProp SendPropIntWithMinusOneFlag( + const char *pVarName, + int offset, + int sizeofVar = SIZEOF_IGNORE, + int bits = -1, + SendVarProxyFn proxyFn = SendProxy_IntAddOne ); // Send a string_t as a string property. SendProp SendPropStringT( const char *pVarName, int offset, int sizeofVar ); @@ -57,7 +61,6 @@ SendProp SendPropStringT( const char *pVarName, int offset, int sizeofVar ); //----------------------------------------------------------------------------- // Purpose: Proxy that only sends data to team members //----------------------------------------------------------------------------- -void* SendProxy_OnlyToTeam( const SendProp *pProp, const void *pStruct, const void *pVarData, CSendProxyRecipients *pRecipients, int objectID ); - +void *SendProxy_OnlyToTeam( const SendProp *pProp, const void *pStruct, const void *pVarData, CSendProxyRecipients *pRecipients, int objectID ); -#endif // SENDPROXY_H +#endif // SENDPROXY_H