summaryrefslogtreecommitdiff
path: root/cheat/tf2/IGameMovement.h
diff options
context:
space:
mode:
authorboris <wzn@moneybot.cc>2018-11-28 16:00:02 +1300
committerboris <wzn@moneybot.cc>2018-11-28 16:00:02 +1300
commit3d412a4b30a9f7c7f51ea6562e694315948bd3da (patch)
tree26d67dfd1f3e5fd12903ad13e85d0cb8bcf8f21c /cheat/tf2/IGameMovement.h
parente4729e4393d90271a3814c7a79950a660c48325a (diff)
cleaned up
in short, the cheat and loader are now separate solutions. unused stuff was moved into the legacy solution in case anyone wants to compile it or whatever. i can change this back if you want to. also, i configured the loader to compile in x64, and have separate build types for linux and win64
Diffstat (limited to 'cheat/tf2/IGameMovement.h')
-rw-r--r--cheat/tf2/IGameMovement.h118
1 files changed, 118 insertions, 0 deletions
diff --git a/cheat/tf2/IGameMovement.h b/cheat/tf2/IGameMovement.h
new file mode 100644
index 0000000..26b5244
--- /dev/null
+++ b/cheat/tf2/IGameMovement.h
@@ -0,0 +1,118 @@
+#pragma once
+#pragma once
+
+#include "vector.hpp"
+
+using CBaseEntity = uintptr_t;
+class CUserCmd;
+
+typedef int EntityHandle_t, soundlevel_t;
+class CGameTrace;
+
+typedef CGameTrace trace_t;
+
+#define MAX_CLIMB_SPEED 200.0
+
+class CMoveData
+{
+public:
+ bool m_bFirstRunOfFunctions : 1;
+ bool m_bGameCodeMovedPlayer : 1;
+
+ EntityHandle_t m_nPlayerHandle;
+
+ int m_nImpulseCommand;
+ vec3_t m_vecViewAngles;
+ vec3_t m_vecAbsViewAngles;
+ int m_nButtons;
+ int m_nOldButtons;
+ float m_flForwardMove;
+ float m_flSideMove;
+ float m_flUpMove;
+
+ float m_flMaxSpeed;
+ float m_flClientMaxSpeed;
+
+ vec3_t m_vecVelocity;
+ vec3_t m_vecAngles;
+ vec3_t m_vecOldAngles;
+ float m_outStepHeight;
+ vec3_t m_outWishVel;
+ vec3_t m_outJumpVel;
+
+ vec3_t m_vecConstraintCenter;
+ float m_flConstraintRadius;
+ float m_flConstraintWidth;
+ float m_flConstraintSpeedFactor;
+
+ vec3_t m_vecAbsOrigin;
+};
+
+class IGameMovement
+{
+public:
+ virtual ~IGameMovement( void ) {}
+ virtual void ProcessMovement( CBaseEntity *pPlayer, CMoveData *pMove ) = 0;
+ virtual void StartTrackPredictionErrors( CBaseEntity *pPlayer ) = 0;
+ virtual void FinishTrackPredictionErrors( CBaseEntity *pPlayer ) = 0;
+ virtual void DiffPrint( char const *fmt, ... ) = 0;
+ virtual vec3_t GetPlayerMins( bool ducked ) const = 0;
+ virtual vec3_t GetPlayerMaxs( bool ducked ) const = 0;
+ virtual vec3_t GetPlayerViewOffset( bool ducked ) const = 0;
+};
+
+class IMoveHelper
+{
+public:
+ virtual char const* GetName( EntityHandle_t handle ) const = 0;
+ virtual void ResetTouchList( void ) = 0;
+ virtual bool AddToTouched( const CGameTrace& tr, const vec3_t& impactvelocity ) = 0;
+ virtual void ProcessImpacts( void ) = 0;
+ virtual void Con_NPrintf( int idx, char const* fmt, ... ) = 0;
+ virtual void StartSound( const vec3_t& origin, int channel, char const* sample, float volume, soundlevel_t soundlevel, int fFlags, int pitch ) = 0;
+ virtual void StartSound( const vec3_t& origin, const char *soundname ) = 0;
+ virtual void PlaybackEventFull( int flags, int clientindex, unsigned short eventindex, float delay, vec3_t& origin, vec3_t& angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ) = 0;
+ virtual bool PlayerFallingDamage( void ) = 0;
+ virtual void PlayerSetAnimation( int playerAnim ) = 0;
+
+ virtual void *GetSurfaceProps( void ) = 0;
+
+ virtual bool IsWorldEntity( const uintptr_t &handle ) = 0;
+
+protected:
+ virtual ~IMoveHelper( ) {}
+};
+
+class IPrediction
+{
+public:
+ virtual ~IPrediction( void ) {};
+
+ virtual void Init( void ) = 0;
+ virtual void Shutdown( void ) = 0;
+
+ // Run prediction
+ virtual void Update
+ (
+ int startframe, // World update ( un-modded ) most recently received
+ bool validframe, // Is frame data valid
+ int incoming_acknowledged, // Last command acknowledged to have been run by server (un-modded)
+ int outgoing_command // Last command (most recent) sent to server (un-modded)
+ ) = 0;
+
+ // We are about to get a network update from the server. We know the update #, so we can pull any
+ // data purely predicted on the client side and transfer it to the new from data state.
+ virtual void PreEntityPacketReceived( int commands_acknowledged, int current_world_update_packet ) = 0;
+ virtual void PostEntityPacketReceived( void ) = 0;
+ virtual void PostNetworkDataReceived( int commands_acknowledged ) = 0;
+
+ virtual void OnReceivedUncompressedPacket( void ) = 0;
+
+ // The engine needs to be able to access a few predicted values
+ virtual void GetViewOrigin( vec3_t& org ) = 0;
+ virtual void SetViewOrigin( vec3_t& org ) = 0;
+ virtual void GetViewAngles( vec3_t& ang ) = 0;
+ virtual void SetViewAngles( vec3_t& ang ) = 0;
+ virtual void GetLocalViewAngles( vec3_t& ang ) = 0;
+ virtual void SetLocalViewAngles( vec3_t& ang ) = 0;
+}; \ No newline at end of file