Add more entity structures to the SDK

Stuff will be separated properly very soon.
This commit is contained in:
Kawe Mazidjatari 2023-01-18 01:34:40 +01:00
parent 217bbc8ea1
commit 3ed423543e
13 changed files with 1485 additions and 0 deletions

1040
r5dev/game/server/player.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,133 @@
//====== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. =======//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef PLAYERLOCALDATA_H
#define PLAYERLOCALDATA_H
#ifdef _WIN32
#pragma once
#endif
#include "mathlib/mathlib.h"
#include "game/shared/playernet_vars.h"
//-----------------------------------------------------------------------------
// Purpose: Player specific data ( sent only to local player, too )
//-----------------------------------------------------------------------------
class CPlayerLocalData
{
char gap_0[8];
int m_iHideHUD;
Vector3D m_vecOverViewpoint;
bool m_duckToggleOn;
char gap_19[3];
int m_forceStance;
int m_nDuckTransitionTimeMsecs;
int m_superJumpsUsed;
bool m_jumpedOffRodeo;
char gap_29[3];
float m_jumpPressTime;
float m_jumpHoldTime;
float m_jetpackActivateTime;
float m_flSuitPower;
float m_flSuitJumpPower;
float m_flSuitGrapplePower;
int m_nStepside;
float m_flFallVelocity;
int m_nOldButtons;
float m_oldForwardMove;
char gap_54[4];
void* m_pOldSkyCamera;
float m_accelScale;
float m_powerRegenRateScale;
float m_dodgePowerDelayScale;
bool m_bDrawViewmodel;
char gap_6d[3];
float m_flStepSize;
bool m_bAllowAutoMovement;
char gap_75[3];
float m_airSlowMoFrac;
int predictableFlags;
int m_bitsActiveDevices;
int m_hSkyCamera;
sky3dparams_t m_skybox3d;
CFogParams m_fog;
audioparams_t m_audio;
float m_animNearZ;
Vector3D m_airMoveBlockPlanes[2];
float m_airMoveBlockPlaneTime;
int m_airMoveBlockPlaneCount;
float m_queuedMeleePressTime;
float m_queuedGrappleMeleeTime;
bool m_queuedMeleeAttackAnimEvent;
bool m_disableMeleeUntilRelease;
char gap_1e6[2];
float m_meleePressTime;
int m_meleeDisabledCounter;
int m_meleeInputIndex;
int lastAttacker;
int attackedCount;
int m_trackedChildProjectileCount;
bool m_oneHandedWeaponUsage;
bool m_prevOneHandedWeaponUsage;
char gap_202[2];
float m_flCockpitEntryTime;
float m_ejectStartTime;
float m_disembarkStartTime;
float m_hotDropImpactTime;
float m_outOfBoundsDeadTime;
int m_objectiveIndex;
int m_objectiveEntity;
float m_objectiveEndTime;
int m_cinematicEventFlags;
bool m_forcedDialogueOnly;
char gap_229[3];
float m_titanBuildTime;
float m_titanBubbleShieldTime;
bool m_titanEmbarkEnabled;
bool m_titanDisembarkEnabled;
char gap_236[2];
int m_voicePackIndex;
float m_playerAnimStationaryGoalFeetYaw;
bool m_playerAnimJumping;
char gap_241[3];
float m_playerAnimJumpStartTime;
bool m_playerAnimFirstJumpFrame;
bool m_playerAnimDodging;
char gap_24a[2];
int m_playerAnimJumpActivity;
bool m_playerAnimLanding;
bool m_playerAnimShouldLand;
char gap_252[2];
float m_playerAnimLandStartTime;
bool m_playerAnimInAirWalk;
char gap_259[3];
float m_playerAnimPrevFrameSequenceMotionYaw;
int m_playerAnimMeleeParity;
float m_playerAnimMeleeStartTime;
matrix3x4_t m_playerLocalGravityToWorldTransform;
Quaternion m_playerLocalGravityBlendStartRotation;
Quaternion m_playerLocalGravityBlendEndRotation;
Vector3D m_playerLocalGravityBlendEndDirection;
float m_playerLocalGravityBlendStartTime;
float m_playerLocalGravityBlendEndTime;
float m_playerLocalGravityBlendStrength;
float m_playerLocalGravityStrength;
int m_playerLocalGravityType;
Vector3D m_playerLocalGravityPoint;
Vector3D m_playerLocalGravityLineStart;
Vector3D m_playerLocalGravityLineEnd;
int m_playerLocalGravityEntity;
int m_playerLocalGravityLineStartEntity;
int m_playerLocalGravityLineEndEntity;
float m_playerFloatLookStartTime;
float m_playerFloatLookEndTime;
float m_wallrunLatestFloorHeight;
Vector3D m_groundNormal;
bool m_continuousUseBlocked;
};
#endif // PLAYERLOCALDATA_H

View File

@ -1,5 +1,70 @@
#ifndef ANIMATION_H #ifndef ANIMATION_H
#define ANIMATION_H #define ANIMATION_H
#include "mathlib/vector.h"
class CAnimationLayer
{
bool m_bSequenceFinished;
char gap_1[3];
int m_fFlags;
int m_layerIndex;
int m_modelIndex;
float m_flKillRate;
float m_flKillDelay;
char m_nActivity[4];
int m_nPriority;
float m_flLastEventCheck;
char gap_24[4];
void* m_animationLayerOwner;
};
struct __declspec(align(8)) AnimRelativeData
{
char gap_0[8];
Vector3D m_animInitialPos;
Vector3D m_animInitialVel;
Quaternion m_animInitialRot;
Vector3D m_animInitialCorrectPos;
Quaternion m_animInitialCorrectRot;
Vector3D m_animEntityToRefOffset;
Quaternion m_animEntityToRefRotation;
float m_animBlendBeginTime;
float m_animBlendEndTime;
int m_animScriptSequence;
int m_animScriptModel;
bool m_animIgnoreParentRot;
char gap_79[3];
int m_animMotionMode;
bool m_safePushMode;
};
struct Player_AnimViewEntityData
{
char gap_0[8];
int animViewEntityHandle;
float animViewEntityAngleLerpInDuration;
float animViewEntityOriginLerpInDuration;
float animViewEntityLerpOutDuration;
bool animViewEntityStabilizePlayerEyeAngles;
char gap_19[3];
int animViewEntityThirdPersonCameraParity;
int animViewEntityThirdPersonCameraAttachment[6];
int animViewEntityNumThirdPersonCameraAttachments;
bool animViewEntityThirdPersonCameraVisibilityChecks;
bool animViewEntityDrawPlayer;
char gap_3e[2];
float fovTarget;
float fovSmoothTime;
int animViewEntityParity;
int lastAnimViewEntityParity;
int lastAnimViewEntityParityTick;
Vector3D animViewEntityCameraPosition;
Vector3D animViewEntityCameraAngles;
float animViewEntityBlendStartTime;
Vector3D animViewEntityBlendStartEyePosition;
Vector3D animViewEntityBlendStartEyeAngles;
};
inline CMemory p_CStudioHdr__LookupSequence; inline CMemory p_CStudioHdr__LookupSequence;
inline auto v_CStudioHdr__LookupSequence = p_CStudioHdr__LookupSequence.RCast<int(*)(CStudioHdr* pStudio, const char* pszName)>(); inline auto v_CStudioHdr__LookupSequence = p_CStudioHdr__LookupSequence.RCast<int(*)(CStudioHdr* pStudio, const char* pszName)>();

View File

@ -0,0 +1,59 @@
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef PLAYERNET_VARS_H
#define PLAYERNET_VARS_H
#ifdef _WIN32
#pragma once
#endif
#include "mathlib/mathlib.h"
#include "shared_classnames.h"
class CFogParams
{
char gap_0[8];
float botAlt;
float topAlt;
float halfDistBot;
float halfDistTop;
float distColorStr;
float dirColorStr;
float distOffset;
float densityScale;
float halfAngleDeg;
float HDRColorScale;
int distColor;
int dirColor;
Vector3D direction;
float minFadeTime;
bool forceOntoSky;
bool enable;
char gap_4a[2];
int id;
};
struct sky3dparams_t
{
char gap_0[8];
int scale;
int cellNum;
bool useWorldFog;
char gap_11[7];
CFogParams fog;
};
struct audioparams_t
{
char gap_0[8];
Vector3D localSound[8];
int soundscapeIndex;
int localBits;
int entIndex;
char gap_74[4];
};
#endif // PLAYERNET_VARS_H

View File

@ -0,0 +1,25 @@
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef SHARED_CLASSNAMES_H
#define SHARED_CLASSNAMES_H
#ifdef _WIN32
#pragma once
#endif
// Hacky macros to allow shared code to work without even worse macro-izing
#if defined( CLIENT_DLL )
/* // TODO: Uncomment if required for client.
#define CBaseEntity C_BaseEntity
#define CBaseCombatCharacter C_BaseCombatCharacter
#define CBaseAnimating C_BaseAnimating
#define CBasePlayer C_BasePlayer
*/
#endif
#endif // SHARED_CLASSNAMES_H

View File

@ -0,0 +1,59 @@
//====== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. =======//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef TAKEDAMAGEINFO_H
#define TAKEDAMAGEINFO_H
#ifdef _WIN32
#pragma once
#endif
#include "mathlib/mathlib.h"
// Used to initialize m_flBaseDamage to something that we know pretty much for sure
// hasn't been modified by a user.
#define BASEDAMAGE_NOT_SPECIFIED FLT_MAX // !TODO: check if this is correct for r5.
struct ScriptOriginatedDamageInfo
{
int m_scriptDamageType;
int m_damageSourceIdentifier;
};
/* 1426 */
class CTakeDamageInfo
{
float m_vecDamageForceMagnitude;
Vector3D m_vecDamageForceDirection;
Vector3D m_vecDamagePosition;
Vector3D m_vecReportedPosition;
int m_hInflictor;
int m_hAttacker;
int m_hWeapon;
__int16 m_hWeaponFileInfo;
bool m_forceKill;
char gap_37[1];
float m_flDamage;
float m_damageCriticalScale;
float m_damageShieldScale;
float m_flMaxDamage;
float m_flHeavyArmorDamageScale;
int m_bitsDamageType;
float m_flRadius;
int m_hitGroup;
int m_hitBox;
ScriptOriginatedDamageInfo m_scriptDamageInfo;
int m_deathPackage;
float m_distanceFromAttackOrigin;
float m_distanceFromExplosionCenter;
bool m_doDeathForce;
char gap_71[3];
int m_damageFlags;
int m_projectilePredictableId;
int m_flinchDirection;
};
#endif // TAKEDAMAGEINFO_H

View File

@ -0,0 +1,40 @@
//====== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. =======//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef PLAYERSTATE_H
#define PLAYERSTATE_H
#ifdef _WIN32
#pragma once
#endif
#include "mathlib/mathlib.h"
class CPlayerState
{
char gap_0[8];
int playerEntityIndex;
char gap_c[4];
__int64 currentClass;
__int64 requestedClass;
__int64 onDeathClass;
__int64 oldClass;
__int64 netname;
int fixangle;
Vector3D anglechange;
int index;
Vector3D forceWorldViewAngle;
int forceWorldViewAngleUntilTick;
bool replay;
char gap_5d[3];
int lastPlayerView_tickcount;
Vector3D lastPlayerView_origin;
Vector3D lastPlayerView_angle;
bool deadflag;
char gap_7d[3];
Vector3D m_localViewAngles;
};
#endif // PLAYERSTATE_H

View File

@ -233,6 +233,9 @@
<ClInclude Include="..\game\client\viewrender.h" /> <ClInclude Include="..\game\client\viewrender.h" />
<ClInclude Include="..\game\shared\animation.h" /> <ClInclude Include="..\game\shared\animation.h" />
<ClInclude Include="..\game\shared\collisionproperty.h" /> <ClInclude Include="..\game\shared\collisionproperty.h" />
<ClInclude Include="..\game\shared\playernet_vars.h" />
<ClInclude Include="..\game\shared\shared_classnames.h" />
<ClInclude Include="..\game\shared\takedamageinfo.h" />
<ClInclude Include="..\inputsystem\ButtonCode.h" /> <ClInclude Include="..\inputsystem\ButtonCode.h" />
<ClInclude Include="..\inputsystem\inputsystem.h" /> <ClInclude Include="..\inputsystem\inputsystem.h" />
<ClInclude Include="..\launcher\IApplication.h" /> <ClInclude Include="..\launcher\IApplication.h" />
@ -313,6 +316,7 @@
<ClInclude Include="..\public\materialsystem\shader_vcs_version.h" /> <ClInclude Include="..\public\materialsystem\shader_vcs_version.h" />
<ClInclude Include="..\public\model_types.h" /> <ClInclude Include="..\public\model_types.h" />
<ClInclude Include="..\public\networkvar.h" /> <ClInclude Include="..\public\networkvar.h" />
<ClInclude Include="..\public\playerstate.h" />
<ClInclude Include="..\public\rendersystem\schema\texture.g.h" /> <ClInclude Include="..\public\rendersystem\schema\texture.g.h" />
<ClInclude Include="..\public\studio.h" /> <ClInclude Include="..\public\studio.h" />
<ClInclude Include="..\core\resource.h" /> <ClInclude Include="..\core\resource.h" />

View File

@ -1904,6 +1904,18 @@
<ClInclude Include="..\game\shared\collisionproperty.h"> <ClInclude Include="..\game\shared\collisionproperty.h">
<Filter>sdk\game\shared</Filter> <Filter>sdk\game\shared</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\game\shared\playernet_vars.h">
<Filter>sdk\game\shared</Filter>
</ClInclude>
<ClInclude Include="..\game\shared\shared_classnames.h">
<Filter>sdk\game\shared</Filter>
</ClInclude>
<ClInclude Include="..\public\playerstate.h">
<Filter>sdk\public</Filter>
</ClInclude>
<ClInclude Include="..\game\shared\takedamageinfo.h">
<Filter>sdk\game\shared</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Image Include="..\shared\resource\lockedserver.png"> <Image Include="..\shared\resource\lockedserver.png">

View File

@ -183,8 +183,13 @@
<ClInclude Include="..\game\server\fairfight_impl.h" /> <ClInclude Include="..\game\server\fairfight_impl.h" />
<ClInclude Include="..\game\server\gameinterface.h" /> <ClInclude Include="..\game\server\gameinterface.h" />
<ClInclude Include="..\game\server\networkproperty.h" /> <ClInclude Include="..\game\server\networkproperty.h" />
<ClInclude Include="..\game\server\player.h" />
<ClInclude Include="..\game\server\playerlocaldata.h" />
<ClInclude Include="..\game\shared\animation.h" /> <ClInclude Include="..\game\shared\animation.h" />
<ClInclude Include="..\game\shared\collisionproperty.h" /> <ClInclude Include="..\game\shared\collisionproperty.h" />
<ClInclude Include="..\game\shared\playernet_vars.h" />
<ClInclude Include="..\game\shared\shared_classnames.h" />
<ClInclude Include="..\game\shared\takedamageinfo.h" />
<ClInclude Include="..\launcher\IApplication.h" /> <ClInclude Include="..\launcher\IApplication.h" />
<ClInclude Include="..\launcher\launcher.h" /> <ClInclude Include="..\launcher\launcher.h" />
<ClInclude Include="..\launcher\prx.h" /> <ClInclude Include="..\launcher\prx.h" />
@ -251,6 +256,7 @@
<ClInclude Include="..\public\ivscript.h" /> <ClInclude Include="..\public\ivscript.h" />
<ClInclude Include="..\public\model_types.h" /> <ClInclude Include="..\public\model_types.h" />
<ClInclude Include="..\public\networkvar.h" /> <ClInclude Include="..\public\networkvar.h" />
<ClInclude Include="..\public\playerstate.h" />
<ClInclude Include="..\public\server_class.h" /> <ClInclude Include="..\public\server_class.h" />
<ClInclude Include="..\public\string_t.h" /> <ClInclude Include="..\public\string_t.h" />
<ClInclude Include="..\public\studio.h" /> <ClInclude Include="..\public\studio.h" />

View File

@ -1323,6 +1323,24 @@
<ClInclude Include="..\game\server\networkproperty.h"> <ClInclude Include="..\game\server\networkproperty.h">
<Filter>sdk\game\server</Filter> <Filter>sdk\game\server</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\game\server\player.h">
<Filter>sdk\game\server</Filter>
</ClInclude>
<ClInclude Include="..\game\server\playerlocaldata.h">
<Filter>sdk\game\server</Filter>
</ClInclude>
<ClInclude Include="..\game\shared\playernet_vars.h">
<Filter>sdk\game\shared</Filter>
</ClInclude>
<ClInclude Include="..\game\shared\shared_classnames.h">
<Filter>sdk\game\shared</Filter>
</ClInclude>
<ClInclude Include="..\public\playerstate.h">
<Filter>sdk\public</Filter>
</ClInclude>
<ClInclude Include="..\game\shared\takedamageinfo.h">
<Filter>sdk\game\shared</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\common\opcodes.cpp"> <ClCompile Include="..\common\opcodes.cpp">

View File

@ -255,9 +255,14 @@
<ClInclude Include="..\game\server\fairfight_impl.h" /> <ClInclude Include="..\game\server\fairfight_impl.h" />
<ClInclude Include="..\game\server\gameinterface.h" /> <ClInclude Include="..\game\server\gameinterface.h" />
<ClInclude Include="..\game\server\networkproperty.h" /> <ClInclude Include="..\game\server\networkproperty.h" />
<ClInclude Include="..\game\server\player.h" />
<ClInclude Include="..\game\server\playerlocaldata.h" />
<ClInclude Include="..\game\shared\ai_utility_shared.h" /> <ClInclude Include="..\game\shared\ai_utility_shared.h" />
<ClInclude Include="..\game\shared\animation.h" /> <ClInclude Include="..\game\shared\animation.h" />
<ClInclude Include="..\game\shared\collisionproperty.h" /> <ClInclude Include="..\game\shared\collisionproperty.h" />
<ClInclude Include="..\game\shared\playernet_vars.h" />
<ClInclude Include="..\game\shared\shared_classnames.h" />
<ClInclude Include="..\game\shared\takedamageinfo.h" />
<ClInclude Include="..\inputsystem\ButtonCode.h" /> <ClInclude Include="..\inputsystem\ButtonCode.h" />
<ClInclude Include="..\inputsystem\inputsystem.h" /> <ClInclude Include="..\inputsystem\inputsystem.h" />
<ClInclude Include="..\launcher\IApplication.h" /> <ClInclude Include="..\launcher\IApplication.h" />
@ -349,6 +354,7 @@
<ClInclude Include="..\public\materialsystem\shader_vcs_version.h" /> <ClInclude Include="..\public\materialsystem\shader_vcs_version.h" />
<ClInclude Include="..\public\model_types.h" /> <ClInclude Include="..\public\model_types.h" />
<ClInclude Include="..\public\networkvar.h" /> <ClInclude Include="..\public\networkvar.h" />
<ClInclude Include="..\public\playerstate.h" />
<ClInclude Include="..\public\rendersystem\schema\texture.g.h" /> <ClInclude Include="..\public\rendersystem\schema\texture.g.h" />
<ClInclude Include="..\public\server_class.h" /> <ClInclude Include="..\public\server_class.h" />
<ClInclude Include="..\public\string_t.h" /> <ClInclude Include="..\public\string_t.h" />

View File

@ -2027,6 +2027,24 @@
<ClInclude Include="..\public\basehandle.h"> <ClInclude Include="..\public\basehandle.h">
<Filter>sdk\public</Filter> <Filter>sdk\public</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\game\server\player.h">
<Filter>sdk\game\server</Filter>
</ClInclude>
<ClInclude Include="..\game\server\playerlocaldata.h">
<Filter>sdk\game\server</Filter>
</ClInclude>
<ClInclude Include="..\game\shared\playernet_vars.h">
<Filter>sdk\game\shared</Filter>
</ClInclude>
<ClInclude Include="..\game\shared\shared_classnames.h">
<Filter>sdk\game\shared</Filter>
</ClInclude>
<ClInclude Include="..\public\playerstate.h">
<Filter>sdk\public</Filter>
</ClInclude>
<ClInclude Include="..\game\shared\takedamageinfo.h">
<Filter>sdk\game\shared</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Image Include="..\shared\resource\lockedserver.png"> <Image Include="..\shared\resource\lockedserver.png">