extern void SendProxy_Origin( const SendProp *pProp, const void *pStruct, const void *pData, DVariant *pOut, int iElement, int objectID ); //Tony; this should ideally be added to dt_send.cpp void* SendProxy_SendNonLocalDataTable( const SendProp *pProp, const void *pStruct, const void *pVarData, CSendProxyRecipients *pRecipients, int objectID ) { pRecipients->SetAllRecipients(); pRecipients->ClearRecipient( objectID - 1 ); return ( void * )pVarData; } REGISTER_SEND_PROXY_NON_MODIFIED_POINTER( SendProxy_SendNonLocalDataTable ); BEGIN_SEND_TABLE_NOBASE( CHL2MP_Player, DT_HL2MPLocalPlayerExclusive ) // send a hi-res origin to the local player for use in prediction SendPropVector (SENDINFO(m_vecOrigin), -1, SPROP_NOSCALE|SPROP_CHANGES_OFTEN, 0.0f, HIGH_DEFAULT, SendProxy_Origin ), SendPropFloat( SENDINFO_VECTORELEM(m_angEyeAngles, 0), 8, SPROP_CHANGES_OFTEN, -90.0f, 90.0f ), // SendPropAngle( SENDINFO_VECTORELEM(m_angEyeAngles, 1), 10, SPROP_CHANGES_OFTEN ), END_SEND_TABLE() BEGIN_SEND_TABLE_NOBASE( CHL2MP_Player, DT_HL2MPNonLocalPlayerExclusive ) // send a lo-res origin to other players SendPropVector (SENDINFO(m_vecOrigin), -1, SPROP_COORD_MP_LOWPRECISION|SPROP_CHANGES_OFTEN, 0.0f, HIGH_DEFAULT, SendProxy_Origin ), SendPropFloat( SENDINFO_VECTORELEM(m_angEyeAngles, 0), 8, SPROP_CHANGES_OFTEN, -90.0f, 90.0f ), SendPropAngle( SENDINFO_VECTORELEM(m_angEyeAngles, 1), 10, SPROP_CHANGES_OFTEN ), END_SEND_TABLE() IMPLEMENT_SERVERCLASS_ST(CHL2MP_Player, DT_HL2MP_Player) SendPropExclude( "DT_BaseAnimating", "m_flPoseParameter" ), SendPropExclude( "DT_BaseAnimating", "m_flPlaybackRate" ), SendPropExclude( "DT_BaseAnimating", "m_nSequence" ), SendPropExclude( "DT_BaseEntity", "m_angRotation" ),
// // Purpose: // // $NoKeywords: $ //=============================================================================// #include "cbase.h" #include "dt_send.h" #include "server_class.h" #include "te_particlesystem.h" #include "coordsize.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" IMPLEMENT_SERVERCLASS_ST(CTEParticleSystem, DT_TEParticleSystem) #if defined( TF_DLL ) SendPropFloat( SENDINFO_VECTORELEM( m_vecOrigin, 0 ), -1, SPROP_COORD_MP_INTEGRAL ), SendPropFloat( SENDINFO_VECTORELEM( m_vecOrigin, 1 ), -1, SPROP_COORD_MP_INTEGRAL ), SendPropFloat( SENDINFO_VECTORELEM( m_vecOrigin, 2 ), -1, SPROP_COORD_MP_INTEGRAL ), #else SendPropFloat( SENDINFO_VECTORELEM(m_vecOrigin, 0), -1, SPROP_COORD), SendPropFloat( SENDINFO_VECTORELEM(m_vecOrigin, 1), -1, SPROP_COORD), SendPropFloat( SENDINFO_VECTORELEM(m_vecOrigin, 2), -1, SPROP_COORD), #endif END_SEND_TABLE()
CBaseEntity *g_pLastCombineSpawn = NULL; CBaseEntity *g_pLastRebelSpawn = NULL; extern CBaseEntity *g_pLastSpawn; #define HL2MP_COMMAND_MAX_RATE 0.3 void DropPrimedFragGrenade( CHL2MP_Player *pPlayer, CBaseCombatWeapon *pGrenade ); LINK_ENTITY_TO_CLASS( player, CHL2MP_Player ); LINK_ENTITY_TO_CLASS( info_player_combine, CPointEntity ); LINK_ENTITY_TO_CLASS( info_player_rebel, CPointEntity ); IMPLEMENT_SERVERCLASS_ST(CHL2MP_Player, DT_HL2MP_Player) SendPropAngle( SENDINFO_VECTORELEM(m_angEyeAngles, 0), 11, SPROP_CHANGES_OFTEN ), SendPropAngle( SENDINFO_VECTORELEM(m_angEyeAngles, 1), 11, SPROP_CHANGES_OFTEN ), SendPropEHandle( SENDINFO( m_hRagdoll ) ), SendPropInt( SENDINFO( m_iSpawnInterpCounter), 4 ), SendPropInt( SENDINFO( m_iPlayerSoundType), 3 ), SendPropExclude( "DT_BaseAnimating", "m_flPoseParameter" ), SendPropExclude( "DT_BaseFlex", "m_viewtarget" ), // SendPropExclude( "DT_ServerAnimationData" , "m_flCycle" ), // SendPropExclude( "DT_AnimTimeMustBeFirst" , "m_flAnimTime" ), END_SEND_TABLE() BEGIN_DATADESC( CHL2MP_Player ) END_DATADESC()
SendPropArray3 (SENDINFO_ARRAY3(m_chAreaBits), SendPropInt(SENDINFO_ARRAY(m_chAreaBits), 8, SPROP_UNSIGNED)), SendPropArray3 (SENDINFO_ARRAY3(m_chAreaPortalBits), SendPropInt(SENDINFO_ARRAY(m_chAreaPortalBits), 8, SPROP_UNSIGNED)), SendPropInt (SENDINFO(m_iHideHUD), HIDEHUD_BITCOUNT, SPROP_UNSIGNED), SendPropFloat (SENDINFO(m_flFOVRate), 0, SPROP_NOSCALE ), SendPropInt (SENDINFO(m_bDucked), 1, SPROP_UNSIGNED ), SendPropInt (SENDINFO(m_bDucking), 1, SPROP_UNSIGNED ), SendPropInt (SENDINFO(m_bInDuckJump), 1, SPROP_UNSIGNED ), SendPropFloat (SENDINFO(m_flDucktime), 12, SPROP_ROUNDDOWN|SPROP_CHANGES_OFTEN, 0.0f, 2048.0f ), SendPropFloat (SENDINFO(m_flDuckJumpTime), 12, SPROP_ROUNDDOWN, 0.0f, 2048.0f ), SendPropFloat (SENDINFO(m_flJumpTime), 12, SPROP_ROUNDDOWN, 0.0f, 2048.0f ), #if PREDICTION_ERROR_CHECK_LEVEL > 1 SendPropFloat (SENDINFO(m_flFallVelocity), 32, SPROP_NOSCALE ), SendPropFloat ( SENDINFO_VECTORELEM(m_vecPunchAngle, 0), 32, SPROP_NOSCALE|SPROP_CHANGES_OFTEN ), SendPropFloat ( SENDINFO_VECTORELEM(m_vecPunchAngle, 1), 32, SPROP_NOSCALE|SPROP_CHANGES_OFTEN ), SendPropFloat ( SENDINFO_VECTORELEM(m_vecPunchAngle, 2), 32, SPROP_NOSCALE|SPROP_CHANGES_OFTEN ), SendPropFloat ( SENDINFO_VECTORELEM(m_vecPunchAngleVel, 0), 32, SPROP_NOSCALE|SPROP_CHANGES_OFTEN ), SendPropFloat ( SENDINFO_VECTORELEM(m_vecPunchAngleVel, 1), 32, SPROP_NOSCALE|SPROP_CHANGES_OFTEN ), SendPropFloat ( SENDINFO_VECTORELEM(m_vecPunchAngleVel, 2), 32, SPROP_NOSCALE|SPROP_CHANGES_OFTEN ), #else SendPropFloat (SENDINFO(m_flFallVelocity), 17, SPROP_CHANGES_OFTEN, -4096.0f, 4096.0f ), SendPropVector (SENDINFO(m_vecPunchAngle), -1, SPROP_COORD|SPROP_CHANGES_OFTEN), SendPropVector (SENDINFO(m_vecPunchAngleVel), -1, SPROP_COORD), #endif SendPropInt (SENDINFO(m_bDrawViewmodel), 1, SPROP_UNSIGNED ), SendPropInt (SENDINFO(m_bWearingSuit), 1, SPROP_UNSIGNED ), SendPropBool (SENDINFO(m_bPoisoned)),
m_vecOrigin += Vector( 0, 0, 24 ); AngleVectors( current_angles, &forward, &right, 0 ); forward[2] = 0.0; VectorNormalize( forward ); VectorMA( m_vecOrigin, 50.0, forward, m_vecOrigin.GetForModify() ); VectorMA( m_vecOrigin, 25.0, right, m_vecOrigin.GetForModify() ); CBroadcastRecipientFilter filter; Create( filter, 0.0 ); } IMPLEMENT_SERVERCLASS_ST(CTEPhysicsProp, DT_TEPhysicsProp) SendPropVector( SENDINFO(m_vecOrigin), -1, SPROP_COORD), SendPropAngle( SENDINFO_VECTORELEM(m_angRotation, 0), 13 ), SendPropAngle( SENDINFO_VECTORELEM(m_angRotation, 1), 13 ), SendPropAngle( SENDINFO_VECTORELEM(m_angRotation, 2), 13 ), SendPropVector( SENDINFO(m_vecVelocity), -1, SPROP_COORD), SendPropModelIndex( SENDINFO(m_nModelIndex) ), SendPropInt( SENDINFO(m_nSkin), ANIMATION_SKIN_BITS), SendPropInt( SENDINFO(m_nFlags), 2, SPROP_UNSIGNED ), SendPropInt( SENDINFO(m_nEffects), EF_MAX_BITS, SPROP_UNSIGNED), END_SEND_TABLE() // Singleton to fire TEBreakModel objects static CTEPhysicsProp s_TEPhysicsProp( "physicsprop" ); void TE_PhysicsProp( IRecipientFilter& filter, float delay, int modelindex, int skin, const Vector& pos, const QAngle &angles, const Vector& vel, int flags, int effects ) {
//----------------------------------------------------------------------------- CTEFireBullets::CTEFireBullets(const char *name) : CBaseTempEntity(name) { } //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- CTEFireBullets::~CTEFireBullets(void) { } IMPLEMENT_SERVERCLASS_ST_NOBASE(CTEFireBullets, DT_TEFireBullets) SendPropVector(SENDINFO(m_vecOrigin), -1, SPROP_COORD), SendPropAngle(SENDINFO_VECTORELEM(m_vecAngles, 0), 13, 0), SendPropAngle(SENDINFO_VECTORELEM(m_vecAngles, 1), 13, 0), SendPropInt(SENDINFO(m_iWeaponID), 5, SPROP_UNSIGNED), // max 31 weapons SendPropInt(SENDINFO(m_iMode), 1, SPROP_UNSIGNED), SendPropInt(SENDINFO(m_iSeed), NUM_BULLET_SEED_BITS, SPROP_UNSIGNED), SendPropInt(SENDINFO(m_iPlayer), 6, SPROP_UNSIGNED), // max 64 players, see MAX_PLAYERS SendPropFloat(SENDINFO(m_flSpread), 10, 0, 0, 1), END_SEND_TABLE() // Singleton static CTEFireBullets g_TEFireBullets("Shotgun Shot"); void TE_FireBullets( int iPlayerIndex,
private: static CUtlVector<CStickyBomb *> m_stickyList; EHANDLE m_hOperator; CNetworkVar( int, m_boneIndexAttached ); CNetworkVector( m_bonePosition ); CNetworkQAngle( m_boneAngles ); }; LINK_ENTITY_TO_CLASS( grenade_stickybomb, CStickyBomb ); IMPLEMENT_SERVERCLASS_ST(CStickyBomb, DT_StickyBomb) SendPropInt( SENDINFO( m_boneIndexAttached ), MAXSTUDIOBONEBITS, SPROP_UNSIGNED ), SendPropVector(SENDINFO(m_bonePosition), -1, SPROP_COORD ), SendPropAngle(SENDINFO_VECTORELEM(m_boneAngles, 0), 13 ), SendPropAngle(SENDINFO_VECTORELEM(m_boneAngles, 1), 13 ), SendPropAngle(SENDINFO_VECTORELEM(m_boneAngles, 2), 13 ), END_SEND_TABLE() //--------------------------------------------------------- // Save/Restore //--------------------------------------------------------- BEGIN_DATADESC( CStickyBomb ) DEFINE_FIELD( CStickyBomb, m_hOperator, FIELD_EHANDLE ), DEFINE_FIELD( CStickyBomb, m_boneIndexAttached, FIELD_INTEGER ), DEFINE_FIELD( CStickyBomb, m_bonePosition, FIELD_VECTOR ), DEFINE_FIELD( CStickyBomb, m_boneAngles, FIELD_VECTOR ),
if ( entity->HasSpawnFlags(SF_BRUSH_ROTATE_CLIENTSIDE) ) { pOut->m_Int = 0; return; } SendProxy_SimulationTime( pProp, pStruct, pVarData, pOut, iElement, objectID ); } IMPLEMENT_SERVERCLASS_ST(CFuncRotating, DT_FuncRotating) SendPropExclude( "DT_BaseEntity", "m_angRotation" ), SendPropExclude( "DT_BaseEntity", "m_vecOrigin" ), SendPropExclude( "DT_BaseEntity", "m_flSimulationTime" ), SendPropVector(SENDINFO(m_vecOrigin), -1, SPROP_COORD|SPROP_CHANGES_OFTEN, 0.0f, HIGH_DEFAULT, SendProxy_FuncRotatingOrigin ), SendPropAngle( SENDINFO_VECTORELEM(m_angRotation, 0), 13, SPROP_CHANGES_OFTEN, SendProxy_FuncRotatingAngle ), SendPropAngle( SENDINFO_VECTORELEM(m_angRotation, 1), 13, SPROP_CHANGES_OFTEN, SendProxy_FuncRotatingAngle ), SendPropAngle( SENDINFO_VECTORELEM(m_angRotation, 2), 13, SPROP_CHANGES_OFTEN, SendProxy_FuncRotatingAngle ), SendPropInt(SENDINFO(m_flSimulationTime), SIMULATION_TIME_WINDOW_BITS, SPROP_UNSIGNED|SPROP_CHANGES_OFTEN|SPROP_ENCODED_AGAINST_TICKCOUNT, SendProxy_FuncRotatingSimulationTime), END_SEND_TABLE() //----------------------------------------------------------------------------- // Purpose: Handles keyvalues from the BSP. Called before spawning. //----------------------------------------------------------------------------- bool CFuncRotating::KeyValue( const char *szKeyName, const char *szValue ) { if (FStrEq(szKeyName, "fanfriction")) {
IMPLEMENT_SERVERCLASS_ST( CSDKPlayer, DT_SDKPlayer ) SendPropExclude( "DT_BaseAnimating", "m_flPoseParameter" ), SendPropExclude( "DT_BaseAnimating", "m_flPlaybackRate" ), SendPropExclude( "DT_BaseAnimating", "m_nSequence" ), SendPropExclude( "DT_BaseEntity", "m_angRotation" ), SendPropExclude( "DT_BaseAnimatingOverlay", "overlay_vars" ), // playeranimstate and clientside animation takes care of these on the client SendPropExclude( "DT_ServerAnimationData" , "m_flCycle" ), SendPropExclude( "DT_AnimTimeMustBeFirst" , "m_flAnimTime" ), // Data that only gets sent to the local player. SendPropDataTable( "sdklocaldata", 0, &REFERENCE_SEND_TABLE(DT_SDKLocalPlayerExclusive), SendProxy_SendLocalDataTable ), SendPropAngle( SENDINFO_VECTORELEM(m_angEyeAngles, 0), 11 ), SendPropAngle( SENDINFO_VECTORELEM(m_angEyeAngles, 1), 11 ), SendPropEHandle( SENDINFO( m_hRagdoll ) ), SendPropInt( SENDINFO( m_iThrowGrenadeCounter ), THROWGRENADE_COUNTER_BITS, SPROP_UNSIGNED ), END_SEND_TABLE() class CSDKRagdoll : public CBaseAnimatingOverlay { public: DECLARE_CLASS( CSDKRagdoll, CBaseAnimatingOverlay ); DECLARE_SERVERCLASS(); // Transmit ragdolls to everyone. virtual int UpdateTransmitState() {
CBaseFlex *pBaseFlex = (CBaseFlex*)pStruct; return pBaseFlex->GetNumFlexControllers(); } // SendTable stuff. IMPLEMENT_SERVERCLASS_ST(CBaseFlex, DT_BaseFlex) SendPropVariableLengthArray( ArrayLengthSendProxy_FlexWeightLen, SendPropFloat (SENDINFO_ARRAY(m_flexWeight), 12, SPROP_ROUNDDOWN, 0.0f, 1.0f), m_flexWeight ), SendPropInt (SENDINFO(m_blinktoggle), 1, SPROP_UNSIGNED ), SendPropVector (SENDINFO(m_viewtarget), -1, SPROP_COORD), #ifdef HL2_DLL SendPropFloat ( SENDINFO_VECTORELEM(m_vecViewOffset, 0), 8, 0, -32.0, 32.0f), SendPropFloat ( SENDINFO_VECTORELEM(m_vecViewOffset, 1), 8, 0, -32.0, 32.0f), SendPropFloat ( SENDINFO_VECTORELEM(m_vecViewOffset, 2), 16, 0, -64.0f, 128.0f), #endif END_SEND_TABLE() BEGIN_DATADESC( CBaseFlex ) // m_blinktoggle DEFINE_ARRAY( CBaseFlex, m_flexWeight, FIELD_FLOAT, 64 ), DEFINE_FIELD( CBaseFlex, m_viewtarget, FIELD_POSITION_VECTOR ), // m_Expressions // m_FileList
void Spawn( void ); int UpdateTransmitState(); DECLARE_SERVERCLASS(); DECLARE_DATADESC(); private: void Spin( void ); }; // This table encodes the CBaseEntity data. IMPLEMENT_SERVERCLASS_ST_NOBASE(CTestTraceline, DT_TestTraceline) SendPropInt (SENDINFO(m_clrRender), 32, SPROP_UNSIGNED ), SendPropVector (SENDINFO(m_vecOrigin), 19, 0, MIN_COORD_INTEGER, MAX_COORD_INTEGER), SendPropFloat (SENDINFO_VECTORELEM(m_angRotation, 0), 19, 0, MIN_COORD_INTEGER, MAX_COORD_INTEGER), SendPropFloat (SENDINFO_VECTORELEM(m_angRotation, 1), 19, 0, MIN_COORD_INTEGER, MAX_COORD_INTEGER), SendPropFloat (SENDINFO_VECTORELEM(m_angRotation, 2), 19, 0, MIN_COORD_INTEGER, MAX_COORD_INTEGER), SendPropEHandle (SENDINFO_NAME(m_hMoveParent, moveparent)), END_SEND_TABLE() LINK_ENTITY_TO_CLASS( test_traceline, CTestTraceline ); BEGIN_DATADESC( CTestTraceline ) // Function Pointers DEFINE_FUNCTION( Spin ), END_DATADESC()