Raised This Month: $51 Target: $400
 12% 

How to determine virtual functions since update


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Roger Devil
Senior Member
Join Date: Dec 2004
Location: Germany
Old 12-05-2005 , 00:49   How to determine virtual functions since update
Reply With Quote #1

Hi,
i determined, that since the new update CBaseEntity and derived classes must have changed. They crash, if you use the SDK-Code of the classes. I assume they changed the implementation of this classes with new virtual functions.
My question is :
How can i find out the the index of a virtual function, or has anyone a rewritten header for these classes ????
Roger Devil is offline
Send a message via ICQ to Roger Devil
CoolPeter
Member
Join Date: Nov 2005
Old 12-05-2005 , 01:21  
Reply With Quote #2

i think mani can help... he updated his plugin

Quote:
Re-written CBaseEntity and related code to no longer rely on the SDK Header files during linking.
CoolPeter is offline
BAILOPAN
Join Date: Jan 2004
Old 12-05-2005 , 03:19  
Reply With Quote #3

The quickest way is to insert dummy functions into the class to expand the vtable so it's aligned to the mod properly. You can do this with a disassembler that can show cross references and/or a debugger, by looking at the difference between the expected function call and the one that's accidentally called because of the mismatch.

If you're trying to hook things in CBaseEntity based on their virtual function index, doing this method and using SourceHook (Metamod:Source) is ideal.
__________________
egg
BAILOPAN is offline
Roger Devil
Senior Member
Join Date: Dec 2004
Location: Germany
Old 12-05-2005 , 04:50  
Reply With Quote #4

Yes got the same idea. I inserted up to 8 virtual functions to my class, but always get a calling error. Because i have no dissassembler at the moment,
i will try somem more.
Bad that Valve do such things without informing us.
Roger Devil is offline
Send a message via ICQ to Roger Devil
jeanlepail
Member
Join Date: Nov 2005
Location: Paris France
Old 12-05-2005 , 06:10  
Reply With Quote #5

when finished : make reply here with sourcecode
__________________
TK's Management : Finish
Bet Plugin : 90 %
jeanlepail is offline
Send a message via AIM to jeanlepail Send a message via MSN to jeanlepail
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 12-05-2005 , 06:29  
Reply With Quote #6

Bailopan suggested an idea on how to get the ordering of the virtual funcs by walking the CBE vtable and using dladdr on linux.

This is the output after running it through c++filt. Remember these are only the virtual functions. You will probably notice a few extra calls are in there and also that the GetModelName, GetModelIndex, SetModelIndex ordering is different from the SDK.

Code:
CCSPlayer::~CCSPlayer()
CCSPlayer::~CCSPlayer()
CBaseEntity::SetRefEHandle(CBaseHandle const&)
CBaseEntity::GetRefEHandle() const
CBaseEntity::GetCollideable()
CBaseEntity::GetNetworkable()
CBaseEntity::GetBaseEntity()
CBaseEntity::GetModelIndex() const
CBaseEntity::GetModelName() const
CBaseEntity::SetModelIndex(int)
CCSPlayer::GetServerClass()
CCSPlayer::GetClassName()
CCSPlayer::YouForgotToImplementOrDeclareServerClass()
CCSPlayer::GetDataDescMap()
CBaseAnimating::TestCollision(Ray_t const&, unsigned int, CGameTrace&)
CBaseAnimating::TestHitboxes(Ray_t const&, unsigned int, CGameTrace&)
CBaseEntity::ComputeWorldSpaceSurroundingBox(Vector*, Vector*)
CBaseEntity::ShouldCollide(int, int) const
CBaseEntity::SetOwnerEntity(CBaseEntity*)
CBasePlayer::ShouldTransmit(CCheckTransmitInfo const*)
CBasePlayer::UpdateTransmitState()
CBaseCombatCharacter::SetTransmit(CCheckTransmitInfo*, bool)
CBasePlayer::GetTracerType()
CCSPlayer::Spawn()
CCSPlayer::Precache()
CBaseFlex::SetModel(char const*)
CBaseEntity::PostConstructor(char const*)
CBaseEntity::ParseMapData(CEntityMapData*)
CBaseEntity::KeyValue(char const*, char const*)
CBaseEntity::KeyValue(char const*, float)
CBaseEntity::KeyValue(char const*, Vector)
CBaseEntity::ValidateEntityConnections()
CBasePlayer::Activate()
CBasePlayer::ObjectCaps()
CBaseEntity::AcceptInput(char const*, CBaseEntity*, CBaseEntity*, variant_t, int)
CBaseAnimating::GetInputDispatchEffectPosition(char const*, Vector&, QAngle&)
CBasePlayer::DrawDebugGeometryOverlays()
CBaseAnimating::DrawDebugTextOverlays()
CBasePlayer::Save(ISave&)
CBasePlayer::Restore(IRestore&)
CBasePlayer::ShouldSavePhysics()
CBaseEntity::OnSave(IEntitySaveUtils*)
CBasePlayer::OnRestore()
CBasePlayer::RequiredEdictIndex()
CBaseEntity::MoveDone()
CBaseEntity::Think()
CBaseEntity::NetworkStateChanged_m_nNextThinkTick()
CBaseAnimating::GetBaseAnimating()
CBaseEntity::GetResponseSystem()
CBaseEntity::DispatchResponse(char const*)
CBasePlayer::Classify()
CBaseEntity::DeathNotice(CBaseEntity*)
CBaseEntity::PassesDamageFilter(CTakeDamageInfo const&)
CCSPlayer::TraceAttack(CTakeDamageInfo const&, Vector const&, CGameTrace*)
CBaseEntity::CanBeHitByMeleeAttack(CBaseEntity*)
CCSPlayer::OnTakeDamage(CTakeDamageInfo const&)
CBasePlayer::TakeHealth(float, int)
CCSPlayer::Event_Killed(CTakeDamageInfo const&)
CBaseEntity::Event_KilledOther(CBaseEntity*)
CBaseCombatCharacter::BloodColor()
CBaseEntity::IsTriggered(CBaseEntity*)
CBaseEntity::IsNPC() const
CBaseCombatCharacter::MyCombatCharacterPointer()
CBaseEntity::GetDelay()
CBaseEntity::IsMoving()
CBaseEntity::DamageDecal(int, int)
CBaseEntity::DecalTrace(CGameTrace*, char const*)
CBaseEntity::ImpactTrace(CGameTrace*, int, char*)
CBaseEntity::OnControls(CBaseEntity*)
CBaseEntity::HasTarget(string_t)
CBasePlayer::IsPlayer() const
CBasePlayer::IsNetClient() const
CBaseEntity::IsTemplate()
CBaseEntity::IsBaseObject() const
CBaseEntity::GetServerVehicle()
CBaseEntity::IsViewable()
CCSPlayer::ChangeTeam(int)
CBaseEntity::OnEntityEvent(EntityEvent_t, void*)
CBaseEntity::CanStandOn(CBaseEntity*) const
CBaseEntity::CanStandOn(edict_t*) const
CBaseEntity::GetEnemy()
CBaseEntity::GetEnemy() const
CBaseEntity::Use(CBaseEntity*, CBaseEntity*, USE_TYPE, float)
CBaseEntity::StartTouch(CBaseEntity*)
CBasePlayer::Touch(CBaseEntity*)
CBaseEntity::EndTouch(CBaseEntity*)
CBaseEntity::StartBlocked(CBaseEntity*)
CBaseEntity::Blocked(CBaseEntity*)
CBaseEntity::EndBlocked()
CBasePlayer::PhysicsSimulate()
CBasePlayer::UpdateOnRemove()
CBaseEntity::StopLoopingSounds()
CBaseEntity::SUB_AllowedToFade()
CBaseAnimating::Teleport(Vector const*, QAngle const*, Vector const*)
CBaseEntity::NotifySystemEvent(CBaseEntity*, notify_system_event_t, notify_system_event_params_t const&)
CBasePlayer::MakeTracer(Vector const&, CGameTrace const&, int)
CBaseEntity::FireBullets(FireBulletsInfo_t const&)
CBasePlayer::DoImpactEffect(CGameTrace&, int)
CBaseEntity::Respawn()
CBaseEntity::IsLockedByMaster()
CBaseAnimating::ModifyOrAppendCriteria(AI_CriteriaSet&)
CBasePlayer::NetworkStateChanged_m_lifeState()
CBaseEntity::NetworkStateChanged_m_takedamage()
CBaseEntity::NetworkStateChanged_m_iMaxHealth()
CBaseEntity::NetworkStateChanged_m_iHealth()
CBaseEntity::GetDamageType() const
CBaseEntity::GetDamage()
CBaseEntity::SetDamage(float)
CBasePlayer::EyePosition()
CBasePlayer::EyeAngles()
CBasePlayer::LocalEyeAngles()
CBaseEntity::EarPosition()
CBasePlayer::BodyTarget(Vector const&, bool)
CBaseEntity::HeadTarget(Vector const&)
CBaseEntity::GetVectors(Vector*, Vector*, Vector*) const
CBaseEntity::GetViewOffset()
CBasePlayer::GetSmoothedVelocity()
CBaseAnimating::GetVelocity(Vector*, Vector*)
CBaseEntity::FVisible(CBaseEntity*, int, CBaseEntity**)
CBaseEntity::FVisible(Vector const&, int, CBaseEntity**)
CBaseEntity::CanBeSeen()
CBaseEntity::GetAttackDamageScale(CBaseEntity*)
CBaseEntity::GetReceivedDamageScale(CBaseEntity*)
CBaseEntity::CanBePoweredUp()
CBaseEntity::AttemptToPowerup(int, float, float, CBaseEntity*, CDamageModifier*)
CBaseEntity::GetGroundVelocityToApply(Vector&)
CBaseEntity::PhysicsSplash(Vector const&, Vector const&, float, float)
CBaseEntity::Splash()
CBaseEntity::WorldSpaceCenter() const
CBaseEntity::GetSoundEmissionOrigin() const
CBaseEntity::CreateVPhysics()
CBaseEntity::ForceVPhysicsCollide(CBaseEntity*)
CBasePlayer::VPhysicsDestroyObject()
CBasePlayer::VPhysicsUpdate(IPhysicsObject*)
CBaseEntity::VPhysicsTakeDamage(CTakeDamageInfo const&)
CBaseCombatCharacter::VPhysicsShadowCollision(int, gamevcollisionevent_t*)
CCSPlayer::VPhysicsShadowUpdate(IPhysicsObject*)
CBasePlayer::VPhysicsCollision(int, gamevcollisionevent_t*)
CBaseEntity::VPhysicsFriction(IPhysicsObject*, float, int, int)
CBaseEntity::UpdatePhysicsShadowToCurrentPosition(float)
CBaseEntity::VPhysicsGetObjectList(IPhysicsObject**, int)
CBaseEntity::HasPhysicsAttacker(float)
CBasePlayer::PhysicsSolidMaskForEntity() const
CBaseEntity::ResolveFlyCollisionCustom(CGameTrace&, Vector&)
CBaseEntity::PerformCustomPhysics(Vector*, Vector*, QAngle*, QAngle*)
CBaseAnimating::GetStepOrigin() const
CBaseAnimating::GetStepAngles() const
CBaseEntity::ShouldDrawWaterImpacts()
CBaseEntity::NetworkStateChanged_m_fFlags()
CBasePlayer::NetworkStateChanged_m_hGroundEntity()
CBasePlayer::NetworkStateChanged_m_vecBaseVelocity()
CBaseEntity::NetworkStateChanged_m_nWaterLevel()
CBasePlayer::NetworkStateChanged_m_flFriction()
CBaseEntity::NetworkStateChanged_m_vecVelocity()
CBasePlayer::NetworkStateChanged_m_vecViewOffset()
CBaseAnimating::GetIdealSpeed() const
CBaseAnimating::GetIdealAccel() const
CBaseAnimatingOverlay::StudioFrameAdvance()
CBaseAnimating::IsActivityFinished()
CBaseAnimating::ClampRagdollForce(Vector const&, Vector*)
CBaseAnimating::BecomeRagdollOnClient(Vector const&)
CBaseAnimating::IsRagdoll()
CBaseAnimating::CanBecomeRagdoll()
CBaseAnimatingOverlay::GetSkeleton(CStudioHdr*, Vector*, Quaternion*, int)
CBaseAnimating::GetBoneTransform(int, matrix3x4_t&)
CBaseAnimating::SetupBones(matrix3x4_t*, int)
CBaseAnimating::CalculateIKLocks(float)
CBaseAnimatingOverlay::DispatchAnimEvents(CBaseAnimating*)
CBaseAnimating::HandleAnimEvent(animevent_t*)
CBaseAnimating::GetAttachment(int, matrix3x4_t&)
CBaseAnimating::InitBoneControllers()
CBaseAnimating::GetGroundSpeedVelocity()
CBaseAnimating::DrawServerHitboxes(float, bool)
CBaseAnimating::Ignite(float, bool, float, bool)
CBaseAnimating::Extinguish()
CBaseCombatCharacter::SetLightingOriginRelative(CBaseEntity*)
CBaseAnimating::SetLightingOrigin(CBaseEntity*)
CBaseFlex::SetViewtarget(Vector const&)
CBaseFlex::StartSceneEvent(CSceneEventInfo*, CChoreoScene*, CChoreoEvent*, CChoreoActor*, CBaseEntity*)
CBaseFlex::ProcessSceneEvents()
CBaseFlex::ProcessSceneEvent(CSceneEventInfo*, CChoreoScene*, CChoreoEvent*)
CBaseFlex::ClearSceneEvent(CSceneEventInfo*, bool, bool)
CBaseFlex::CheckSceneEventCompletion(CSceneEventInfo*, float, CChoreoScene*, CChoreoEvent*)
CBaseCombatCharacter::GetPhysicsImpactDamageTable()
CBaseCombatCharacter::FInViewCone(CBaseEntity*)
CBaseCombatCharacter::FInViewCone(Vector const&)
CBaseCombatCharacter::FInAimCone(CBaseEntity*)
CBaseCombatCharacter::FInAimCone(Vector const&)
CBaseCombatCharacter::ShouldShootMissTarget(CBaseCombatCharacter*)
CBaseCombatCharacter::FindMissTarget()
CBaseCombatCharacter::HandleInteraction(int, void*, CBaseCombatCharacter*)
CBasePlayer::BodyAngles()
CBaseCombatCharacter::BodyDirection2D()
CBaseCombatCharacter::BodyDirection3D()
CBaseCombatCharacter::HeadDirection2D()
CBaseCombatCharacter::HeadDirection3D()
CBaseCombatCharacter::EyeDirection2D()
CBaseCombatCharacter::EyeDirection3D()
CBaseCombatCharacter::GiveAmmo(int, int, bool)
CBaseCombatCharacter::NPC_TranslateActivity(Activity)
CBaseCombatCharacter::Weapon_TranslateActivity(Activity, bool*)
CCSPlayer::Weapon_CanUse(CBaseCombatWeapon*)
CCSPlayer::Weapon_Equip(CBaseCombatWeapon*)
CBaseCombatCharacter::Weapon_EquipAmmoOnly(CBaseCombatWeapon*)
CBasePlayer::Weapon_Drop(CBaseCombatWeapon*, Vector const*, Vector const*)
CCSPlayer::Weapon_Switch(CBaseCombatWeapon*, int)
CBasePlayer::Weapon_ShootPosition()
CCSPlayer::Weapon_CanSwitchTo(CBaseCombatWeapon*)
CBaseCombatCharacter::Weapon_SlotOccupied(CBaseCombatWeapon*)
CBaseCombatCharacter::Weapon_GetSlot(int) const
CBaseCombatCharacter::AddPlayerItem(CBaseCombatWeapon*)
CBasePlayer::RemovePlayerItem(CBaseCombatWeapon*)
CBaseCombatCharacter::CanBecomeServerRagdoll()
CCSPlayer::OnTakeDamage_Alive(CTakeDamageInfo const&)
CBaseCombatCharacter::OnTakeDamage_Dying(CTakeDamageInfo const&)
CBaseCombatCharacter::OnTakeDamage_Dead(CTakeDamageInfo const&)
CBaseCombatCharacter::OnFriendDamaged(CBaseCombatCharacter*, CBaseEntity*)
CBaseCombatCharacter::NotifyFriendsOfDamage(CBaseEntity*)
CBaseCombatCharacter::GetDeathActivity()
CBaseCombatCharacter::CorpseGib(CTakeDamageInfo const&)
CBaseCombatCharacter::CorpseFade()
CBaseCombatCharacter::HasHumanGibs()
CBaseCombatCharacter::HasAlienGibs()
CBaseCombatCharacter::ShouldGib(CTakeDamageInfo const&)
CBaseCombatCharacter::OnKilledNPC(CBaseCombatCharacter*)
CBaseCombatCharacter::Event_Gibbed(CTakeDamageInfo const&)
CBasePlayer::Event_Dying()
CBaseCombatCharacter::BecomeRagdoll(CTakeDamageInfo const&, Vector const&)
CBaseCombatCharacter::FixupBurningServerRagdoll(CBaseEntity*)
CBaseCombatCharacter::CheckTraceHullAttack(float, Vector const&, Vector const&, int, int, float, bool)
CBaseCombatCharacter::CheckTraceHullAttack(Vector const&, Vector const&, Vector const&, Vector const&, int, int, float, bool)
CBaseCombatCharacter::PushawayTouch(CBaseEntity*)
CBaseCombatCharacter::IRelationType(CBaseEntity*)
CBaseCombatCharacter::IRelationPriority(CBaseEntity*)
CBaseCombatCharacter::CalcWeaponProficiency(CBaseCombatWeapon*)
CBaseCombatCharacter::GetAttackSpread(CBaseCombatWeapon*, CBaseEntity*)
CBaseCombatCharacter::GetSpreadBias(CBaseCombatWeapon*, CBaseEntity*)
CBasePlayer::DoMuzzleFlash()
CBaseCombatCharacter::AddEntityRelationship(CBaseEntity*, Disposition_t, int)
CBaseCombatCharacter::AddClassRelationship(Class_T, Disposition_t, int)
CBaseCombatCharacter::OnChangeActiveWeapon(CBaseCombatWeapon*, CBaseCombatWeapon*)
CBasePlayer::NetworkStateChanged_m_iAmmo()
CCSPlayer::CreateViewModel(int)
CCSPlayer::SetupVisibility(CBaseEntity*, unsigned char*, int)
CCSPlayer::WantsLagCompensationOnEntity(CBasePlayer const*, CUserCmd const*, CBitVec<2048> const*) const
CBasePlayer::SharedSpawn()
CCSPlayer::InitialSpawn()
CBasePlayer::InitHUD()
CCSPlayer::ShowViewPortPanel(char const*, bool, KeyValues*)
CCSPlayer::PlayerDeathThink()
CBasePlayer::Jump()
CBasePlayer::Duck()
CCSPlayer::PreThink()
CCSPlayer::PostThink()
CBasePlayer::DamageEffect(float, int)
CCSPlayer::OnDamagedByExplosion(CTakeDamageInfo const&)
CBasePlayer::ShouldFadeOnDeath()
CBasePlayer::IsFakeClient() const
CBasePlayer::GetPlayerMins() const
CBasePlayer::GetPlayerMaxs() const
CBasePlayer::CalcRoll(QAngle const&, Vector const&, float, float)
CBasePlayer::PackDeadPlayerItems()
CCSPlayer::RemoveAllItems(bool)
CBasePlayer::IsRunning() const
CBasePlayer::Weapon_SetLast(CBaseCombatWeapon*)
CBasePlayer::Weapon_ShouldSetLast(CBaseCombatWeapon*, CBaseCombatWeapon*)
CBasePlayer::Weapon_ShouldSelectItem(CBaseCombatWeapon*)
CBasePlayer::UpdateClientData()
CBasePlayer::ExitLadder()
CCSPlayer::FlashlightIsOn()
CCSPlayer::FlashlightTurnOn()
CCSPlayer::FlashlightTurnOff()
CBasePlayer::IsIlluminatedByFlashlight(CBaseEntity*, float*)
CCSPlayer::UpdateStepSound(surfacedata_t*, Vector const&, Vector const&)
CCSPlayer::PlayStepSound(Vector&, surfacedata_t*, float, bool)
CCSPlayer::DeathSound()
CCSPlayer::SetAnimation(PLAYER_ANIM)
CBasePlayer::ImpulseCommands()
CCSPlayer::CheatImpulseCommands(int)
CCSPlayer::ClientCommand(char const*)
CBasePlayer::StartObserverMode(int)
CBasePlayer::StopObserverMode()
CBasePlayer::SetObserverMode(int)
CBasePlayer::GetObserverMode()
CBasePlayer::SetObserverTarget(CBaseEntity*)
CBasePlayer::ObserverUse(bool)
CBasePlayer::GetObserverTarget()
CBasePlayer::FindNextObserverTarget(bool)
CBasePlayer::IsValidObserverTarget(CBaseEntity*)
CBasePlayer::CheckObserverSettings()
CBasePlayer::JumptoPosition(Vector const&, QAngle const&)
CBasePlayer::ForceObserverMode(int)
CBasePlayer::ResetObserverMode()
CCSPlayer::StartReplayMode(float, float, int)
CCSPlayer::StopReplayMode()
CBasePlayer::GetDelayTicks()
CBasePlayer::GetReplayEntity()
CBasePlayer::CreateCorpse()
CCSPlayer::EntSelectSpawnPoint()
CBasePlayer::GetInVehicle(IServerVehicle*, int)
CBasePlayer::LeaveVehicle(Vector const&, QAngle const&)
CBasePlayer::OnVehicleStart()
CBasePlayer::OnVehicleEnd(Vector&)
CCSPlayer::BumpWeapon(CBaseCombatWeapon*)
CBasePlayer::SelectLastItem()
CBasePlayer::SelectItem(char const*, int)
CBasePlayer::ItemPostFrame()
CCSPlayer::GiveNamedItem(char const*, int)
CBasePlayer::CheckTrainUpdate()
CBasePlayer::SetPlayerUnderwater(bool)
CBasePlayer::CanBreatheUnderwater() const
CBasePlayer::PlayerUse()
CBasePlayer::PlayUseDenySound()
CCSPlayer::FindUseEntity()
CCSPlayer::IsUseableEntity(CBaseEntity*, unsigned int)
CBasePlayer::PickupObject(CBaseEntity*, bool)
CBasePlayer::ForceDropOfCarriedPhysObjects(CBaseEntity*)
CBasePlayer::GetHeldObjectMass(IPhysicsObject*)
CBasePlayer::UpdateGeigerCounter()
CBasePlayer::GetAutoaimVector(float)
CBasePlayer::GetAutoaimVector(float, autoaim_params_t&)
CBasePlayer::ShouldAutoaim()
CBasePlayer::ForceClientDllUpdate()
CBasePlayer::ProcessUsercmds(CUserCmd*, int, int, int, bool)
CCSPlayer::PlayerRunCommand(CUserCmd*, IMoveHelper*)
CBasePlayer::CanSpeak()
CCSPlayer::CanHearChatFrom(CBasePlayer*)
CCSPlayer::ModifyOrAppendPlayerCriteria(AI_CriteriaSet&)
CBasePlayer::CheckChatText(char*, int)
CBasePlayer::IsFollowingPhysics()
CCSPlayer::InitVCollision()
CBasePlayer::UpdatePhysicsShadowToCurrentPosition()
CBasePlayer::EquipSuit()
CBasePlayer::CommitSuicide()
CBasePlayer::IsBot() const
CCSPlayer::SpawnArmorValue() const
CCSPlayer::NetworkStateChanged_m_ArmorValue()
CCSPlayer::IsBeingGivenItem() const
CCSPlayer::CSAnim_GetActiveWeapon()
CCSPlayer::CSAnim_CanMove()
CCSPlayer::Blind(float, float, float)
CCSPlayer::Cmd_Argc()
CCSPlayer::Cmd_Argv(int)
Mani
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 12-05-2005 , 06:35  
Reply With Quote #7

Quote:
Originally Posted by Roger Devil
Yes got the same idea. I inserted up to 8 virtual functions to my class, but always get a calling error. Because i have no dissassembler at the moment,
i will try somem more.
Bad that Valve do such things without informing us.
This was bound to happen at some point (it's already happened with DoD:Source). We can't blame Valve for changing their own non-released source code for CSS and expecting the SDK for what is essentially HL2MP to still work

What I can say is that Valve should really have supplied a much better interface (or at least an interface) to reliably access all the stuff in CBaseEntity etc. If this had been the case, we would not be in the mess we are in at the moment.

Mani
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
Roger Devil
Senior Member
Join Date: Dec 2004
Location: Germany
Old 12-05-2005 , 08:42  
Reply With Quote #8

Youre right in both. I know we use an unsupported interface, but only, because the SDK is so poor.
I already wrote Plugins for the HL1-Engine. There you have much more flexibilty by the SDK.

And thanks for the reply, this would definite help me out.
Roger Devil is offline
Send a message via ICQ to Roger Devil
Roger Devil
Senior Member
Join Date: Dec 2004
Location: Germany
Old 12-07-2005 , 03:01  
Reply With Quote #9

Just another question,
Mani ca you tell me how you did the dladdr() stuff under linux, as im not a linux-professional.
I need this, because CBaseCombatWeapon also has changed.

Thx
Roger Devil
Roger Devil is offline
Send a message via ICQ to Roger Devil
[email protected]
Member
Join Date: Dec 2005
Old 12-07-2005 , 12:25  
Reply With Quote #10

Well, I *think* I have CBaseEntity and its derived classes working. At least, I'm pretty sure I have all the virtual functions working. I used the list that Mani posted, and rewrote the files needed all the way up through CBasePlayer. The reason I'm pretty sure it's working good: in CBasePlayer one of the functions was changed to a virtual function: "CommitSuicide( )". I've been using that in my plugin with no problems. I've also tested a few random virtual functions from the other classes, and they work fine. I can't say as much for member variables and non-virtual functions. I've only tested a couple of those, but so far, they seem to be working. Heres what I had to do:

In baseentity.h:
- Added:
Code:
virtual bool CanBeHitByMeleeAttack( CBaseEntity * ) { return true; }
directly before
Code:
virtual int OnTakeDamage( const CTakeDamageInfo &info );
- Added:
Code:
virtual void Event_KilledOther( CBaseEntity *pEntity ) { }
directly after
Code:
virtual void Event_Killed( const CTakeDamageInfo &info );
- Added:
Code:
virtual bool SUB_AllowedToFade( ) { return false; }
directly after
Code:
virtual void StopLoopingSounds( void ) {}
In baseanimating.h:
- Added:
Code:
virtual void SetLightingOriginRelative( CBaseEntity *pLightingOrigin ) { SetLightingOrigin( pLightingOrigin ); }
directly before
Code:
virtual void SetLightingOrigin( CBaseEntity *pLightingOrigin );
In baseanimatingoverlay.h: No changes necessary, just added "virtual" to some of the functions that were inherited virtual, but didn't have it denoted as such.

In baseflex.h: No changes necessary, same as for baseanimatingoverlay.h

In basecombatcharacter.h
- Added
Code:
virtual void SetLightingOriginRelative( CBaseEntity *pLightingOrigin ) { SetLightingOrigin( pLightingOrigin ); }
directly before
Code:
virtual QAngle BodyAngles();
- Added
Code:
virtual bool CanBecomeServerRagdoll( ) { return true; }
directly after
Code:
virtual bool RemovePlayerItem( CBaseCombatWeapon *pItem ) { return false; }
- Added
Code:
virtual void FixupBurningServerRagdoll( CBaseEntity *pBase ) { }
directly after
Code:
virtual bool BecomeRagdoll( const CTakeDamageInfo &info, const Vector &forceVector );
- Added
Code:
virtual void PushawayTouch( CBaseEntity *pOther ) { }
directly before
Code:
virtual CBaseCombatCharacter MyCombatCharacterPointer( void ) { return this; }
- Removed
Code:
virtual bool CanPowerupNow( int iPowerup );
virtual bool CanPowerupEver( int iPowerup );
virtual float PowerupDuration( int iPowerup, float flTime );
virtual void PowerupStart( int iPowerup, float flAmount = 0, CBaseEntity *pAttacker = NULL, CDamageModifier *pDamageModifier = NULL );
virtual void PowerupEnd( int iPowerup );
In player.h:
- Added a forward declaration:
Code:
class autoaim_params_t;
- Added
Code:
virtual bool IsIlluminatedByFlashlight( ) { return false; }
directly after
Code:
virtual void FlashlightTurnOff( void ) { };
- Added
Code:
virtual void StartReplayMode( float fIDontKnow, float fIStillDontKnow, int iIDontKnowEither ) { }
virtual void StopReplayMode( ) { }
virtual int GetDelayTicks( ) { return 0; }
virtual CBaseEntity * GetReplayEntity( ) { return NULL; }
directly after
Code:
virtual void ResetObserverMode();
- Added
Code:
virtual Vector GetAutoaimVector( float fWhoKnows, autoaim_params_t &AgainWhoKnows ) { return ( GetAutoaimVector( fWhoKnows ); }
directly after
Code:
virtual Vector GetAutoaimVector( float flDelta  );
- Changed
Code:
void CommitSuicide();
to
Code:
virtual void CommitSuicide();
- Added
Code:
virtual int SpawnArmorValue( ) const { return 0; }
directly before
Code:
CNetworkVarForDerived( int, m_ArmorValue );
Now it should be noted that mose of the functions I added are just to add a space to the vtabes. I have no idea if the have the right return values, though it's pretty easy to guess on mose and they most certainly do not function correctly. Also, the functions that I removed might only have been changed from virtual to non-virtual, I really don't know.
Attached Files
File Type: zip cbaseplayer.zip (50.4 KB, 128 views)
Lojo.jacob@gmail.com is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode