VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
SlotEvents.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace VoltMod
6{
7
8/**
9 * @brief "The occupant of this slot changed" - raised by PlayerManager, consumed below it.
10 *
11 * Lives in Core, not Players, so engine-level services can drop per-slot state without
12 * depending on the player roster: Hooks sits under Players, and Teleport only ever needed
13 * the signal, never the Player objects.
14 *
15 * Fires on AddPlayer, RemovePlayer, and once per tracked slot on Clear.
16 */
18{
19public:
20 /** `runtime.Slots.Changed += [](int slot) { ... };` */
22
23 /** The slot's client finished loading. The game resets what it keeps per player controller
24 * then, such as a custom HUD's per-player classes and text. */
26
27 /** Notify every handler that @p slot changed hands. PlayerManager's to call. */
28 void Raise(int slot) { Changed.Raise(slot); }
29};
30
31} // namespace VoltMod
A multicast signal with a fixed handler signature: the one way to subscribe in VoltMod.
Definition Event.hpp:54
void Raise(Args... args)
Definition Event.hpp:98
"The occupant of this slot changed" - raised by PlayerManager, consumed below it.
Event< int > FullyConnected
Event< int > Changed
void Raise(int slot)
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56