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

Who hears whose voice, decided each time the game opens a voice channel. More...

#include <Voice.hpp>

Public Member Functions

 Voice (Interfaces &interfaces, PlayerManager &players)
 Voice (const Voice &)=delete
Voice & operator= (const Voice &)=delete
Status Available () const
void Refresh (int senderSlot)

Public Attributes

Event< VoiceListen & > Before

Detailed Description

Who hears whose voice, decided each time the game opens a voice channel.

The hook installs on the first subscription. Call Refresh after a decision changes, such as a mute or unmute, so it applies without waiting for the game to set the channel again.

_subs.Add(runtime.Voice.Before += [this](VoltMod::VoiceListen& listen) {
listen.Blocked = IsMuted(listen.Sender);
});

Definition at line 33 of file Voice.hpp.

Constructor & Destructor Documentation

◆ Voice() [1/2]

VoltMod::Voice::Voice ( Interfaces & interfaces,
PlayerManager & players )

interfaces and players must outlive it; the Runtime declares both above.

Definition at line 28 of file Voice.cpp.

Referenced by operator=(), and Voice().

◆ Voice() [2/2]

VoltMod::Voice::Voice ( const Voice & )
delete

References Voice().

Member Function Documentation

◆ Available()

Status VoltMod::Voice::Available ( ) const

Why voice cannot be filtered: IVEngineServer2 is missing.

Definition at line 47 of file Voice.cpp.

References VoltMod::Error::NotReady().

◆ operator=()

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

References Voice().

◆ Refresh()

void VoltMod::Voice::Refresh ( int senderSlot)

Ask again whether each connected player hears senderSlot, so Before decides now.

Definition at line 56 of file Voice.cpp.

References VoltMod::IsValidSlot().

Member Data Documentation

◆ Before

Event<VoiceListen&> VoltMod::Voice::Before

Definition at line 45 of file Voice.hpp.


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