8 : _hook(
"Movement", [this] {
return Install(); }),
9 Rewrite(_hook.MakeLifecycle()),
10 Before(_hook.MakeLifecycle()),
11 After(_hook.MakeLifecycle()),
13 _connect(std::move(connect))
20 return std::unexpected(available.error());
22 return _connect(*
this);
27 if (!_bindings.RunCommand)
29 return std::unexpected(
Error::Unsupported(
"the CPlayer_MovementServices::RunCommand vtable slot did not bind"));
31 if (!_bindings.UserCmdProto)
33 return std::unexpected(
Error::Unsupported(
"the CUserCmd::CSGOUserCmdPB offset did not bind"));
48 Rewrite.Raise(slot, *_rewritten);
49 Before.Raise(slot, *_rewritten);
54 After.Raise(slot, _rewritten ? *_rewritten : input);
Movement(const Bindings &bindings, Connector connect)
Event< int, const PlayerInput & > Before
Event< int, PlayerInput & > Rewrite
void BeforeCommand(int slot, const PlayerInput &input)
Event< int, const PlayerInput & > After
std::function< Subscription(Movement &)> Connector
void AfterCommand(int slot, const PlayerInput &input)
std::expected< void, Error > Status
std::expected< T, Error > Result
static Error Unsupported(std::string detail)