From 1e4fa5a54cc15c43558d42af60f834cf94f23893 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 2 Jun 2008 19:41:09 +0000 Subject: [PATCH] Treat sv_voip cvar as a version number (0 == off, 1 == version 1 protocol). Don't publish it to server's info string if set to zero. --- code/server/sv_init.c | 4 ++++ code/server/sv_main.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/server/sv_init.c b/code/server/sv_init.c index 28b3a1d4..97154f0f 100644 --- a/code/server/sv_init.c +++ b/code/server/sv_init.c @@ -656,6 +656,10 @@ void SV_Init (void) { sv_pure = Cvar_Get ("sv_pure", "1", CVAR_SYSTEMINFO ); #if USE_VOIP sv_voip = Cvar_Get ("sv_voip", "1", CVAR_SYSTEMINFO | CVAR_LATCH); + if ( (sv_voip->integer < 0) || (sv_voip->integer > 1) ) { + Com_Printf("WARNING: sv_voip must be 0 or 1. Setting to 1."); + Cvar_Set ("sv_voip", "1"); + } #endif Cvar_Get ("sv_paks", "", CVAR_SYSTEMINFO | CVAR_ROM ); Cvar_Get ("sv_pakNames", "", CVAR_SYSTEMINFO | CVAR_ROM ); diff --git a/code/server/sv_main.c b/code/server/sv_main.c index a12da037..667db41b 100644 --- a/code/server/sv_main.c +++ b/code/server/sv_main.c @@ -412,7 +412,9 @@ void SVC_Info( netadr_t from ) { Info_SetValueForKey( infostring, "pure", va("%i", sv_pure->integer ) ); #if USE_VOIP - Info_SetValueForKey( infostring, "voip", va("%i", sv_voip->integer ) ); + if (sv_voip->integer) { + Info_SetValueForKey( infostring, "voip", va("%i", sv_voip->integer ) ); + } #endif if( sv_minPing->integer ) {