|
VoltMod
C++23 framework for CS2 server plugins
|
A player's identity behind a slot: name, money, team, scoreboard row. It survives death and respawn; the body is Pawn(). Its own CBaseEntity fields, such as Health, mean nothing for gameplay. More...
#include <Controller.hpp>
Inheritance diagram for VoltMod::Controller:Additional Inherited Members | |
Protected Attributes inherited from VoltMod::Entity | |
| EntitySystem * | _sys = nullptr |
| CEntityInstance * | _e = nullptr |
A player's identity behind a slot: name, money, team, scoreboard row. It survives death and respawn; the body is Pawn(). Its own CBaseEntity fields, such as Health, mean nothing for gameplay.
Definition at line 19 of file Controller.hpp.
|
default |
Referenced by VoltMod::CollectHiddenPlayer().
| VoltMod::Controller::Controller | ( | EntitySystem & | entities, |
| CEntityInstance * | raw, | ||
| int | slot | ||
| ) |
Prefer runtime.Entities.Controller(slot).
Definition at line 20 of file Controller.cpp.
References VoltMod::ReadFile().
|
default |
| uint64_t VoltMod::Controller::Buttons | ( | ) | const |
Held buttons as IN_* bits, read from InputPawn so they arrive while dead too.
Definition at line 35 of file Controller.cpp.
References InputPawn(), and VoltMod::ReadFile().
| void VoltMod::Controller::ChangeTeam | ( | VoltMod::Team | team | ) | const |
Does nothing for a team outside Spectator..CT or when the vtable slot did not bind.
Definition at line 109 of file Controller.cpp.
References VoltMod::Entity::_e, VoltMod::Entity::_sys, VoltMod::EntitySystem::Bindings(), VoltMod::Bindings::ChangeTeam, VoltMod::IsPlaying(), VoltMod::ReadFile(), and VoltMod::Spectator.
| void VoltMod::Controller::ExecuteCommand | ( | std::string_view | command | ) | const |
Run one console command as this player, server-side and without a chat echo; plugins hooking ISource2GameClients::ClientCommand see it. Refuses and logs ; and newlines.
Definition at line 78 of file Controller.cpp.
References VoltMod::Entity::_e, VoltMod::Entity::_sys, VoltMod::Interfaces::CVar, VoltMod::EntitySystem::Interfaces(), VoltMod::IsValidSlot(), VoltMod::ReadFile(), VoltMod::Interfaces::ServerGameClients, VoltMod::TokenizeOneCommand(), and VoltMod::Log::Warn().
| VoltMod::Pawn VoltMod::Controller::InputPawn | ( | ) | const |
The pawn the player's input drives: Pawn while alive, the observer pawn while dead or spectating.
Definition at line 30 of file Controller.cpp.
References VoltMod::Entity::_sys, VoltMod::EntitySystem::Get(), and VoltMod::Entity::Raw().
Referenced by Buttons(), and VoltMod::ObserverTarget().
| void VoltMod::Controller::Kick | ( | std::string_view | reason | ) | const |
Definition at line 57 of file Controller.cpp.
References VoltMod::Entity::_e, VoltMod::Entity::_sys, VoltMod::Interfaces::Engine, VoltMod::EntitySystem::Interfaces(), and VoltMod::ReadFile().
| int VoltMod::Controller::Money | ( | ) | const |
The buy-menu balance; 0 when unavailable.
Definition at line 42 of file Controller.cpp.
References VoltMod::ReadFile().
|
delete |
| VoltMod::Pawn VoltMod::Controller::Pawn | ( | ) | const |
The living body; falsy while dead.
Definition at line 25 of file Controller.cpp.
References VoltMod::Entity::_sys.
Referenced by VoltMod::EntitySystem::Pawn().
| Status VoltMod::Controller::Respawn | ( | ) | const |
Definition at line 118 of file Controller.cpp.
References VoltMod::Entity::_e, VoltMod::Entity::_sys, VoltMod::EntitySystem::Bindings(), VoltMod::Error::NotReady(), VoltMod::ReadFile(), VoltMod::Bindings::Respawn, and VoltMod::Error::Unsupported().
Does nothing when the money services are unavailable.
Definition at line 48 of file Controller.cpp.
References VoltMod::ReadFile().
|
inlinenoexcept |
The slot, or -1.
Definition at line 37 of file Controller.hpp.