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
3
#include <
VoltMod/Core/Signals/Event.hpp
>
4
5
namespace
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
*/
17
class
SlotEvents
18
{
19
public
:
20
/** `runtime.Slots.Changed += [](int slot) { ... };` */
21
Event<int>
Changed
;
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. */
25
Event<int>
FullyConnected
;
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
Event.hpp
VoltMod::Event
A multicast signal with a fixed handler signature: the one way to subscribe in VoltMod.
Definition
Event.hpp:54
VoltMod::Event::Raise
void Raise(Args... args)
Definition
Event.hpp:98
VoltMod::SlotEvents
"The occupant of this slot changed" - raised by PlayerManager, consumed below it.
Definition
SlotEvents.hpp:18
VoltMod::SlotEvents::FullyConnected
Event< int > FullyConnected
Definition
SlotEvents.hpp:25
VoltMod::SlotEvents::Changed
Event< int > Changed
Definition
SlotEvents.hpp:21
VoltMod::SlotEvents::Raise
void Raise(int slot)
Definition
SlotEvents.hpp:28
VoltMod
Definition
Options.hpp:13
VoltMod::ReadFile
static std::string ReadFile(const std::filesystem::path &path)
Definition
Loader.cpp:56
include
VoltMod
Core
Slots
SlotEvents.hpp
Generated by
1.9.8