|
VoltMod
C++23 framework for CS2 server plugins
|
A storable reference to a player: the slot plus the SteamID that occupied it. More...
#include <PlayerRef.hpp>
Public Member Functions | |
| operator bool () const noexcept | |
| bool | operator== (const PlayerRef &) const noexcept=default |
Public Attributes | |
| int | Slot = -1 |
| int64_t | SteamId = 0 |
A storable reference to a player: the slot plus the SteamID that occupied it.
Controller and Pawn are frame-local, and a bare slot number is not enough on its own - a slot changes hands, so work scheduled against one can land on whoever sits there next. Keep a PlayerRef instead and check both halves when it is resolved: the slot says where to look and the SteamID says whether it is still the same player.
SteamId == 0 means a bot, which no reference can pin down across a reconnect.
Definition at line 18 of file PlayerRef.hpp.
|
inlineexplicitnoexcept |
Definition at line 23 of file PlayerRef.hpp.
References Slot.
| int VoltMod::PlayerRef::Slot = -1 |
Definition at line 20 of file PlayerRef.hpp.
Referenced by operator bool(), and VoltMod::Player::Ref().
| int64_t VoltMod::PlayerRef::SteamId = 0 |
Definition at line 21 of file PlayerRef.hpp.