12#include <unordered_map>
107 std::span<Player* const>
All()
const {
return _ordered; }
117 Player*
Add(
int slot, int64_t steamId, std::string name, std::string ip);
126 void IndexBySteamId(
Player* player);
127 void UnindexBySteamId(
const Player* player);
137 std::unordered_map<int, std::unique_ptr<Player>> _playersBySlot;
138 std::unordered_map<int64_t, Player*> _playersBySteamId;
139 std::vector<Player*> _ordered;
runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see...
A multicast signal with a fixed handler signature: the one way to subscribe in VoltMod.
Event< Player & > FullyConnected
A player finished connecting (post ClientFullyConnect) - the first point their name and replicated co...
void OnClientFullyConnected(int slot)
Event< ChatMessage & > Said
A player said something in chat that no menu or command took.
Player * Add(int slot, int64_t steamId, std::string name, std::string ip)
std::span< Player *const > All() const
void OnClientSettingsChanged(int slot)
Event< Player & > Disconnected
A player is leaving. Raised while they are still in the roster, so the handler can read their identit...
PlayerManager(const PlayerManager &)=delete
PlayerManager(SlotEvents &slots, EntitySystem *entities)
Player * BySteamId(int64_t steamId)
PlayerManager & operator=(const PlayerManager &)=delete
Event< Player & > SettingsChanged
A player changed a replicated setting (name, userinfo cvars). Fires on every change,...
Event< Player & > Connected
A player joined and is now in the roster. Their name is not meaningful yet - FullyConnected is the fi...
Event< ConnectRequest & > Connecting
A player is asking to join, before the engine admits them and before they are in the roster....
PlayerRef GetRef(int slot)
One connected player, owned by PlayerManager for the length of the connection.
"The occupant of this slot changed" - raised by PlayerManager, consumed below it.
A storable reference to a player: the slot plus the SteamID that occupied it.