コード例 #1
0
// How fast to avoid collisions with center of other object, in units per second
#define AVOID_SPEED 2000.0f
extern ConVar cl_forwardspeed;
extern ConVar cl_backspeed;
extern ConVar cl_sidespeed;

extern ConVar zoom_sensitivity_ratio;
extern ConVar default_fov;
extern ConVar sensitivity;

ConVar cl_npc_speedmod_intime( "cl_npc_speedmod_intime", "0.25", FCVAR_CLIENTDLL | FCVAR_ARCHIVE );
ConVar cl_npc_speedmod_outtime( "cl_npc_speedmod_outtime", "1.5", FCVAR_CLIENTDLL | FCVAR_ARCHIVE );

IMPLEMENT_CLIENTCLASS_DT(C_BaseHLPlayer, DT_HL2_Player, CHL2_Player)
	RecvPropDataTable( RECVINFO_DT(m_HL2Local),0, &REFERENCE_RECV_TABLE(DT_HL2Local) ),
	RecvPropBool( RECVINFO( m_fIsSprinting ) ),
END_RECV_TABLE()

BEGIN_PREDICTION_DATA( C_BaseHLPlayer )
	DEFINE_PRED_TYPEDESCRIPTION( m_HL2Local, C_HL2PlayerLocalData ),
	DEFINE_PRED_FIELD( m_fIsSprinting, FIELD_BOOLEAN, FTYPEDESC_INSENDTABLE ),
END_PREDICTION_DATA()

void CC_PickerShader ( const CCommand &args )
{
	C_BasePlayer *pPlayer = (C_BasePlayer *) C_BasePlayer::GetLocalPlayer();
	if ( !pPlayer )
		return;

	trace_t tr;
コード例 #2
0
	RecvPropBool(RECVINFO(m_bChargedshotBlocked)),
	RecvPropBool(RECVINFO(m_bShotsBlocked)),
END_RECV_TABLE()

BEGIN_RECV_TABLE_NOBASE( C_SDKPlayer, DT_SDKNonLocalPlayerExclusive )
	RecvPropVector( RECVINFO_NAME( m_vecNetworkOrigin, m_vecOrigin ) ),

	RecvPropFloat( RECVINFO( m_angEyeAngles[0] ) ),
	RecvPropFloat( RECVINFO( m_angEyeAngles[1] ) ),
	RecvPropFloat( RECVINFO( m_angCamViewAngles[0] ) ),
	RecvPropFloat( RECVINFO( m_angCamViewAngles[1] ) ),
END_RECV_TABLE()

// main table
IMPLEMENT_CLIENTCLASS_DT( C_SDKPlayer, DT_SDKPlayer, CSDKPlayer )
	RecvPropDataTable( RECVINFO_DT( m_Shared ), 0, &REFERENCE_RECV_TABLE( DT_SDKPlayerShared ) ),

	RecvPropDataTable( "sdklocaldata", 0, 0, &REFERENCE_RECV_TABLE(DT_SDKLocalPlayerExclusive) ),
	RecvPropDataTable( "sdknonlocaldata", 0, 0, &REFERENCE_RECV_TABLE(DT_SDKNonLocalPlayerExclusive) ),

	RecvPropEHandle( RECVINFO( m_hRagdoll ) ),

	RecvPropInt( RECVINFO( m_iPlayerState ) ),
	RecvPropTime( RECVINFO( m_flStateEnterTime ) ),

	RecvPropBool( RECVINFO( m_bSpawnInterpCounter ) ),

	RecvPropInt(RECVINFO(m_nModelScale)),
	RecvPropEHandle(RECVINFO(m_pHoldingBall)),
	RecvPropInt(RECVINFO(m_nSkinIndex)),
	RecvPropInt(RECVINFO(m_nHairIndex)),
コード例 #3
0
ファイル: c_func_dust.cpp プロジェクト: Au-heppa/swarm-sdk
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

IMPLEMENT_CLIENTCLASS_DT_NOBASE( C_Func_Dust, DT_Func_Dust, CFunc_Dust )
	RecvPropInt( RECVINFO(m_Color), 0, RecvProxy_Int32ToColor32 ),
	RecvPropInt( RECVINFO(m_SpawnRate) ),
	RecvPropFloat( RECVINFO(m_flSizeMin) ),
	RecvPropFloat( RECVINFO(m_flSizeMax) ),
	RecvPropInt( RECVINFO(m_LifetimeMin) ),
	RecvPropInt( RECVINFO(m_LifetimeMax) ),
	RecvPropInt( RECVINFO(m_DustFlags) ),
	RecvPropInt( RECVINFO(m_SpeedMax) ),
	RecvPropInt( RECVINFO(m_DistMax) ),
	RecvPropInt( RECVINFO( m_nModelIndex ) ),
	RecvPropFloat( RECVINFO( m_FallSpeed ) ),
	RecvPropDataTable( RECVINFO_DT( m_Collision ), 0, &REFERENCE_RECV_TABLE(DT_CollisionProperty) ),
END_RECV_TABLE()



// ------------------------------------------------------------------------------------ //
// CDustEffect implementation.
// ------------------------------------------------------------------------------------ //
#define DUST_ACCEL 50


void CDustEffect::RenderParticles( CParticleRenderIterator *pIterator )
{
	const CFuncDustParticle *pParticle = (const CFuncDustParticle*)pIterator->GetFirst();
	while ( pParticle )
	{
コード例 #4
0
	RecvPropUtlVector( 
		RECVINFO_UTLVECTOR( m_UtlVectorChar ),
		MAX_CHARARRAY_ELEMENTS,
		RecvPropInt( NULL, 0, sizeof( char ) ) ),

	RecvPropArray(
		RecvPropString(RECVINFO(m_Strings[0]), 0, RecvProxy_DTTestClientSubString),
		m_Strings),
END_RECV_TABLE()

BEGIN_RECV_TABLE_NOBASE(DTTestSub2Sub, DT_DTTestSub2Sub)
	RecvPropInt( RECVINFO( m_Int2 ), 32 ),
END_RECV_TABLE()

BEGIN_RECV_TABLE_NOBASE(DTTestSub2, DT_DTTestSub2)
	RecvPropDataTable(RECVINFO_DT(m_Sub), 0, &REFERENCE_RECV_TABLE(DT_DTTestSub2Sub)),
	RecvPropInt( RECVINFO( m_Int ) ),
END_RECV_TABLE()




// ------------------------------------------------------------------------------------------- //
// DTTestClient and DataTable.
// ------------------------------------------------------------------------------------------- //
class DTTestClient
{
public:
	DTTestClientSub		m_Sub;
	long				m_Guard1;
	
コード例 #5
0
// Input  : bool - 
//-----------------------------------------------------------------------------
void C_TEEffectDispatch::PostDataUpdate( DataUpdateType_t updateType )
{
	// Find the effect name.
	const char *pEffectName = networkstringtable->GetString( g_StringTableEffectDispatch, m_EffectData.GetEffectNameIndex() );
	if ( pEffectName )
	{
		DispatchEffectToCallback( pEffectName, m_EffectData );
	}
}


IMPLEMENT_CLIENTCLASS_EVENT_DT( C_TEEffectDispatch, DT_TEEffectDispatch, CTEEffectDispatch )
	
	RecvPropDataTable( RECVINFO_DT( m_EffectData ), 0, &REFERENCE_RECV_TABLE( DT_EffectData ) )
			
END_RECV_TABLE()

//-----------------------------------------------------------------------------
// Purpose: Clientside version
//-----------------------------------------------------------------------------
void TE_DispatchEffect( IRecipientFilter& filter, float delay, const Vector &pos, const char *pName, const CEffectData &data )
{
	DispatchEffectToCallback( pName, data );
}

// Client version of dispatch effect, for predicted weapons
void DispatchEffect( const char *pName, const CEffectData &data )
{
	CPASFilter filter( data.m_vOrigin );
コード例 #6
0
END_PREDICTION_DATA()

IMPLEMENT_NETWORKCLASS_ALIASED( BasePlasmaProjectile, DT_BasePlasmaProjectile)

BEGIN_NETWORK_TABLE( CBasePlasmaProjectile, DT_BasePlasmaProjectile )
#if !defined( CLIENT_DLL )
	SendPropDataTable(SENDINFO_DT(m_Shared), &REFERENCE_SEND_TABLE(DT_PlasmaProjectileShared)),

	SendPropExclude( "DT_BaseEntity", "m_vecVelocity" ),
	SendPropExclude( "DT_BaseEntity", "m_vecAbsOrigin" ),

	//SendPropVector(SENDINFO(m_vecGunOriginOffset), 0, SPROP_COORD),

#else
	RecvPropDataTable(RECVINFO_DT(m_Shared), 0, &REFERENCE_RECV_TABLE(DT_PlasmaProjectileShared)),

	//RecvPropVector(RECVINFO(m_vecGunOriginOffset)),
#endif
END_NETWORK_TABLE()

LINK_ENTITY_TO_CLASS( base_plasmaprojectile, CBasePlasmaProjectile );
PRECACHE_REGISTER(base_plasmaprojectile);

BEGIN_PREDICTION_DATA( CBasePlasmaProjectile )

	DEFINE_PRED_TYPEDESCRIPTION( m_Shared, CPlasmaProjectileShared ),

	DEFINE_PRED_FIELD( m_vecAbsOrigin, FIELD_VECTOR, FTYPEDESC_PRIVATE | FTYPEDESC_OVERRIDE ),
	DEFINE_PRED_FIELD( m_vecVelocity, FIELD_VECTOR, FTYPEDESC_PRIVATE | FTYPEDESC_OVERRIDE ),
コード例 #7
0
	virtual void OnDataChanged( DataUpdateType_t updateType );
	virtual void ClientThink();

private:
	C_EnvHeadcrabCanister( const C_EnvHeadcrabCanister & );

	CEnvHeadcrabCanisterShared	m_Shared;
	CNetworkVar( bool, m_bLanded );
};


EXTERN_RECV_TABLE(DT_EnvHeadcrabCanisterShared);

IMPLEMENT_CLIENTCLASS_DT( C_EnvHeadcrabCanister, DT_EnvHeadcrabCanister, CEnvHeadcrabCanister )
	RecvPropDataTable( RECVINFO_DT( m_Shared ), 0, &REFERENCE_RECV_TABLE(DT_EnvHeadcrabCanisterShared) ),
	RecvPropBool( RECVINFO( m_bLanded ) ),
END_RECV_TABLE()


//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
C_EnvHeadcrabCanister::C_EnvHeadcrabCanister()
{
}


//-----------------------------------------------------------------------------
// Destructor
//-----------------------------------------------------------------------------
コード例 #8
0
    int		m_iMaterialName;
    EntityParticleTrailInfo_t	m_Info;
    EHANDLE m_hConstraintEntity;

    PMaterialHandle		m_hMaterial;
    TimedEvent			m_teParticleSpawn;
};


//-----------------------------------------------------------------------------
// Networking
//-----------------------------------------------------------------------------
IMPLEMENT_CLIENTCLASS_DT( C_EntityParticleTrail, DT_EntityParticleTrail, CEntityParticleTrail )
RecvPropInt(RECVINFO(m_iMaterialName)),
            RecvPropDataTable( RECVINFO_DT( m_Info ), 0, &REFERENCE_RECV_TABLE(DT_EntityParticleTrailInfo) ),
            RecvPropEHandle(RECVINFO(m_hConstraintEntity)),
            END_RECV_TABLE()


//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
            C_EntityParticleTrail::C_EntityParticleTrail( void )
{
}

C_EntityParticleTrail::~C_EntityParticleTrail()
{
    ParticleMgr()->RemoveEffect( &m_ParticleEffect );
}
コード例 #9
0
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#include "cbase.h"
#include "c_basehlplayer.h"

extern ConVar default_fov;
extern ConVar sensitivity;
extern ConVar zoom_sensitivity_ratio;

IMPLEMENT_CLIENTCLASS_DT(C_BaseHLPlayer, DT_HL2_Player, CHL2_Player)
RecvPropDataTable(RECVINFO_DT(m_HL2Local),0, &REFERENCE_RECV_TABLE(DT_HL2Local), DataTableRecvProxy_StaticDataTable),
                  END_RECV_TABLE()

//-----------------------------------------------------------------------------
// Purpose: Drops player's primary weapon
//-----------------------------------------------------------------------------
                  void CC_DropPrimary( void )
{
    C_BasePlayer *pPlayer = (C_BasePlayer *) C_BasePlayer::GetLocalPlayer();

    if ( pPlayer == NULL )
        return;

    pPlayer->Weapon_DropPrimary();
}

static ConCommand dropprimary("dropprimary", CC_DropPrimary, "dropprimary: Drops the primary weapon of the player.");
コード例 #10
0
ファイル: econ_entity.cpp プロジェクト: TenmaPL/TF2Classic
#include "eventlist.h"

// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"

#ifdef CLIENT_DLL
EXTERN_RECV_TABLE( DT_ScriptCreatedItem )
#else
EXTERN_SEND_TABLE( DT_ScriptCreatedItem )
#endif

IMPLEMENT_NETWORKCLASS_ALIASED( EconEntity, DT_EconEntity )

BEGIN_NETWORK_TABLE( CEconEntity, DT_EconEntity )
#ifdef CLIENT_DLL
	RecvPropDataTable( RECVINFO_DT( m_Item ), 0, &REFERENCE_RECV_TABLE( DT_ScriptCreatedItem ) ),
	RecvPropDataTable( RECVINFO_DT( m_AttributeManager ), 0, &REFERENCE_RECV_TABLE( DT_AttributeContainer ) ),
#else
	SendPropDataTable( SENDINFO_DT( m_Item ), &REFERENCE_SEND_TABLE( DT_ScriptCreatedItem ) ),
	SendPropDataTable( SENDINFO_DT( m_AttributeManager ), &REFERENCE_SEND_TABLE( DT_AttributeContainer ) ),
#endif
END_NETWORK_TABLE()

#ifdef CLIENT_DLL
BEGIN_PREDICTION_DATA( C_EconEntity )
	DEFINE_PRED_TYPEDESCRIPTION( m_AttributeManager, CAttributeContainer ),
END_PREDICTION_DATA()
#endif

CEconEntity::CEconEntity()
{