VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
PlayerCommands.hpp
Go to the documentation of this file.
1#pragma once
2
4
9
10namespace VoltMod
11{
12
13/**
14 * @brief The RunCommand hook for every plugin: each command is decoded once, and only while a
15 * plugin listens. Game thread only.
16 */
18{
19public:
20 /** @p bindings and @p registry must outlive this. */
21 PlayerCommands(const Bindings& bindings, PluginRegistry& registry);
22
25
26private:
27 Status Install();
28 void Before(void* movementServices, const void* userCmd);
29 void After();
30 void Decode(const void* userCmd);
31
32 PluginRegistry& _registry;
33 const Bindings& _bindings;
34 PlayerInput _input; ///< decoded before RunCommand, raised again after it
35 int _slot = -1; ///< -1 when nothing was decoded; RunCommand does not nest
36 Subscription _hook;
37};
38
39} // namespace VoltMod
PlayerCommands(const Bindings &bindings, PluginRegistry &registry)
PlayerCommands & operator=(const PlayerCommands &)=delete
PlayerCommands(const PlayerCommands &)=delete
The loaded plugins and the engine events raised on them, one per process.
Owns one registration and releases it on destruction.
std::expected< void, Error > Status
Definition Result.hpp:67
Protobuf-free snapshot of the CUserCmd handed to CPlayer_MovementServices::RunCommand,...