VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
HiddenPlayer.hpp
Go to the documentation of this file.
1#pragma once
2
7#include <string>
8
9namespace VoltMod
10{
11
12/**
13 * @brief A player turned into a nameless spectator nobody else sees, who sees every player through walls.
14 *
15 * @ref Show, or destroying this, gives back the name and the team; a team picked meanwhile wins.
16 * Call @ref UpdateGlow every @ref GlowVision::RefreshIntervalMs.
17 */
19{
20public:
21 /** Hides @p slot now. Both services must outlive this. */
22 HiddenPlayer(EntitySystem& entities, Visibility& visibility, int slot);
24 HiddenPlayer(const HiddenPlayer&) = delete;
26
27 /** Rebuilds the glow across rounds, spawns and deaths. */
28 void UpdateGlow();
29
30 /** Shows the player again; later calls do nothing. */
31 void Show();
32
33private:
34 EntitySystem& _entities;
35 Visibility& _visibility;
36 int _slot;
37 Team _team = Team::None;
38 std::string _name;
39 GlowVision _glow;
40 bool _hidden = true;
41};
42
43} // namespace VoltMod
runtime.Entities: finds and creates entities. Everything it returns is valid for this frame only; see...
Players as team-colored outlines through walls, for one client or one team alone.
HiddenPlayer & operator=(const HiddenPlayer &)=delete
HiddenPlayer(const HiddenPlayer &)=delete
HiddenPlayer(EntitySystem &entities, Visibility &visibility, int slot)
Which clients receive which entities, filtered after CheckTransmit.