Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "MiscDefinitions.h"
- #include "ClientRecvProps.h"
- #include "offsets.h"
- #include "Vector.h"
- #include "bspflags.h"
- #include "winwindef.h"
- // Entity List
- class IClientModeShared
- {
- public:
- };
- class IClientEntityList
- {
- public:
- virtual void Function0();
- virtual void Function1();
- virtual void Function2();
- virtual IClientEntity * GetClientEntity(int entnum);
- virtual IClientEntity * GetClientEntityFromHandle(HANDLE hEnt) = 0;
- virtual int NumberOfEntities(bool bIncludeNonNetworkable) = 0;
- virtual int GetHighestEntityIndex(void);
- virtual void SetMaxEntities(int maxents);
- virtual int GetMaxEntities();
- };
- struct CViewSetup
- {
- char _0x0000[16];
- __int32 x;
- __int32 x_old;
- __int32 y;
- __int32 y_old;
- __int32 width;
- __int32 width_old;
- __int32 height;
- __int32 height_old;
- char _0x0030[128];
- float fov;
- float fovViewmodel;
- Vector origin;
- Vector angles;
- float zNear;
- float zFar;
- float zNearViewmodel;
- float zFarViewmodel;
- float m_flAspectRatio;
- float m_flNearBlurDepth;
- float m_flNearFocusDepth;
- float m_flFarFocusDepth;
- float m_flFarBlurDepth;
- float m_flNearBlurRadius;
- float m_flFarBlurRadius;
- float m_nDoFQuality;
- __int32 m_nMotionBlurMode;
- char _0x0104[68];
- __int32 m_EdgeBlur;
- };
- // Panels
- class IPanel
- {
- public:
- const char *GetName(unsigned int vguiPanel)
- {
- typedef const char* (__thiscall* OriginalFn)(PVOID, unsigned int);
- return call_vfunc<OriginalFn>(this, Offsets::VMT::Panel_GetName)(this, vguiPanel);
- }
- };
- class IGameEvent {
- public:
- virtual ~IGameEvent() {};
- virtual const char *GetName() const = 0; // get event name
- virtual bool IsReliable() const = 0; // if event handled reliable
- virtual bool IsLocal() const = 0; // if event is never networked
- virtual bool IsEmpty(const char *keyName = NULL) = 0; // check if data field exists
- // Data access
- virtual bool GetBool(const char *keyName = NULL, bool defaultValue = false) = 0;
- virtual int GetInt(const char *keyName = NULL, int defaultValue = 0) = 0;
- virtual unsigned __int64 GetUint64(const char *keyName = NULL, unsigned __int64 defaultValue = 0) = 0;
- virtual float GetFloat(const char *keyName = NULL, float defaultValue = 0.0f) = 0;
- virtual const char *GetString(const char *keyName = NULL, const char *defaultValue = "") = 0;
- virtual const wchar_t * GetWString(char const *keyName = NULL, const wchar_t *defaultValue = L"") = 0;
- virtual void SetBool(const char *keyName, bool value) = 0;
- virtual void SetInt(const char *keyName, int value) = 0;
- virtual void SetUint64(const char *keyName, unsigned __int64 value) = 0;
- virtual void SetFloat(const char *keyName, float value) = 0;
- virtual void SetString(const char *keyName, const char *value) = 0;
- virtual void SetWString(const char *keyName, const wchar_t *value) = 0;
- };
- class IGameEventListener2 {
- public:
- virtual ~IGameEventListener2(void) {};
- virtual void FireGameEvent(IGameEvent *event) = 0;
- virtual int GetEventDebugID(void) = 0;
- };
- class bf_read;
- class bf_write;
- class IGameEventManager2 {
- public:
- virtual ~IGameEventManager2(void) {};
- virtual int LoadEventsFromFile(const char *filename) = 0;
- virtual void Reset() = 0;
- virtual bool AddListener(IGameEventListener2 *listener, const char *name, bool bServerSide) = 0;
- virtual bool FindListener(IGameEventListener2 *listener, const char *name) = 0;
- virtual void RemoveListener(IGameEventListener2 *listener) = 0;
- virtual IGameEvent *CreateEvent(const char *name, bool bForce = false, int *pCookie = NULL) = 0;
- virtual bool FireEvent(IGameEvent *event, bool bDontBroadcast = false) = 0;
- virtual bool FireEventClientSide(IGameEvent *event) = 0;
- virtual IGameEvent *DuplicateEvent(IGameEvent *event) = 0;
- virtual void FreeEvent(IGameEvent *event) = 0;
- virtual bool SerializeEvent(IGameEvent *event, bf_write *buf) = 0;
- virtual IGameEvent *UnserializeEvent(bf_read *buf) = 0;
- };
- class Color
- {
- public:
- Color()
- {
- *((int *)this) = 0;
- }
- Color(int r, int g, int b)
- {
- SetColor(r, g, b, 0);
- }
- Color(int r, int g, int b, int a)
- {
- SetColor(r, g, b, a);
- }
- void SetColor(int r, int g, int b, int a = 0)
- {
- _color[0] = (unsigned char)r;
- _color[1] = (unsigned char)g;
- _color[2] = (unsigned char)b;
- _color[3] = (unsigned char)a;
- }
- void GetColor(int &r, int &g, int &b, int &a) const
- {
- r = _color[0];
- g = _color[1];
- b = _color[2];
- a = _color[3];
- }
- void SetRawColor(int color32)
- {
- *((int *)this) = color32;
- }
- int GetRawColor() const
- {
- return *((int *)this);
- }
- inline int r() const { return _color[0]; }
- inline int g() const { return _color[1]; }
- inline int b() const { return _color[2]; }
- inline int a() const { return _color[3]; }
- inline float rBase() const { return _color[0] / 255.0f; }
- inline float gBase() const { return _color[1] / 255.0f; }
- inline float bBase() const { return _color[2] / 255.0f; }
- inline float aBase() const { return _color[3] / 255.0f; }
- void SetAlpha(int a) { _color[0] = (unsigned char)a; }
- int GetAlpha() { return _color[0]; }
- unsigned char &operator[](int index)
- {
- return _color[index];
- }
- const unsigned char &operator[](int index) const
- {
- return _color[index];
- }
- bool operator == (const Color &rhs) const
- {
- return (*((int *)this) == *((int *)&rhs));
- }
- bool operator != (const Color &rhs) const
- {
- return !(operator==(rhs));
- }
- Color &operator=(const Color &rhs)
- {
- SetRawColor(rhs.GetRawColor());
- return *this;
- }
- private:
- unsigned char _color[4];
- };
- class IVDebugOverlay
- {
- public:
- virtual void AddEntityTextOverlay(int ent_index, int line_offset, float duration, int r, int g, int b, int a, const char *format, ...) = 0;
- virtual void AddBoxOverlay(const Vector& origin, const Vector& mins, const Vector& max, Vector const& orientation, int r, int g, int b, int a, float duration) = 0;
- virtual void AddSphereOverlay(const Vector& vOrigin, float flRadius, int nTheta, int nPhi, int r, int g, int b, int a, float flDuration) = 0;
- virtual void AddTriangleOverlay(const Vector& p1, const Vector& p2, const Vector& p3, int r, int g, int b, int a, bool noDepthTest, float duration) = 0;
- virtual void AddLineOverlay(const Vector& origin, const Vector& dest, int r, int g, int b, bool noDepthTest, float duration) = 0;
- virtual void AddTextOverlay(const Vector& origin, float duration, const char *format, ...) = 0;
- virtual void AddTextOverlay(const Vector& origin, int line_offset, float duration, const char *format, ...) = 0;
- virtual void AddScreenTextOverlay(float flXPos, float flYPos, float flDuration, int r, int g, int b, int a, const char *text) = 0;
- virtual void AddSweptBoxOverlay(const Vector& start, const Vector& end, const Vector& mins, const Vector& max, const Vector & angles, int r, int g, int b, int a, float flDuration) = 0;
- virtual void AddGridOverlay(const Vector& origin) = 0;
- virtual void AddCoordFrameOverlay(const matrix3x4& frame, float flScale, int vColorTable[3][3] = NULL) = 0;
- virtual int ScreenPosition(const Vector& point, Vector& screen) = 0;
- virtual int ScreenPosition(float flXPos, float flYPos, Vector& screen) = 0;
- virtual void *GetFirst(void) = 0;
- virtual void *GetNext(void *current) = 0;
- virtual void ClearDeadOverlays(void) = 0;
- virtual void ClearAllOverlays() = 0;
- virtual void AddTextOverlayRGB(const Vector& origin, int line_offset, float duration, float r, float g, float b, float alpha, const char *format, ...) = 0;
- virtual void AddTextOverlayRGB(const Vector& origin, int line_offset, float duration, int r, int g, int b, int a, const char *format, ...) = 0;
- virtual void AddLineOverlayAlpha(const Vector& origin, const Vector& dest, int r, int g, int b, int a, bool noDepthTest, float duration) = 0;
- virtual void AddBoxOverlay2(const Vector& origin, const Vector& mins, const Vector& max, Vector const& orientation, const Color& faceColor, const Color& edgeColor, float duration) = 0;
- virtual void PurgeTextOverlays() = 0;
- };
- // User Cmd's
- class CUserCmd
- {
- public:
- virtual ~CUserCmd() {}; //Destructor 0
- CUserCmd()
- {
- Reset();
- }
- void Reset()
- {
- command_number = 0;
- tick_count = 0;
- viewangles.Init();
- forwardmove = 0.0f;
- sidemove = 0.0f;
- upmove = 0.0f;
- buttons = 0;
- impulse = 0;
- weaponselect = 0;
- weaponsubtype = 0;
- random_seed = 0;
- mousedx = 0;
- mousedy = 0;
- headangles.Init();
- headoffset.Init();
- hasbeenpredicted = false;
- }
- CUserCmd& operator =(const CUserCmd& src)
- {
- if (this == &src)
- return *this;
- command_number = src.command_number;
- tick_count = src.tick_count;
- viewangles = src.viewangles;
- forwardmove = src.forwardmove;
- sidemove = src.sidemove;
- upmove = src.upmove;
- buttons = src.buttons;
- impulse = src.impulse;
- weaponselect = src.weaponselect;
- weaponsubtype = src.weaponsubtype;
- random_seed = src.random_seed;
- mousedx = src.mousedx;
- mousedy = src.mousedy;
- hasbeenpredicted = src.hasbeenpredicted;
- headangles = src.headangles;
- headoffset = src.headoffset;
- return *this;
- }
- CUserCmd(const CUserCmd& src)
- {
- *this = src;
- }
- int command_number;
- int tick_count;
- Vector viewangles;
- Vector aimdirection;
- float forwardmove;
- float sidemove;
- float upmove;
- int buttons;
- BYTE impulse;
- int weaponselect;
- int weaponsubtype;
- int random_seed;
- short mousedx;
- short mousedy;
- bool hasbeenpredicted;
- Vector headangles;
- Vector headoffset;
- };
- class CVerifiedUserCmd
- {
- public:
- CUserCmd m_cmd;
- unsigned long m_crc;
- };
- //========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
- //
- // Purpose: Generic CRC functions
- //
- // $NoKeywords: $
- //=============================================================================//
- #ifndef CHECKSUM_CRC_H
- #define CHECKSUM_CRC_H
- #ifdef _WIN32
- #pragma once
- #endif
- typedef unsigned long CRC32_t;
- void CRC32_Init(CRC32_t *pulCRC);
- void CRC32_ProcessBuffer(CRC32_t *pulCRC, const void *p, int len);
- void CRC32_Final(CRC32_t *pulCRC);
- CRC32_t CRC32_GetTableEntry(unsigned int slot);
- inline CRC32_t CRC32_ProcessSingleBuffer(const void *p, int len)
- {
- CRC32_t crc;
- CRC32_Init(&crc);
- CRC32_ProcessBuffer(&crc, p, len);
- CRC32_Final(&crc);
- return crc;
- }
- #endif // CHECKSUM_CRC_H
- class CInput
- {
- public:
- void* pvftable; //0x00
- bool m_fTrackIRAvailable; //0x04
- bool m_fMouseInitialized; //0x05
- bool m_fMouseActive; //0x06
- bool m_fJoystickAdvancedInit; //0x07
- char pad_0x08[0x2C]; //0x08
- void* m_pKeys; //0x34
- char pad_0x38[0x64]; //0x38
- int pad_0x41;
- int pad_0x42;
- bool m_fCameraInterceptingMouse; //0x9C
- bool m_fCameraInThirdPerson; //0x9D
- bool m_fCameraMovingWithMouse; //0x9E
- Vector m_vecCameraOffset; //0xA0
- bool m_fCameraDistanceMove; //0xAC
- int m_nCameraOldX; //0xB0
- int m_nCameraOldY; //0xB4
- int m_nCameraX; //0xB8
- int m_nCameraY; //0xBC
- bool m_CameraIsOrthographic; //0xC0
- Vector m_angPreviousViewAngles; //0xC4
- Vector m_angPreviousViewAnglesTilt; //0xD0
- float m_flLastForwardMove; //0xDC
- int m_nClearInputState; //0xE0
- char pad_0xE4[0x8]; //0xE4
- CUserCmd* m_pCommands; //0xEC
- //CVerifiedUserCmd* m_pVerifiedCommands; //0xF0
- class CUserCmd
- {
- public:
- CRC32_t GetChecksum(void) const
- {
- CRC32_t crc;
- CRC32_Init(&crc);
- CRC32_ProcessBuffer(&crc, &command_number, sizeof(command_number));
- CRC32_ProcessBuffer(&crc, &tick_count, sizeof(tick_count));
- CRC32_ProcessBuffer(&crc, &viewangles, sizeof(viewangles));
- CRC32_ProcessBuffer(&crc, &aimdirection, sizeof(aimdirection));
- CRC32_ProcessBuffer(&crc, &forwardmove, sizeof(forwardmove));
- CRC32_ProcessBuffer(&crc, &sidemove, sizeof(sidemove));
- CRC32_ProcessBuffer(&crc, &upmove, sizeof(upmove));
- CRC32_ProcessBuffer(&crc, &buttons, sizeof(buttons));
- CRC32_ProcessBuffer(&crc, &impulse, sizeof(impulse));
- CRC32_ProcessBuffer(&crc, &weaponselect, sizeof(weaponselect));
- CRC32_ProcessBuffer(&crc, &weaponsubtype, sizeof(weaponsubtype));
- CRC32_ProcessBuffer(&crc, &random_seed, sizeof(random_seed));
- CRC32_ProcessBuffer(&crc, &mousedx, sizeof(mousedx));
- CRC32_ProcessBuffer(&crc, &mousedy, sizeof(mousedy));
- CRC32_Final(&crc);
- return crc;
- }
- BYTE u1[4];
- int command_number;
- int tick_count;
- Vector viewangles;
- Vector aimdirection;
- float forwardmove;
- float sidemove;
- float upmove;
- int buttons;
- BYTE impulse;
- int weaponselect;
- int weaponsubtype;
- int random_seed;
- short mousedx;
- short mousedy;
- bool hasbeenpredicted;
- Vector headangles;
- Vector headoffset;
- };
- class CVerifiedUserCmd
- {
- public:
- CUserCmd m_cmd;
- unsigned long m_crc;
- };
- CUserCmd* GetUserCmd(int slot, int seq)
- {
- typedef CUserCmd* (__thiscall* OriginalFn)(PVOID, int, int);
- return call_vfunc<OriginalFn>(this, 9)(this, slot, seq);
- }
- };
- class CGlobalVarsBase
- {
- public:
- float realtime;
- int framecount;
- float absoluteframetime;
- float absoluteframestarttimestddev;
- float curtime;
- float frametime;
- int maxClients;
- int tickcount;
- float interval_per_tick;
- float interpolation_amount;
- int simTicksThisFrame;
- int network_protocol;
- void* pSaveData;
- bool m_bClient;
- int nTimestampNetworkingBase;
- int nTimestampRandomizeWindow;
- };
- struct Ray_t
- {
- __declspec(align(16)) Vector m_Start;
- __declspec(align(16)) Vector m_Delta;
- __declspec(align(16)) Vector m_StartOffset;
- __declspec(align(16)) Vector m_Extents;
- //without your matrix3x4
- bool m_IsRay;
- bool m_IsSwept;
- void Init(Vector& vecStart, Vector& vecEnd)
- {
- m_Delta = vecEnd - vecStart;
- m_IsSwept = (m_Delta.LengthSqr() != 0);
- m_Extents.x = m_Extents.y = m_Extents.z = 0.0f;
- m_IsRay = true;
- m_StartOffset.x = m_StartOffset.y = m_StartOffset.z = 0.0f;
- m_Start = vecStart;
- }
- };
- struct cplane_t
- {
- Vector normal;
- float dist;
- BYTE type;
- BYTE signbits;
- BYTE pad[2];
- };
- class CBaseTrace
- {
- public:
- Vector startpos;
- Vector endpos;
- cplane_t plane;
- float fraction;
- int contents;
- unsigned short dispFlags;
- bool allsolid;
- bool startsolid;
- };
- struct csurface_t
- {
- const char* name;
- short surfaceProps;
- unsigned short flags;
- };
- class CGameTrace : public CBaseTrace
- {
- public:
- bool DidHitWorld() const;
- bool DidHitNonWorldEntity() const;
- int GetEntityIndex() const;
- bool DidHit() const;
- public:
- float fractionleftsolid;
- csurface_t surface;
- int hitgroup;
- short physicsbone;
- unsigned short worldSurfaceIndex;
- IClientEntity* m_pEnt;
- int hitbox;
- char shit[0x24];
- };
- inline bool CGameTrace::DidHit() const
- {
- return fraction < 1.0f || allsolid || startsolid;
- }
- typedef CGameTrace trace_t;
- enum TraceType_t
- {
- TRACE_EVERYTHING = 0,
- TRACE_WORLD_ONLY,
- TRACE_ENTITIES_ONLY,
- TRACE_EVERYTHING_FILTER_PROPS,
- };
- class ITraceFilter
- {
- public:
- virtual bool ShouldHitEntity(IClientEntity* pEntity, int contentsMask) = 0;
- virtual TraceType_t GetTraceType() const = 0;
- };
- class CTraceFilter : public ITraceFilter
- {
- public:
- bool ShouldHitEntity(IClientEntity* pEntityHandle, int contentsMask)
- {
- return !(pEntityHandle == pSkip);
- }
- TraceType_t GetTraceType() const
- {
- return TRACE_EVERYTHING;
- }
- void* pSkip;
- };
- class IEngineTrace
- {
- public:
- int GetPointContents(const Vector &vecAbsPosition, int contentsMask = MASK_ALL, IClientEntity** ppEntity = NULL)
- {
- typedef int(__thiscall* fnGetPointContents)(void*, const Vector&, int, IClientEntity**);
- return call_vfunc<fnGetPointContents>(this, 0)(this, vecAbsPosition, contentsMask, ppEntity);
- }
- void TraceRay(const Ray_t &ray, unsigned int fMask, ITraceFilter* pTraceFilter, trace_t* pTrace)
- {
- typedef void(__thiscall* fnTraceRay)(void*, const Ray_t&, unsigned int, ITraceFilter*, trace_t*);
- call_vfunc<fnTraceRay>(this, 5)(this, ray, fMask, pTraceFilter, pTrace);
- }
- void EdgeTraceRay(Ray_t &ray, CTraceFilter &filt, CGameTrace &trace, bool wall = false)
- {
- typedef void(__thiscall *OrigFn)(void *, Ray_t &, unsigned int, CTraceFilter &, CGameTrace &);
- call_vfunc<OrigFn>(this, 5)(this, ray, wall ? 0x200400B : 0x46004003, filt, trace); // 0x46004003 0x4600400B
- }
- };
- struct mstudiobbox_t
- {
- int bone;
- int group;
- Vector bbmin;
- Vector bbmax;
- int szhitboxnameindex;
- int unused[8];
- //float radius;
- char* GetHitboxName(void)
- {
- if (szhitboxnameindex == 0)
- return "";
- return ((char*)this) + szhitboxnameindex;
- }
- };
- struct mstudiohitboxset_t
- {
- int sznameindex;
- inline char* const GetName(void) const { return ((char*)this) + sznameindex; }
- int numhitboxes;
- int hitboxindex;
- inline mstudiobbox_t* GetHitbox(int i) const { return (mstudiobbox_t*)(((byte*)this) + hitboxindex) + i; };
- };
- struct mstudiobone_t
- {
- int sznameindex;
- inline char * const GetName(void) const { return ((char *)this) + sznameindex; }
- int parent;
- int bonecontroller[6];
- Vector pos;
- float quat[4];
- Vector rot;
- Vector posscale;
- Vector rotscale;
- matrix3x4 poseToBone;
- float qAlignment[4];
- int flags;
- int proctype;
- int procindex; // procedural rule
- mutable int physicsbone; // index into physically simulated bone
- inline void * GetProcedure() const { if (procindex == 0) return NULL; else return (void *)(((byte *)this) + procindex); };
- int surfacepropidx; // index into string tablefor property name
- inline char * const GetSurfaceProps(void) const { return ((char *)this) + surfacepropidx; }
- int contents; // See BSPFlags.h for the contents flags
- int unused[8]; // remove as appropriate
- };
- struct studiohdr_t
- {
- int id;
- int version;
- int checksum;
- char name[64];
- int length;
- Vector eyeposition;
- Vector illumposition;
- Vector hull_min;
- Vector hull_max;
- Vector view_bbmin;
- Vector view_bbmax;
- int flags;
- int numbones;
- int boneindex;
- inline mstudiobone_t *GetBone(int i) const { return (mstudiobone_t *)(((byte *)this) + boneindex) + i; };
- // inline mstudiobone_t *pBone(int i) const { Assert(i >= 0 && i < numbones); return (mstudiobone_t *)(((byte *)this) + boneindex) + i; };
- int numbonecontrollers;
- int bonecontrollerindex;
- int numhitboxsets;
- int hitboxsetindex;
- mstudiohitboxset_t* GetHitboxSet(int i) const
- {
- return (mstudiohitboxset_t*)(((byte*)this) + hitboxsetindex) + i;
- }
- inline mstudiobbox_t* GetHitbox(int i, int set) const
- {
- mstudiohitboxset_t const* s = GetHitboxSet(set);
- if (!s)
- return NULL;
- return s->GetHitbox(i);
- }
- inline int GetHitboxCount(int set) const
- {
- mstudiohitboxset_t const* s = GetHitboxSet(set);
- if (!s)
- return 0;
- return s->numhitboxes;
- }
- int numlocalanim;
- int localanimindex;
- int numlocalseq;
- int localseqindex;
- mutable int activitylistversion;
- mutable int eventsindexed;
- int numtextures;
- int textureindex;
- int numcdtextures;
- int cdtextureindex;
- int numskinref;
- int numskinfamilies;
- int skinindex;
- int numbodyparts;
- int bodypartindex;
- int numlocalattachments;
- int localattachmentindex;
- int numlocalnodes;
- int localnodeindex;
- int localnodenameindex;
- int numflexdesc;
- int flexdescindex;
- int numflexcontrollers;
- int flexcontrollerindex;
- int numflexrules;
- int flexruleindex;
- int numikchains;
- int ikchainindex;
- int nummouths;
- int mouthindex;
- int numlocalposeparameters;
- int localposeparamindex;
- int surfacepropindex;
- int keyvalueindex;
- int keyvaluesize;
- int numlocalikautoplaylocks;
- int localikautoplaylockindex;
- float mass;
- int contents;
- int numincludemodels;
- int includemodelindex;
- mutable void *virtualModel;
- int szanimblocknameindex;
- int numanimblocks;
- int animblockindex;
- mutable void *animblockModel;
- int bonetablebynameindex;
- void *pVertexBase;
- void *pIndexBase;
- byte constdirectionallightdot;
- byte rootLOD;
- byte numAllowedRootLODs;
- byte unused[1];
- int unused4;
- int numflexcontrollerui;
- int flexcontrolleruiindex;
- float flVertAnimFixedPointScale;
- int unused3[1];
- int studiohdr2index;
- int unused2[1];
- };
- struct surfacephysicsparams_t
- {
- float friction;
- float elasticity;
- float density;
- float thickness;
- float dampening;
- };
- struct surfaceaudioparams_t
- {
- float reflectivity; // like elasticity, but how much sound should be reflected by this surface
- float hardnessFactor; // like elasticity, but only affects impact sound choices
- float roughnessFactor; // like friction, but only affects scrape sound choices
- float roughThreshold; // surface roughness > this causes "rough" scrapes, < this causes "smooth" scrapes
- float hardThreshold; // surface hardness > this causes "hard" impacts, < this causes "soft" impacts
- float hardVelocityThreshold; // collision velocity > this causes "hard" impacts, < this causes "soft" impacts
- float highPitchOcclusion; //a value betweeen 0 and 100 where 0 is not occluded at all and 100 is silent (except for any additional reflected sound)
- float midPitchOcclusion;
- float lowPitchOcclusion;
- };
- struct surfacesoundnames_t
- {
- unsigned short walkStepLeft;
- unsigned short walkStepRight;
- unsigned short runStepLeft;
- unsigned short runStepRight;
- unsigned short impactSoft;
- unsigned short impactHard;
- unsigned short scrapeSmooth;
- unsigned short scrapeRough;
- unsigned short bulletImpact;
- unsigned short rolling;
- unsigned short breakSound;
- unsigned short strainSound;
- };
- struct surfacegameprops_t
- {
- public:
- float maxSpeedFactor;
- float jumpFactor;
- float flPenetrationModifier;
- float flDamageModifier;
- unsigned short material;
- byte climbable;
- char pad00[0x4];
- };
- struct surfacedata_t
- {
- surfacephysicsparams_t physics;
- surfaceaudioparams_t audio;
- surfacesoundnames_t sounds;
- surfacegameprops_t game;
- };
- class IPhysicsSurfaceProps
- {
- public:
- surfacedata_t *GetSurfaceData(int surfaceDataIndex)
- {
- typedef surfacedata_t*(__thiscall* fnGetSurfaceData)(void*, int);
- return call_vfunc<fnGetSurfaceData>(this, 5)(this, surfaceDataIndex);
- }
- };
- class ConVar
- {
- public:
- void SetValue(const char *value);
- void SetValue(float value);
- void SetValue(int value);
- void SetValue(Color value);
- void InternalSetString(const char* str);
- char* GetName();
- char* GetDefault();
- float GetFloat(void) const;
- int GetInt(void) const;
- Color GetColor(void) const;
- const char* GetString(void) const;
- char pad_0x0000[0x4]; //0x0000
- ConVar* pNext; //0x0004
- __int32 bRegistered; //0x0008
- char* pszName; //0x000C
- char* pszHelpString; //0x0010
- __int32 nFlags; //0x0014
- char pad_0x0018[0x4]; //0x0018
- ConVar* pParent; //0x001C
- char* pszDefaultValue; //0x0020
- char* strString; //0x0024
- __int32 StringLength; //0x0028
- float fValue; //0x002C
- __int32 nValue; //0x0030
- __int32 bHasMin; //0x0034
- float fMinVal; //0x0038
- __int32 bHasMax; //0x003C
- float fMaxVal; //0x0040
- void* fnChangeCallback; //0x0044
- };//Size=0x0048
- class SpoofedConvar {
- public:
- SpoofedConvar();
- SpoofedConvar(const char* szCVar);
- SpoofedConvar(ConVar* pCVar);
- ~SpoofedConvar();
- bool IsSpoofed();
- void Spoof();
- void SetFlags(int flags);
- int GetFlags();
- void SetBool(bool bValue);
- void SetInt(int iValue);
- void SetFloat(float flValue);
- void SetString(const char* szValue);
- private:
- ConVar* m_pOriginalCVar = NULL;
- ConVar* m_pDummyCVar = NULL;
- char m_szDummyName[128];
- char m_szDummyValue[128];
- char m_szOriginalName[128];
- char m_szOriginalValue[128];
- int m_iOriginalFlags;
- };
- class MinspecCvar
- {
- public:
- MinspecCvar(const char* szCVar, char* newname, float newvalue);
- ~MinspecCvar();
- bool ValidCvar();
- void Spoof();
- template<typename T>
- void SetValue(T value);
- int GetInt();
- float GetFloat();
- const char* GetString();
- private:
- ConVar* m_pConVar;
- char* m_szOriginalName;
- char* m_szReplacementName;
- float m_OriginalValue;
- float m_newvalue;
- };
- class IAppSystem
- {
- public:
- virtual ~IAppSystem()
- {
- }
- virtual void func0() = 0;
- virtual void func1() = 0;
- virtual void func2() = 0;
- virtual void func3() = 0;
- virtual void func4() = 0;
- virtual void func5() = 0;
- virtual void func6() = 0;
- virtual void func7() = 0;
- virtual void func8() = 0;
- virtual void func9() = 0;
- };
- struct CVarDLLIdentifier_t;
- class ICVar : public IAppSystem
- {
- public:
- virtual void func10() = 0;
- virtual void RegisterConCommand(ConVar *pCommandBase) = 0;
- virtual void UnregisterConCommand(ConVar *pCommandBase) = 0;
- virtual void func13() = 0;
- virtual ConVar *FindVar(const char *var_name) = 0;
- // virtual void ConsoleColorPrintf(const Color& clr, const char *pFormat, ...) const = 0;
- virtual void func15() = 0;
- virtual void func16() = 0;
- virtual void func17() = 0;
- virtual void func18() = 0;
- virtual void func19() = 0;
- virtual void func20() = 0;
- void const ConsoleColorPrintf(const Color& clr, const char *pFormat, ...)
- {
- typedef void(__cdecl *OriginalFn)(void*, const Color&, const char *, ...);
- if (pFormat == nullptr)
- return;
- char buf[8192];
- va_list list;
- va_start(list, pFormat);
- _vsnprintf_s(buf, sizeof(buf) - 1, pFormat, list);
- va_end(list);
- buf[sizeof(buf) - 1] = 0;
- call_vfunc<OriginalFn>(this, 25)(this, clr, buf, list);
- }
- };
- class CTraceFilterNoPlayer : public CTraceFilter
- {
- public:
- CTraceFilterNoPlayer() {}
- virtual bool ShouldHitEntity(IClientEntity *pServerEntity, int contentsMask)
- {
- if (pServerEntity)
- return !pServerEntity->IsPlayer();
- return false;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement