iw4x-client/src/Components/Modules/Voice.hpp

48 lines
1.9 KiB
C++
Raw Normal View History

2022-08-13 11:19:45 -04:00
#pragma once
namespace Components
{
class Voice : public Component
{
public:
Voice();
static bool SV_VoiceEnabled();
private:
static constexpr auto MAX_VOICE_PACKET_DATA = 256;
static constexpr auto MAX_SERVER_QUEUED_VOICE_PACKETS = 40;
static Game::VoicePacket_t voicePackets[Game::MAX_CLIENTS][MAX_SERVER_QUEUED_VOICE_PACKETS];
static int voicePacketCount[Game::MAX_CLIENTS];
2022-08-13 12:42:32 -04:00
static bool s_playerMute[Game::MAX_CLIENTS];
2022-08-13 11:19:45 -04:00
static const Game::dvar_t* sv_voice;
static void SV_WriteVoiceDataToClient(int clientNum, Game::msg_t* msg);
static void SV_SendClientVoiceData(Game::client_t* client);
static void SV_SendClientMessages_Stub(Game::client_t* client, Game::msg_t* msg, unsigned char* snapshotMsgBuf);
2022-08-14 11:15:45 -04:00
static bool OnSameTeam(const Game::gentity_s* ent1, const Game::gentity_s* ent2);
2022-08-13 11:19:45 -04:00
static void SV_QueueVoicePacket(int talkerNum, int clientNum, Game::VoicePacket_t* voicePacket);
static void G_BroadcastVoice(Game::gentity_s* talker, Game::VoicePacket_t* voicePacket);
static void SV_UserVoice(Game::client_t* cl, Game::msg_t* msg);
2022-08-13 13:10:37 -04:00
static void SV_PreGameUserVoice(Game::client_t* cl, Game::msg_t* msg);
2022-08-13 11:19:45 -04:00
static void SV_VoicePacket(Game::netadr_t from, Game::msg_t* msg);
2022-08-14 07:33:28 -04:00
static void CL_ClearMutedList();
2022-08-14 11:15:45 -04:00
static bool CL_IsPlayerTalking_Hk(Game::SessionData* session, int localClientNum, int talkingClientIndex);
2022-08-13 12:42:32 -04:00
static bool CL_IsPlayerMuted_Hk(Game::SessionData* session, int localClientNum, int muteClientIndex);
2022-08-13 13:10:37 -04:00
static void CL_MutePlayer_Hk(Game::SessionData* session, int muteClientIndex);
2022-08-13 12:42:32 -04:00
static void Voice_UnmuteMember_Hk(Game::SessionData* session, int clientNum);
static void CL_TogglePlayerMute(int localClientNum, int muteClientIndex);
2022-08-13 11:19:45 -04:00
static void CL_WriteVoicePacket_Hk(int localClientNum);
static void CL_VoicePacket_Hk(int localClientNum, Game::msg_t* msg);
2022-08-13 12:42:32 -04:00
static void UI_Mute_player(int clientNum, int localClientNum);
static void UI_Mute_Player_Stub();
2022-08-13 11:19:45 -04:00
};
}