From 29d1dcef2d317779a2e8f184898ecc5682544fac Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Thu, 24 Jul 2025 22:54:43 -0400 Subject: [PATCH] "Deafen" and "Server Voice Chat" now have new variables cv_voice_chat -> cv_voice_selfdeafen & cv_voice_servermute -> cv_voice_allowservervoice --- src/cvars.cpp | 8 ++++---- src/d_clisrv.c | 12 ++++++------ src/d_netcmd.c | 8 ++++---- src/d_netcmd.h | 2 +- src/k_hud.cpp | 4 ++-- src/menus/options-server-1.c | 2 +- src/menus/options-sound.cpp | 4 ++-- src/menus/options-voice.cpp | 4 ++-- src/s_sound.c | 4 ++-- src/s_sound.h | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/cvars.cpp b/src/cvars.cpp index 25ac4e78b..e5236b497 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -1371,7 +1371,7 @@ consvar_t cv_consolechat = Player("chatmode", "Yes").values({{0, "Yes"}, {2, "No // When off, inbound voice packets are ignored void VoiceChat_OnChange(void); -consvar_t cv_voice_chat = Player("voice_chat", "On") +consvar_t cv_voice_selfdeafen = Player("voice_chat", "On") .on_off() .onchange(VoiceChat_OnChange) .description("Whether voice chat is played or not. Shown as self-deafen to others."); @@ -1432,11 +1432,11 @@ consvar_t cv_voice_concurrentattenuation_max = NetVar("voice_concurrentattenuati .description("Maximum concurrent speakers at which full global attenuation is applied"); void Mute_OnChange(void); -void VoiceMute_OnChange(void); +void AllowServerVC_OnChange(void); consvar_t cv_mute = UnsavedNetVar("mute", "Off").on_off().onchange(Mute_OnChange); -consvar_t cv_voice_servermute = NetVar("voice_servermute", "Off") +consvar_t cv_voice_allowservervoice = NetVar("voice_allowservervoice", "Off") .on_off() - .onchange(VoiceMute_OnChange) + .onchange(AllowServerVC_OnChange) .description("If Off, the server will not broadcast voice chat to clients"); diff --git a/src/d_clisrv.c b/src/d_clisrv.c index d60250868..8d0b8196f 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1088,7 +1088,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime) netbuffer->u.serverinfo.kartvars = (UINT8) ( (gamespeed & SV_SPEEDMASK) | (dedicated ? SV_DEDICATED : 0) | - (!cv_voice_servermute.value ? SV_VOICEENABLED : 1) + (!cv_voice_allowservervoice.value ? SV_VOICEENABLED : 1) ); D_ParseCarets(netbuffer->u.serverinfo.servername, cv_servername.string, MAXSERVERNAME); @@ -5275,7 +5275,7 @@ static void PT_HandleVoiceClient(SINT8 node, boolean isserver) { continue; } - if (cv_voice_chat.value != 1 && playernum != g_localplayers[0]) + if (cv_voice_selfdeafen.value != 1 && playernum != g_localplayers[0]) { S_QueueVoiceFrameFromPlayer(playernum, (void*)decoded_out, decoded_samples * sizeof(float), false); } @@ -5289,7 +5289,7 @@ static void PT_HandleVoiceClient(SINT8 node, boolean isserver) return; } - if (cv_voice_chat.value != 1 && playernum != g_localplayers[0]) + if (cv_voice_selfdeafen.value != 1 && playernum != g_localplayers[0]) { S_QueueVoiceFrameFromPlayer(playernum, (void*)decoded_out, decoded_samples * sizeof(float), terminal); } @@ -5306,9 +5306,9 @@ static void PT_HandleVoiceServer(SINT8 node) int playernum = -1; player_t *player; - if (cv_voice_servermute.value != 0) + if (cv_voice_allowservervoice.value != 0) { - // Don't even relay voice packets if voice_servermute is on + // Don't even relay voice packets if voice_allowservervoice is on return; } @@ -7474,7 +7474,7 @@ void NetVoiceUpdate(void) continue; } - if (cv_voice_chat.value == 1) + if (cv_voice_selfdeafen.value == 1) { g_local_voice_buffer_len = 0; continue; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index f6d1b9aa6..c372c62a9 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1224,7 +1224,7 @@ void WeaponPref_Send(UINT8 ssplayer) if (cv_voice_selfmute.value) prefs |= WP_SELFMUTE; - if (!cv_voice_chat.value) + if (!cv_voice_selfdeafen.value) prefs |= WP_SELFDEAFEN; } @@ -7103,13 +7103,13 @@ void Mute_OnChange(void) HU_AddChatText(M_GetText("\x82*Chat is no longer muted."), false); } -void VoiceMute_OnChange(void); -void VoiceMute_OnChange(void) +void AllowServerVC_OnChange(void); +void AllowServerVC_OnChange(void) { if (leveltime <= 1) return; // avoid having this notification put in our console / log when we boot the server. - if (cv_voice_servermute.value) + if (cv_voice_allowservervoice.value) HU_AddChatText(M_GetText("\x82*Voice chat is no longer muted."), false); else HU_AddChatText(M_GetText("\x82*Voice chat has been muted."), false); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 3aa2af849..7ac959ce2 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -62,7 +62,7 @@ extern consvar_t cv_netstat; extern consvar_t cv_countdowntime; extern consvar_t cv_mute; -extern consvar_t cv_voice_servermute; +extern consvar_t cv_voice_allowservervoice; extern consvar_t cv_pause; extern consvar_t cv_restrictskinchange, cv_allowteamchange, cv_maxplayers, cv_shuffleloser; diff --git a/src/k_hud.cpp b/src/k_hud.cpp index 733e0b58f..be03cf02a 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -2967,7 +2967,7 @@ void PositionFacesInfo::draw_1p() } // Voice speaking indicator - if (netgame && !players[rankplayer[i]].bot && cv_voice_servermute.value == 0) + if (netgame && !players[rankplayer[i]].bot && cv_voice_allowservervoice.value == 0) { patch_t *voxmic; if (S_IsPlayerVoiceActive(rankplayer[i])) @@ -8081,7 +8081,7 @@ void K_drawKartHUD(void) } } - if (netgame && cv_voice_servermute.value == 1) + if (netgame && cv_voice_allowservervoice.value == 1) { if (players[consoleplayer].pflags2 & (PF2_SELFMUTE | PF2_SERVERMUTE | PF2_SELFDEAFEN | PF2_SERVERDEAFEN)) { diff --git a/src/menus/options-server-1.c b/src/menus/options-server-1.c index 9d42fcae0..a2b5b1e18 100644 --- a/src/menus/options-server-1.c +++ b/src/menus/options-server-1.c @@ -90,7 +90,7 @@ menuitem_t OPTIONS_Server[] = NULL, {NULL}, 0, 0}, {IT_STRING | IT_CVAR, "Server Voice Chat", "All voice chat will be disabled on your server.", - NULL, {.cvar = &cv_voice_servermute}, 0, 0}, + NULL, {.cvar = &cv_voice_allowservervoice}, 0, 0}, {IT_STRING | IT_CVAR, "Proximity Effects", "Player voices will be adjusted relative to you.", NULL, {.cvar = &cv_voice_proximity}, 0, 0}, diff --git a/src/menus/options-sound.cpp b/src/menus/options-sound.cpp index 22a81ff6b..3d1c29d22 100644 --- a/src/menus/options-sound.cpp +++ b/src/menus/options-sound.cpp @@ -121,7 +121,7 @@ std::array sliders{{ n = !n; CV_SetValue(&cv_gamedigimusic, n); CV_SetValue(&cv_gamesounds, n); - CV_SetValue(&cv_voice_chat, n); + CV_SetValue(&cv_voice_selfdeafen, n); } return n; @@ -157,7 +157,7 @@ std::array sliders{{ { if (toggle) { - CV_AddValue(&cv_voice_chat, 0); + CV_AddValue(&cv_voice_selfdeafen, 0); } return !S_VoiceDisabled(); diff --git a/src/menus/options-voice.cpp b/src/menus/options-voice.cpp index 7929c020d..2e0624483 100644 --- a/src/menus/options-voice.cpp +++ b/src/menus/options-voice.cpp @@ -20,7 +20,7 @@ menuitem_t OPTIONS_Voice[] = NULL, {.cvar = &cv_voice_selfmute}, 0, 0}, {IT_STRING | IT_CVAR, "Deafen Self", "Choose to opt-in to voice chat at all, for yourself.", - NULL, {.cvar = &cv_voice_chat}, 0, 0}, + NULL, {.cvar = &cv_voice_selfdeafen}, 0, 0}, {IT_STRING | IT_CVAR, "Input Mode", "When to transmit your own voice.", NULL, {.cvar = &cv_voice_mode}, 0, 0}, @@ -41,7 +41,7 @@ menuitem_t OPTIONS_Voice[] = NULL, {NULL}, 0, 0}, {IT_STRING | IT_CVAR, "Server Voice Chat", "All voice chat will be disabled on your server.", - NULL, {.cvar = &cv_voice_servermute}, 0, 0}, + NULL, {.cvar = &cv_voice_allowservervoice}, 0, 0}, {IT_STRING | IT_CVAR, "Proximity Effects", "Player voices will be adjusted relative to you.", NULL, {.cvar = &cv_voice_proximity}, 0, 0}, diff --git a/src/s_sound.c b/src/s_sound.c index e2b87d0a4..f55127567 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2832,7 +2832,7 @@ void VoiceChat_OnChange(void) if (M_CheckParm("-novoice") || M_CheckParm("-noaudio")) return; - g_voice_disabled = !cv_voice_chat.value; + g_voice_disabled = !cv_voice_selfdeafen.value; weaponPrefChange(0); } @@ -2879,7 +2879,7 @@ void S_QueueVoiceFrameFromPlayer(INT32 playernum, void *data, UINT32 len, boolea { return; } - if (cv_voice_chat.value != 1) + if (cv_voice_selfdeafen.value != 1) { I_QueueVoiceFrameFromPlayer(playernum, data, len, terminal); } diff --git a/src/s_sound.h b/src/s_sound.h index 9b9143bef..72a0b3387 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -48,7 +48,7 @@ extern consvar_t cv_gamesounds; extern consvar_t cv_bgaudio; extern consvar_t cv_streamersafemusic; -extern consvar_t cv_voice_chat; +extern consvar_t cv_voice_selfdeafen; extern consvar_t cv_voice_mode; extern consvar_t cv_voice_selfmute; extern consvar_t cv_voice_loopback;