114 mutable bool _missingPermissionWarned =
false;
The roster: every connected player, and the signals for the connection lifecycle.
One connected player, owned by PlayerManager for the length of the connection.
The one permission and targeting gate, plus the plugin's reply callback.
Status AuthorizeSteamId(PlayerRef caller, int64_t targetSteamId, std::string_view permission) const
Authorize for a target that may be offline, addressed by SteamID.
Policy & operator=(const Policy &)=delete
std::function< bool(int64_t steamId, std::string_view permission)> HasPermission
Policy(PlayerManager &players)
std::function< bool(int64_t callerSteamId, int64_t targetSteamId)> CanTarget
Policy(const Policy &)=delete
std::function< void(int slot, std::string_view message)> Reply
Result< Authorized > Authorize(PlayerRef caller, std::optional< PlayerRef > target, std::string_view permission) const
The single gate. Commands, target resolution and menu rows call exactly this.
static std::string ReadFile(const std::filesystem::path &path)
std::expected< void, Error > Status
std::expected< T, Error > Result
A caller/target pair that cleared Policy::Authorize.
A storable reference to a player: the slot plus the SteamID that occupied it.