|
VoltMod
C++23 framework for CS2 server plugins
|
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 |
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.
| using VoltMod::Movement::Connector = std::function<Subscription(Movement&)> |
Subscribes a Movement to the host's commands; dropping the result unsubscribes.
Definition at line 26 of file Movement.hpp.
bindings must outlive this; connect runs when the first handler arrives.
Definition at line 7 of file Movement.cpp.
| void VoltMod::Movement::AfterCommand | ( | int | slot, |
| const PlayerInput & | input | ||
| ) |
Definition at line 52 of file Movement.cpp.
References After, and VoltMod::ReadFile().
| 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::Bindings::RunCommand, VoltMod::Error::Unsupported(), and VoltMod::Bindings::UserCmdProto.
| void VoltMod::Movement::BeforeCommand | ( | int | slot, |
| const PlayerInput & | input | ||
| ) |
Definition at line 38 of file Movement.cpp.
References Before, VoltMod::ReadFile(), and Rewrite.
| Event<int, const PlayerInput&> VoltMod::Movement::After |
Definition at line 41 of file Movement.hpp.
Referenced by AfterCommand().
| Event<int, const PlayerInput&> VoltMod::Movement::Before |
Definition at line 40 of file Movement.hpp.
Referenced by BeforeCommand().
| 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().