From 8d0209b1224bae67e35bc365f58026ec96845480 Mon Sep 17 00:00:00 2001 From: SNMetamorph <25657591+SNMetamorph@users.noreply.github.com> Date: Mon, 15 Aug 2022 11:26:41 +0400 Subject: [PATCH] engine: server: added support for variable voice chat quality --- engine/server/sv_init.c | 2 +- engine/server/sv_main.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/server/sv_init.c b/engine/server/sv_init.c index d77f21a1..0c421ed0 100644 --- a/engine/server/sv_init.c +++ b/engine/server/sv_init.c @@ -395,7 +395,7 @@ void SV_WriteVoiceCodec( sizebuf_t *msg ) { MSG_BeginServerCmd( msg, svc_voiceinit ); MSG_WriteString( msg, "opus" ); - MSG_WriteByte( msg, 0 ); + MSG_WriteByte( msg, Cvar_VariableInteger( "sv_voicequality" )); } /* diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index bae1f522..1122905b 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -114,6 +114,7 @@ CVAR_DEFINE_AUTO( violence_agibs, "1", 0, "show alien gib entities" ); // voice chat CVAR_DEFINE_AUTO( sv_voiceenable, "1", FCVAR_ARCHIVE|FCVAR_SERVER, "enable voice support" ); +CVAR_DEFINE_AUTO( sv_voicequality, "3", FCVAR_ARCHIVE|FCVAR_SERVER, "voice chat quality level, from 0 to 5, higher is better" ); convar_t *sv_novis; // disable server culling entities by vis convar_t *sv_pausable; @@ -978,6 +979,7 @@ void SV_Init( void ) Cvar_RegisterVariable( &mapchangecfgfile ); Cvar_RegisterVariable( &sv_voiceenable ); + Cvar_RegisterVariable( &sv_voicequality ); Cvar_RegisterVariable( &sv_trace_messages ); sv_allow_joystick = Cvar_Get( "sv_allow_joystick", "1", FCVAR_ARCHIVE, "allow connect with joystick enabled" );