|
VoltMod
C++23 framework for CS2 server plugins
|
Which clients receive which entities, filtered after CheckTransmit. More...
#include <Visibility.hpp>
Public Member Functions | |
| Visibility (EntitySystem &entities, const Bindings &bindings, SlotEvents &slots) | |
| Visibility (const Visibility &)=delete | |
| Visibility & | operator= (const Visibility &)=delete |
| void | SetPawnHidden (int slot, bool hidden) |
| void | SetControllerHidden (int slot, bool hidden) |
| bool | IsPawnHidden (int slot) const |
| void | ShowOnlyTo (EntityRef entity, int slot) |
| void | ShowOnlyToTeam (EntityRef entity, Team team) |
| void | HideFromTeam (EntityRef entity, Team team) |
| void | ShowToEveryone (EntityRef entity) |
| std::shared_ptr< GlowVision > | CreateGlow (int viewerSlot, GlowConfig config={}) |
| std::shared_ptr< GlowVision > | CreateGlow (Team viewerTeam, GlowConfig config={}) |
| void | OnCheckTransmit (CCheckTransmitInfo **infoList, int infoCount) |
| Status | Available () const |
Which clients receive which entities, filtered after CheckTransmit.
A hidden pawn takes its weapons, wearables and shadow with it but stays visible to whoever spectates it; a hidden controller loses its scoreboard row and chat attribution. Sounds are networked separately and are unaffected.
Definition at line 37 of file Visibility.hpp.
| VoltMod::Visibility::Visibility | ( | EntitySystem & | entities, |
| const Bindings & | bindings, | ||
| SlotEvents & | slots | ||
| ) |
slots resets a slot's hiding when it changes hands. All three must outlive this.
Definition at line 101 of file Visibility.cpp.
References VoltMod::IsValidSlot(), and VoltMod::ReadFile().
|
delete |
| Status VoltMod::Visibility::Available | ( | ) | const |
An error when the CheckTransmitPlayerSlot offset did not bind; every call is then inert.
Definition at line 135 of file Visibility.cpp.
References VoltMod::Error::Unsupported(), and VoltMod::Bindings::VisibilityRecipientSlot.
Referenced by VoltMod::ScreenManager::Available(), and VoltMod::ScreenManager::ForPlayer().
| std::shared_ptr< GlowVision > VoltMod::Visibility::CreateGlow | ( | int | viewerSlot, |
| GlowConfig | config = {} |
||
| ) |
A GlowVision for viewerSlot alone; its clones go with the last owner.
Definition at line 192 of file Visibility.cpp.
References VoltMod::ReadFile().
| std::shared_ptr< GlowVision > VoltMod::Visibility::CreateGlow | ( | Team | viewerTeam, |
| GlowConfig | config = {} |
||
| ) |
A GlowVision the whole of viewerTeam shares.
Definition at line 197 of file Visibility.cpp.
References VoltMod::ReadFile().
Keep entity from every client on team. Calling again moves it.
Definition at line 164 of file Visibility.cpp.
References VoltMod::IsPlaying(), and VoltMod::ReadFile().
Definition at line 130 of file Visibility.cpp.
References VoltMod::IsValidSlot(), and VoltMod::ReadFile().
Referenced by VoltMod::GlowVision::Refresh().
| void VoltMod::Visibility::OnCheckTransmit | ( | CCheckTransmitInfo ** | infoList, |
| int | infoCount | ||
| ) |
Definition at line 215 of file Visibility.cpp.
References VoltMod::CollectHiddenPlayer(), VoltMod::EntitySystem::Controller(), VoltMod::EntitySystem::Get(), VoltMod::Entity::Index(), VoltMod::MaxPlayers, VoltMod::ObserverTarget(), VoltMod::Offset< T >::Read(), VoltMod::ReadFile(), and VoltMod::Bindings::VisibilityRecipientSlot.
|
delete |
Hide or show slot's controller from every other client.
Definition at line 122 of file Visibility.cpp.
References VoltMod::IsValidSlot(), and VoltMod::ReadFile().
Hide or show slot's pawn from every other client.
Definition at line 114 of file Visibility.cpp.
References VoltMod::IsValidSlot(), and VoltMod::ReadFile().
Network entity to slot alone. Calling again moves it to another slot.
Definition at line 144 of file Visibility.cpp.
References VoltMod::IsValidSlot(), and VoltMod::ReadFile().
Network entity to team alone, spectators excluded. Calling again moves it.
Definition at line 154 of file Visibility.cpp.
References VoltMod::IsPlaying(), and VoltMod::ReadFile().
Undo the calls above; a removed entity needs no call.
Definition at line 187 of file Visibility.cpp.
References VoltMod::ReadFile().
Referenced by VoltMod::ScreenEntity::Remove().