50 std::function<bool(int64_t steamId, std::string_view permission)>
HasPermission;
59 std::function<bool(int64_t callerSteamId, int64_t targetSteamId)>
CanTarget;
63 std::function<void(
int slot, std::string_view message)>
Reply;
104 Status CheckPermission(
const Player& caller, std::string_view permission)
const;
109 Status CheckImmunity(
const Player& caller, int64_t targetSteamId)
const;
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.
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.
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.