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

Each player's command from CCSPlayer_MovementServices::RunCommand. More...

#include <Movement.hpp>

Public Types

using Connector = std::function<Subscription(Movement&)>

Public Member Functions

 Movement (const Bindings &bindings, Connector connect)
 Movement (const Movement &)=delete
Movement & operator= (const Movement &)=delete
Status Available () const
void BeforeCommand (int slot, const PlayerInput &input)
void AfterCommand (int slot, const PlayerInput &input)

Public Attributes

Event< int, PlayerInput & > Rewrite
Event< int, const PlayerInput & > Before
Event< int, const PlayerInput & > After

Detailed Description

Each player's command from CCSPlayer_MovementServices::RunCommand.

The host hooks RunCommand once for every plugin and decodes each command once; this service listens to it while one of its events has a handler. PlayerInput::Valid is false when the usercmd payload was missing.

Definition at line 22 of file Movement.hpp.

Member Typedef Documentation

◆ Connector

Subscribes a Movement to the host's commands; dropping the result unsubscribes.

Definition at line 26 of file Movement.hpp.

Constructor & Destructor Documentation

◆ Movement() [1/2]

VoltMod::Movement::Movement ( const Bindings & bindings,
Connector connect )

bindings must outlive this; connect runs when the first handler arrives.

Definition at line 7 of file Movement.cpp.

Referenced by Movement(), and operator=().

◆ Movement() [2/2]

VoltMod::Movement::Movement ( const Movement & )
delete

References Movement().

Member Function Documentation

◆ AfterCommand()

void VoltMod::Movement::AfterCommand ( int slot,
const PlayerInput & input )

Definition at line 52 of file Movement.cpp.

References After.

◆ Available()

Status VoltMod::Movement::Available ( ) const

Why movement events cannot fire: the RunCommand slot or the usercmd offset did not bind.

Definition at line 25 of file Movement.cpp.

References VoltMod::Error::Unsupported().

◆ BeforeCommand()

void VoltMod::Movement::BeforeCommand ( int slot,
const PlayerInput & input )

Definition at line 38 of file Movement.cpp.

References Before, and Rewrite.

◆ operator=()

Movement & VoltMod::Movement::operator= ( const Movement & )
delete

References Movement().

Member Data Documentation

◆ After

Event<int, const PlayerInput&> VoltMod::Movement::After

Definition at line 41 of file Movement.hpp.

Referenced by AfterCommand().

◆ Before

Event<int, const PlayerInput&> VoltMod::Movement::Before

Definition at line 40 of file Movement.hpp.

Referenced by BeforeCommand().

◆ Rewrite

Event<int, PlayerInput&> VoltMod::Movement::Rewrite

Edit this plugin's copy of the command before Before sees it. The engine's usercmd is unchanged.

Definition at line 39 of file Movement.hpp.

Referenced by BeforeCommand().


The documentation for this class was generated from the following files: