VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
VoltMod::Visibility Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Visibility() [1/2]

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().

◆ Visibility() [2/2]

VoltMod::Visibility::Visibility ( const Visibility &  )
delete

Member Function Documentation

◆ Available()

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().

◆ CreateGlow() [1/2]

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().

◆ CreateGlow() [2/2]

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().

◆ HideFromTeam()

void VoltMod::Visibility::HideFromTeam ( EntityRef  entity,
Team  team 
)

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().

◆ IsPawnHidden()

bool VoltMod::Visibility::IsPawnHidden ( int  slot) const

Definition at line 130 of file Visibility.cpp.

References VoltMod::IsValidSlot(), and VoltMod::ReadFile().

Referenced by VoltMod::GlowVision::Refresh().

◆ OnCheckTransmit()

◆ operator=()

Visibility & VoltMod::Visibility::operator= ( const Visibility &  )
delete

◆ SetControllerHidden()

void VoltMod::Visibility::SetControllerHidden ( int  slot,
bool  hidden 
)

Hide or show slot's controller from every other client.

Definition at line 122 of file Visibility.cpp.

References VoltMod::IsValidSlot(), and VoltMod::ReadFile().

◆ SetPawnHidden()

void VoltMod::Visibility::SetPawnHidden ( int  slot,
bool  hidden 
)

Hide or show slot's pawn from every other client.

Definition at line 114 of file Visibility.cpp.

References VoltMod::IsValidSlot(), and VoltMod::ReadFile().

◆ ShowOnlyTo()

void VoltMod::Visibility::ShowOnlyTo ( EntityRef  entity,
int  slot 
)

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().

◆ ShowOnlyToTeam()

void VoltMod::Visibility::ShowOnlyToTeam ( EntityRef  entity,
Team  team 
)

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().

◆ ShowToEveryone()

void VoltMod::Visibility::ShowToEveryone ( EntityRef  entity)

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().


The documentation for this class was generated from the following files: