Merge branch 'change-public-server-wording' into 'master'

Advertising a Server & Voice Chat Menu Rewording

See merge request kart-krew-dev/ring-racers-internal!2705
This commit is contained in:
Oni VelocitOni 2025-07-25 04:52:14 +00:00
commit e7917b2f05
11 changed files with 54 additions and 46 deletions

View file

@ -1370,10 +1370,10 @@ consvar_t cv_chatwidth = Player("chatwidth", "150").min_max(64, 150);
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", "Off")
void VoiceSelfDeafen_OnChange(void);
consvar_t cv_voice_selfdeafen = Player("voice_selfdeafen", "On")
.on_off()
.onchange(VoiceChat_OnChange)
.onchange(VoiceSelfDeafen_OnChange)
.description("Whether voice chat is played or not. Shown as self-deafen to others.");
// When on, local player won't transmit voice
@ -1432,12 +1432,12 @@ 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", "On")
consvar_t cv_voice_allowservervoice = NetVar("voice_allowservervoice", "Off")
.on_off()
.onchange(VoiceMute_OnChange)
.description("If On, the server will not broadcast voice chat to clients");
.onchange(AllowServerVC_OnChange)
.description("If Off, the server will not broadcast voice chat to clients");
//

View file

@ -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 : 0)
(cv_voice_allowservervoice.value ? SV_VOICEENABLED : 0)
);
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 != 0 && 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 != 0 && 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)
{
// Don't even relay voice packets if voice_servermute is on
// Don't even relay voice packets if voice_allowservervoice is off
return;
}
@ -7474,7 +7474,7 @@ void NetVoiceUpdate(void)
continue;
}
if (cv_voice_chat.value == 0)
if (cv_voice_selfdeafen.value == 1)
{
g_local_voice_buffer_len = 0;
continue;

View file

@ -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,16 +7103,16 @@ 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)
HU_AddChatText(M_GetText("\x82*Voice chat has been muted."), false);
else
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);
}
/** Hack to clear all changed flags after game start.

View file

@ -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;

View file

@ -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 == 1)
{
patch_t *voxmic;
if (S_IsPlayerVoiceActive(rankplayer[i]))
@ -8081,7 +8081,7 @@ void K_drawKartHUD(void)
}
}
if (netgame && cv_voice_servermute.value == 0)
if (netgame && cv_voice_allowservervoice.value == 1)
{
if (players[consoleplayer].pflags2 & (PF2_SELFMUTE | PF2_SERVERMUTE | PF2_SELFDEAFEN | PF2_SERVERDEAFEN))
{

View file

@ -10,11 +10,12 @@
/// \brief Server Options
#include "../k_menu.h"
#include "../s_sound.h"
menuitem_t OPTIONS_Server[] =
{
{IT_HEADER, "Advertising...", NULL,
{IT_HEADER, "Broadcast...", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR | IT_CV_STRING, "Server Name", "Name of your server.",
@ -23,7 +24,7 @@ menuitem_t OPTIONS_Server[] =
{IT_STRING | IT_CVAR | IT_CV_STRING, "Server Contact", "How you should be contacted for Master Server moderation.",
NULL, {.cvar = &cv_server_contact}, 0, 0},
{IT_STRING | IT_CVAR, "Advertise", "Display your server in the Browser for other players to join.",
{IT_STRING | IT_CVAR, "Make Public", "Display your server in the Browser for other players to join.",
NULL, {.cvar = &cv_advertise}, 0, 0},
@ -72,20 +73,27 @@ menuitem_t OPTIONS_Server[] =
NULL, {.cvar = &cv_pause}, 0, 0},
{IT_HEADER, "Chat...", NULL,
{IT_HEADER, "Text Chat...", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Mute Chat", "Prevent everyone but admins from sending chat messages.",
NULL, {.cvar = &cv_mute}, 0, 0},
{IT_STRING | IT_CVAR, "Mute Voice Chat", "Prevent everyone from sending voice chat.",
NULL, {.cvar = &cv_voice_servermute}, 0, 0},
{IT_STRING | IT_CVAR, "Chat Spam Protection", "Prevent too many messages from a single player.",
NULL, {.cvar = &cv_chatspamprotection}, 0, 0},
{IT_STRING | IT_CVAR, "Rounds Needed To Chat", "How many rounds players must complete before they can chat. Good vs. ban evaders.",
NULL, {.cvar = &cv_gamestochat}, 0, 0},
{IT_HEADER, "Voice Chat...", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Server Voice Chat", "All voice chat will be enabled on your server.",
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},
{IT_SPACE | IT_DYBIGSPACE, NULL, NULL,
NULL, {NULL}, 0, 0},

View file

@ -121,7 +121,7 @@ std::array<Slider, Slider::kNumSliders> 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<Slider, Slider::kNumSliders> sliders{{
{
if (toggle)
{
CV_AddValue(&cv_voice_chat, 1);
CV_AddValue(&cv_voice_selfdeafen, 0);
}
return !S_VoiceDisabled();

View file

@ -16,22 +16,22 @@
menuitem_t OPTIONS_Voice[] =
{
{IT_STRING | IT_CVAR, "Voice Chat", "Turn on or off all voice chat for yourself.",
NULL, {.cvar = &cv_voice_chat}, 0, 0},
{IT_STRING | IT_CVAR, "Mute Self", "Whether your voice is transmitted or not.",
NULL, {.cvar = &cv_voice_selfmute}, 0, 0},
{IT_STRING | IT_CVAR, "Voice Mode", "When to transmit your own voice.",
{IT_STRING | IT_CVAR, "Deafen Self", "Choose to opt-in to voice chat at all, for yourself.",
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},
{IT_STRING | IT_CVAR, "Input Amplifier", "Amplify your voice, in decibels. Negative values are quieter.",
NULL, {.cvar = &cv_voice_inputamp}, 0, 0},
{IT_STRING | IT_CVAR, "Activation Threshold", "Voice higher than this threshold will transmit, in decibels.",
{IT_STRING | IT_CVAR, "Input Sensitivity", "Voice higher than this threshold will transmit, in decibels.",
NULL, {.cvar = &cv_voice_activationthreshold}, 0, 0},
{IT_STRING | IT_CVAR, "Self Voice Mute", "Whether your voice is transmitted or not.",
NULL, {.cvar = &cv_voice_selfmute}, 0, 0},
{IT_STRING | IT_CVAR, "Voice Loopback", "Play your own recording voice back.",
{IT_STRING | IT_CVAR, "Voice Loopback", "Play your own voice back simultaneously.",
NULL, {.cvar = &cv_voice_loopback}, 0, 0},
{IT_SPACE | IT_NOTHING, NULL, NULL,
@ -40,8 +40,8 @@ menuitem_t OPTIONS_Voice[] =
{IT_HEADER, "Server Voice Options...", NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CVAR, "Server Voice Mute", "All voice chat will be disabled on your server.",
NULL, {.cvar = &cv_voice_servermute}, 0, 0},
{IT_STRING | IT_CVAR, "Server Voice Chat", "All voice chat will be enabled on your server.",
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},

View file

@ -46,7 +46,7 @@ static void draw_routine(void)
294 + tx,
98,
!CV_IsSetToDefault(&cv_advertise) ? warningflags : highlightflags,
va("(Advertise: %s)", cv_advertise.string)
va("(Public: %s)", cv_advertise.string)
);
M_DrawMasterServerReminder();

View file

@ -2825,14 +2825,14 @@ void GameDigiMusic_OnChange(void)
}
}
void VoiceChat_OnChange(void);
void VoiceSelfDeafen_OnChange(void);
void weaponPrefChange(INT32 ssplayer);
void VoiceChat_OnChange(void)
void VoiceSelfDeafen_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 != 0)
if (cv_voice_selfdeafen.value != 1)
{
I_QueueVoiceFrameFromPlayer(playernum, data, len, terminal);
}

View file

@ -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;