VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::PlayerInput Struct Reference

Protobuf-free snapshot of the CUserCmd handed to CPlayer_MovementServices::RunCommand, decoded once per command by Movement. More...

#include <PlayerInput.hpp>

Public Member Functions

std::span< const SubtickMove > Subticks () const
std::span< const InputHistorySample > InputHistory () const
std::optional< InputHistorySample > SampleAt (int index) const

Public Attributes

bool Valid = false
int32_t ClientTick = 0
int32_t CommandNumber = 0
bool HasViewAngles = false
float ViewPitch = 0.0f
float ViewYaw = 0.0f
float ViewRoll = 0.0f
float ForwardMove = 0.0f
float LeftMove = 0.0f
uint64_t ButtonsHeld = 0
uint64_t ButtonsChanged = 0
int32_t MouseDx = 0
int32_t MouseDy = 0
int32_t Attack1StartHistoryIndex = -1
int32_t Attack2StartHistoryIndex = -1
int SubtickMoveCount = 0
std::array< SubtickMove, MaxSubtickMoves > SubtickMoves {}
int InputHistoryCount = 0
int InputHistorySent = 0
std::array< InputHistorySample, MaxInputHistory > InputHistorySamples {}

Static Public Attributes

static constexpr int MaxSubtickMoves = 12
static constexpr int MaxInputHistory = 16

Detailed Description

Protobuf-free snapshot of the CUserCmd handed to CPlayer_MovementServices::RunCommand, decoded once per command by Movement.

Valid is false when the usercmd pointer was null or the "CUserCmd::CSGOUserCmdPB" gamedata offset is missing - fields then hold their defaults and must not be trusted.

Definition at line 41 of file PlayerInput.hpp.

Member Function Documentation

◆ InputHistory()

std::span< const InputHistorySample > VoltMod::PlayerInput::InputHistory ( ) const
inline

The decoded fired-view samples.

Definition at line 94 of file PlayerInput.hpp.

References InputHistoryCount, and InputHistorySamples.

◆ SampleAt()

std::optional< InputHistorySample > VoltMod::PlayerInput::SampleAt ( int index) const
inline

The decoded entry at index, or nullopt when index is negative or was capped away.

Definition at line 100 of file PlayerInput.hpp.

References InputHistoryCount, and InputHistorySamples.

◆ Subticks()

std::span< const SubtickMove > VoltMod::PlayerInput::Subticks ( ) const
inline

The decoded sub-tick steps.

Definition at line 88 of file PlayerInput.hpp.

References SubtickMoveCount, and SubtickMoves.

Member Data Documentation

◆ Attack1StartHistoryIndex

int32_t VoltMod::PlayerInput::Attack1StartHistoryIndex = -1

Definition at line 71 of file PlayerInput.hpp.

◆ Attack2StartHistoryIndex

int32_t VoltMod::PlayerInput::Attack2StartHistoryIndex = -1

Definition at line 72 of file PlayerInput.hpp.

◆ ButtonsChanged

uint64_t VoltMod::PlayerInput::ButtonsChanged = 0

Definition at line 64 of file PlayerInput.hpp.

◆ ButtonsHeld

uint64_t VoltMod::PlayerInput::ButtonsHeld = 0

Definition at line 63 of file PlayerInput.hpp.

◆ ClientTick

int32_t VoltMod::PlayerInput::ClientTick = 0

Definition at line 44 of file PlayerInput.hpp.

◆ CommandNumber

int32_t VoltMod::PlayerInput::CommandNumber = 0

Definition at line 48 of file PlayerInput.hpp.

◆ ForwardMove

float VoltMod::PlayerInput::ForwardMove = 0.0f

Definition at line 59 of file PlayerInput.hpp.

◆ HasViewAngles

bool VoltMod::PlayerInput::HasViewAngles = false

False when the client omitted viewangles: the three fields below then hold defaults rather than a reading, so treat the angles as untrusted.

Definition at line 52 of file PlayerInput.hpp.

◆ InputHistoryCount

int VoltMod::PlayerInput::InputHistoryCount = 0

Definition at line 81 of file PlayerInput.hpp.

Referenced by InputHistory(), and SampleAt().

◆ InputHistorySamples

std::array<InputHistorySample, MaxInputHistory> VoltMod::PlayerInput::InputHistorySamples {}

Definition at line 85 of file PlayerInput.hpp.

Referenced by InputHistory(), and SampleAt().

◆ InputHistorySent

int VoltMod::PlayerInput::InputHistorySent = 0

Entries the client actually sent, before the MaxInputHistory cap. Greater than InputHistoryCount means the tail was capped away.

Definition at line 84 of file PlayerInput.hpp.

◆ LeftMove

float VoltMod::PlayerInput::LeftMove = 0.0f

Definition at line 60 of file PlayerInput.hpp.

◆ MaxInputHistory

int VoltMod::PlayerInput::MaxInputHistory = 16
staticconstexpr

Definition at line 80 of file PlayerInput.hpp.

◆ MaxSubtickMoves

int VoltMod::PlayerInput::MaxSubtickMoves = 12
staticconstexpr

Definition at line 74 of file PlayerInput.hpp.

◆ MouseDx

int32_t VoltMod::PlayerInput::MouseDx = 0

Definition at line 67 of file PlayerInput.hpp.

◆ MouseDy

int32_t VoltMod::PlayerInput::MouseDy = 0

Definition at line 68 of file PlayerInput.hpp.

◆ SubtickMoveCount

int VoltMod::PlayerInput::SubtickMoveCount = 0

Definition at line 75 of file PlayerInput.hpp.

Referenced by Subticks().

◆ SubtickMoves

std::array<SubtickMove, MaxSubtickMoves> VoltMod::PlayerInput::SubtickMoves {}

Definition at line 76 of file PlayerInput.hpp.

Referenced by Subticks().

◆ Valid

bool VoltMod::PlayerInput::Valid = false

Definition at line 43 of file PlayerInput.hpp.

◆ ViewPitch

float VoltMod::PlayerInput::ViewPitch = 0.0f

Definition at line 55 of file PlayerInput.hpp.

◆ ViewRoll

float VoltMod::PlayerInput::ViewRoll = 0.0f

Definition at line 57 of file PlayerInput.hpp.

◆ ViewYaw

float VoltMod::PlayerInput::ViewYaw = 0.0f

Definition at line 56 of file PlayerInput.hpp.


The documentation for this struct was generated from the following file: