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

55 lines
2.1 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();
2022-08-15 06:03:10 -04:00
static void SV_ClearMutedList();
static void SV_MuteClient(int muteClientIndex);
static void SV_UnmuteClient(int muteClientIndex);
2022-08-13 11:19:45 -04:00
private:
static constexpr auto MAX_VOICE_PACKET_DATA = 256;
static constexpr auto MAX_SERVER_QUEUED_VOICE_PACKETS = 40;
2022-08-15 06:03:10 -04:00
static Game::VoicePacket_t VoicePackets[Game::MAX_CLIENTS][MAX_SERVER_QUEUED_VOICE_PACKETS];
static int VoicePacketCount[Game::MAX_CLIENTS];
2022-08-13 11:19:45 -04:00
2022-08-15 06:03:10 -04:00
static bool MuteList[Game::MAX_CLIENTS];
static bool S_PlayerMute[Game::MAX_CLIENTS];
2022-08-13 12:42:32 -04:00
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-15 06:03:10 -04:00
static bool SV_ServerHasClientMuted(int talker);
2022-08-14 11:15:45 -04:00
static bool OnSameTeam(const Game::gentity_s* ent1, const Game::gentity_s* ent2);
2022-08-15 06:03:10 -04:00
static void SV_QueueVoicePacket(int talkerNum, int clientNum, const Game::VoicePacket_t* voicePacket);
static void G_BroadcastVoice(Game::gentity_s* talker, const Game::VoicePacket_t* voicePacket);
2022-08-13 11:19:45 -04:00
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
};
}