Game Client (BO2)

From COD Engine Research
Jump to: navigation, search
/* gclient_s->buttons.buttons */
#define __jump			0x00200000
#define __stance		0x00000200
#define __use			0x04000000
#define __triangle		0x00000008
#define __attack		0x80000000
#define __ads			0x00100000
#define __prone			0x00800000
#define __crouch		0x00400000
#define __frag			0x00020000
#define __tactical		0x00010000
#define __melee			0x20000000
#define __sprint		0x40000000
 
/* gclient_s->actionSlots.buttons2 */
#define __dpadup		0x00040000
#define __dpaddown		0x00020000
#define __dpadleft		0x00010000
#define __dpadright		0x00008000
 
enum team_t
{
	TEAM_FREE = 0x0,
	TEAM_ALLIES = 0x1,
	TEAM_AXIS = 0x2,
	TEAM_THREE = 0x3,
	TEAM_FOUR = 0x4,
	TEAM_FIVE = 0x5,
	TEAM_SIX = 0x6,
	TEAM_SEVEN = 0x7,
	TEAM_EIGHT = 0x8,
	TEAM_MAX = 0x9
};
 
enum sessionState_t
{
	SESS_STATE_PLAYING = 0x0,
	SESS_STATE_DEAD = 0x1,
	SESS_STATE_SPECTATOR = 0x2,
	SESS_STATE_INTERMISSION = 0x3,
};
 
enum clientConnected_t
{
	CON_DISCONNECTED = 0x0,
	CON_CONNECTING = 0x1,
	CON_CONNECTED = 0x2,
};
 
/* playerState_s->stats[4] */
enum statIndex_t
{
  STAT_HEALTH = 0x0,
  STAT_DEAD_YAW = 0x1,
  STAT_MAX_HEALTH = 0x2,
  STAT_SPAWN_COUNT = 0x3,
  MAX_STATS = 0x4,
};
 
struct PlayerVehicleState
{
	float origin[3];//0
	float angles[3];//0xC
	float velocity[3];//0x18
	float angVelocity[3];//0x24
	float tilt[2];//0x30
	float tiltVelocity[2];//0x38
	float targetHeightDelta;//0x40
	float lastGroundHeight;//0x44
	int entity;//0x48
	int flags;//0x4C
	bool fullPhysics
};
 
struct SprintState
{
	int sprintButtonUpRequired;//0x0
	int sprintDelay;//0x4
	int lastSprintStart;//0x8
	int lastSprintEnd;//0xC
	int sprintStartMaxLength;//0x10
	int sprintDuration;//0x14
	int sprintCooldown;//0x18
};
 
struct MantleState
{
	float yaw; //0x0
	int timer; //0x4
	int transIndex; //0x8
	int flags; //0xC
};
 
struct objective_t
{
  objectiveState_t state;
  vec3_t origin;
  __int16 entNum;
  vec2_t size;
  int icon;
  __int16 ownerNum;
  unsigned __int16 name;
  __int16 teamMask;
  char progress;
  int clientUseMask[1];
  char gamemodeFlags;
  char flags;
  char teamNum;
};
 
struct PlayerHeldWeapon
{
  int weapon;
  int options;
  float heatPercent;
  int fuelTankTime;
  int adsZoomSelect;
  bool overHeating;
  bool needsRechamber;
  bool heldBefore;
  bool quickReload;
  bool blockWeaponPickup;
  char model;
};
 
struct AmmoPool
{
  int count;
};
 
struct AmmoClip
{
  int count;
};
 
struct playerState_s
{
	int commandTime;//0x0
	int pm_type;//0x4
	int bobCycle; //0x8
	int pm_flags; //0xC
	long long weapFlags;//0x10
	int otherFlags;//0x18
	int pm_time;//0x1C
	unsigned int loopSoundId;//0x20
	int loopSoundFade;//0x24
	vec3_t origin;//0x28
	vec3_t velocity;//0x34
	int remoteEyesEnt; //0x40
	int remoteEyesTagnam; //0x44
	int remoteControlEnt; //0x48
	int weaponTime;//0x4C
	int weaponDelay;//0x50
	int weaponTimeLeft;//0x54
	int weaponDelayLeft;//0x58
	int weaponIdleTime;//0x5C
	int grenadeTimeLeft;//0x60
	int throwBackGrenadeOwner;//0x64
	int throwBackGrenadeTimeLeft;//0x68
	int weaponRestrictKickTime;//0x6C
	bool mountAvailable;//0x70
	bool bRunLeftGun;//0x71
	bool bCarryingTurret;//0x72
	float mountPos[3];//0x74
	float mountDir;//0x80
	bool bThirdPerson;//0x84
	int foliageSoundTime;//0x88
	int gravity;//0x8C
	float leanf;//0x90
	int speed;//0x94
	float delta_angles[3];//0x98
	int groundEntityNum;//0xA4
	int moverEntityNum;//0xA8
	int moverTimestamp;//0xAC
	int groundType;//0xB0
	float vLadderVec[3];//0xB4
	int jumpTime;//0xC0
	float jumpOriginZ;//0xC4
	int slideTime;//0xC8
	int moveType;//0xCC
	int legsTimer;//0xD0
	int torsoTimer;//0xD4
	short legsAnim;//0xD8
	short torsoAnim;//0xDA
	int legsAnimDuration;//0xE0
	int torsoAnimDuration
	int damageTimer;//0xE4
	int damageDuration;//0xE8
	int dmgDirection;//0xEC
	int dmgType;//0xF0
	int corpseIndex;//0xF4
	int movementDir;//0xF8
	int eFlags;//0xFC
	int eFlags2;//0x100
	PlayerVehicleState vehicleState;//0x104
	short predictableEventSequence;//0x158
	short predictableEventSequenceOld;//0x15A
	int predictableEvents[4];//0x15C
	unsigned int predictableEventParms[4];//0x16C
	short unpredictableEventSequence; //0x17C
	short oldUnpredictableEventSequence;//0x17E
	int unpredictableEvents[4];//0x180
	unsigned int unpredictableEventParms[4];//0x190
	int clientNum;//0x1A0
	int offHandWeapon;//0x1A4
	int offhandSecondary;//0x1A8
	int offhandPrimary;//0x1AC
	int renderOptions;//0x1B0
	int momentum;//0x1B4
	int weapon;//0x1B8
	int lastStandPrevWeapon;//0x1BC
	int lastWeaponAltModeSwitch;//0x1C0
	int stowedWeapon;//0x1C4
	char unusedCompatibilityPadding;//0x1C8
	unsigned int meleeWeapon;//0x1CC
	int weaponstate;//0x1D0
	int weaponstateLeft;//0x1D4
	unsigned int weaponShotCount;//0x1D8
	unsigned int weaponShotCountLeft;//0x1DC
	float fWeaponPosFrac;//0x1E0
	int adsDelayTime;//0x1E4
	int spreadOverride;//0x1E8
	int spreadOverrideState;//0x1EC
	float weaponSpinLerp;//0x1F0
	int viewmodelIndex;//0x1F4
	float viewangles[3];//0x1F8
	int viewHeightTarget;//0x204
	float viewHeightCurrent;//0x208
	int viewHeightLerpTime;//0x20C
	int viewHeightLerpTarget;//0x210
	int viewHeightLerpDown;//0x214
	float viewAngleClampBase[2];//0x218
	float viewAngleClampRange[2];//0x220
	int damageEvent;//0x228
	int damageYaw;//0x22C
	int damagePitch;//0x230
	int damageCount;//0x234
	int stats[4];
	PlayerHeldWeapon heldWeapon[0xF];//0x248
	AmmoPool ammo[0xF];//0x3EC
	AmmoClip ammoClip[0xF];//0x428
	float proneDirection;//0x464
	float proneDirectionPitch;//0x468
	float proneTorsoPitch;//0x46C
	int viewlocked;//0x470
	short viewlocked_entNum;//0x474
	int vehiclePos;//0x478
	int vehicleType;//0x47C
	int vehicleAnimBoneIndex;//0x480
	int linkFlags;//0x484
	float linkAngles[3];//0x488
	int cursorHint;//0x494
	int cursorHintString;//0x498
	int cursorHintEntIndex;//0x49C
	int cursorHintWeapon;//0x4A0
	int iCompassPlayerInfo;//0x4A4
	unsigned int spyplaneTypeEnabled;//0x4A8
	unsigned int satelliteTypeEnabled;//0x4AC
	int locationSelectionInfo;//0x4B0
	int locationSelectionType;//0x4B4
	SprintState sprintState; //0x4B8
	float lastDtpEnd;//0x4D4
	float fTorsoPitch;//0x4D8
	float fWaistPitch;//0x4DC
	float holdBreathScale;//0x4E0
	int holdBreathTimer;//0x4E4
	int chargeShotTimer;//0x4E8
	int chargeShotLevel;//0x4EC
	int shotsFiredFromChamber;//0x4F0
	float quickScopeScale;//0x4F4
	int quickScopeTimer;//0x4F8
	int clientFields;//0x4FC
	int clientFields2;//0x500
	int clientFields3;//0x504
	int entityStateClientFields;//0x508
	float moveSpeedScaleMultiplier;//0x50C
	MantleState mantleState;//0x510
	int vehicleAnimStage;//0x520
	int vehicleEntryPoint;//0x524
	unsigned int scriptedAnim;//0x528
	int scriptedAnimTime;//0x52C
	int meleeChargeEnt;//0x530
	int meleeChargeDist;//0x534
	int meleeChargeTime;//0x538
	int weapLockFlags;//0x53C
	int weapLockedEntnum;//0x540
	unsigned int airburstMarkDistance;//0x544
	unsigned int perks[2];//0x548
	int actionSlotType[4];//0x550
	int actionSlotParam[4];//0x560
	int inventoryWeapon;//0x570
	short wiiumoteAimX;//0x574
	short wiiumoteAimY;//0x576
	char wiiuControllerType;//0x578
	char vehicleDefIndex;//0x579
	int entityEventSequence;//0x57C
	int weapAnim;//0x580
	int weapAnimLeft;//0x584
	float aimSpreadScale;//0x588
	int shellshockIndex;//0x58C
	int shellshockTime;//0x590
	int shellshockDuration;//0x594
	float dofNearStart;//0x598
	float dofNearEnd;//0x59C
	float dofFarStart;//0x5A0
	float dofFarEnd;//0x5A4
	float dofNearBlur;//0x5A8
	float dofFarBlur;//0x5AC
	float dofViewmodelStart;//0x5B0
	float dofViewmodelEnd;//0x5B4
		char unk12[0xC];//0x5B8
	int adsZoomSelect;//0x5C4
	int adsZoomLatchTime;//0x5C8
	bool adsZoomLatchState;//0x5CC
	int adsPrevZoomSelect;//0x5D0
	int adsPrevZoomSelectTime;//0x5D4
	int artilleryInboundIconLocation;//0x5D8
	float visionSetLerpRatio;//0x5DC
	int poisoned;//0x5E0
	int binoculars;//0x5E4
	int scriptCursorHintString; //0x5E8
	objective_t objective[32];
	int deltaTime; //0xBEC
	int killCamEntity; //0xBF0
	int killCamTargetEntity; //0xBF4
	int introShotsFired; //0xBF8
	struct
	{
		hudelem_s current[31]; //0xBFC
		hudelem_s archival[31]; //0x1B00
	}hud;
	char unknown15[0xC]; // most likely padding
};	// 0x2A10
 
struct button_t
{
	int buttons;
	int buttons2; // can someone explain this ?
};
 
struct usercmd_s
{
	int serverTime; //0x0
	button_t button_bits; //0x4
	int angles[3]; //0xC
	int weapon; // 0x18
	int offHandWeapon; //0x1C
	int lastWeaponAltModeSwitch; //0x20
	char forwardmove; //0x24
	char rightmove; //0x25
	char upmove; //0x26
	char forwardlook; //0x27
	char rightlook; //0x28
	char uplook; //0x29
		char unk2[0x12]; //0x2A
};
 
struct playerTeamState_t
{
	int location;
};
 
union val64
{
	__int64 value
	struct
	{
		int high; //0x0
		int low; //0x4
	};
};
 
struct score_s
{
  int ping;
  int status_icon;
  int place;
  int score;
  int kills;
  int assists;
  int deaths;
  int wagerWinnings;
  int scoreboardColumns[5];
  int downs;
  int revives;
  int headshots;
  int scoreMultiplier;
  int currentStreak;
};
 
struct clientState_s
{
	int clientIndex; //0x0
	team_t team; //0x4
	team_t ffaTeam; //0x8
	int modelindex; //0xC
	int riotShieldNext; //0x10
	int attachModelIndex[6]; //0x14
	int attachTagIndex[6]; //0x2C
	char name[0x20]; //0x44
	float maxSprintTimeMultiplier; //0x64
	int rank; //0x68
	union
	{
		int prestige;
		int lastDaysPlayed;
	};
	int lastDamageTime; //0x70
	int lastStandStartTime; //0x74
	int turnedHumanTime; //0x78
	int beingRevived; //0x7C
	val64 xuid64; //0x80
	val64 leagueTeamID64; //0x88
	int leagueDivisionID; //0x90
	val64 leagueSubdivisionID64; //0x98
	int leagueSubdivisionRank; //0xA0
	unsigned int perks[2]; //0xA4
	int voiceConnectivityBits; //0xAC
	char clanAbbrev[8]; //0xB0
	int attachedVehEntNum; //0xB8
	int attachedVehSeat; //0xBC
	int needsRevive; //0xC0
	int clanAbbrevEV; //0xC4
	int vehAnimState; //0xC8
	score_s score; //0xCC
	int clientUIVisibilityFlags; //0x114
	int offhandWeaponVisible; //0x118
};
 
struct clientSession_t
{
	sessionState_t sessionState; //0x0
	int forceSpectatorClient; //0x4
	int killcamEntity; //0x8
	int killcamTargetEntity; //0xC
	int archiveTime; //0x10
	unsigned short scriptPersId; //0x14
	clientConnected_t connected; //0x18
	usercmd_s cmd; //0x1C
	usercmd_s oldcmd; // 0x58
	int localClient; //0x94 not sure
	int predictItemPickup; //0x98 not sure
	char newnetname[0x20]; //0x9C
	int maxHealth; //0xBC
	int enterTime; //0xC0 not sure
	playerTeamState_t teamState; //0xC4 not sure
	int voteCount; //0xC8 not sure
	int teamVoteCount; //0xCC not sure
	float moveSpeedScaleMultiplier; //0xD0
	int viewmodelIndex; //0xD4
	int noSpectate; //0xD8 not sure
	int teamInfo; //0xDC not sure
	clientState_s cs; //0xE0
	int psOffsetTime; //0x200
	int scoreboardColumnCache[26];
};	// 0x26C
 
struct viewClamp
{
  vec2_t start;
  vec2_t current;
  vec2_t goal;
};
 
struct viewClampState
{
  viewClamp min;
  viewClamp max;
  float accelTime;
  float decelTime;
  float totalTime;
  float startTime;
};
 
struct gclient_s
{
	playerState_s ps; //0x0
	playerState_s lastPlayerPS;
	clientSession_t sess; //0x5420
		char unk1[4]; //0x568C padding?
	int spectatorClient; //0x5690
	int flags; //0x5694
	int lastCmdTime; //0x5698
	button_t button_bits; //0x569C
	button_t oldbutton_bits; //0x56A4
	button_t latched_button_bits; //0x56AC
	button_t button_bitsSinceLastFrame; //0x56B4
	float fGunPitch; //0x56BC
	float fGunYaw; //0x56C0
	int damage_blood; //0x56C4
	float damage_from[3]; //0x56C8
	int damage_fromWorld; //0x56D4
	int inactivityTime; //0x56D8
	int inactivityWarning; //0x56DC
	int lastVoiceTime; //0x56E0
	int outWaterTime; //0x56E4
	int switchSeatTime; //0x56E8
	float currentAimSpreadScale; //0x56EC
	int dropWeaponTime; //0x56F0
	EntHandle pLookatEnt; //0x56F4
	vec4_t prevLinkedInvQuat; //0x56F8
	bool prevLinkAnglesSet; //0x5708
	bool link_doCollision; //0x5709
	bool link_useTagAnglesForViewAngles; //0x570A
	bool link_useBaseAnglesForViewClamp; //0x570B
	float linkAnglesFrac; //0x570C
	ViewClampState link_viewClamp;
	EntHandle useHoldEntity;
	int useButtonDone; //0x5758
	int iLastCompassPlayerInfoEnt; //0x575C
	int compassPingTime; //0x5760
	int damageTime; // 0x5764
	float v_dmg_roll; // 0x5768
	float v_dmg_pitch; // 0x576C
	vec3_t swayViewAngles; // 0x5770
	vec3_t swayOffset; // 0x577C
	vec3_t swayAngles; // 0x5788
	vec3_t baseAngles; // 0x5794
	vec3_t baseOrigin; // 0x57A0
	vec3_t recoilAngles; // 0x57AC
	float fLastIdleFactor; // 0x57B8
	int weaponIdleTime; // 0x57BC
	vec3_t recoilSpeed; // 0x57C0
	int previousRecoilTime; // 0x57CC
	float previousRecoilRatio; // 0x57D0
	int lastServerTime; // 0x57D4
	int lastSpawnTime; // 0x57D8
	int lastWeapon; // 0x57DC
	bool previouslyFiring; // 0x57E0
	bool previouslyUsingNightVision; // 0x57E1
	bool previouslyDTP; // 0x57E2
	bool previouslyBeganWeaponRaise; // 0x57E3
	bool previouslySprinting; // 0x57E4
	int hasSpyplane; //0x57E8
	int hasSatellite; //0x57EC
	int revive; //0x57F0
	int reviveTime; // 0x57F4
	int disallowVehicleUsage; // 0x57F8
	unsigned short attachShieldTagName; // 0x57FC
	int lastStand; //0x5800
	int lastStandTime; //0x5804
};