Forbid setting voip cvar if network data rate is too low.

This prevents "Connection Interrupted" packets as VoIP data is incoming.
This commit is contained in:
Ryan C. Gordon 2008-06-01 18:08:03 +00:00
parent a948f7cf69
commit 9b1984647a
1 changed files with 23 additions and 11 deletions

View File

@ -3007,17 +3007,6 @@ void CL_Init( void ) {
cl_guidServerUniq = Cvar_Get ("cl_guidServerUniq", "1", CVAR_ARCHIVE);
#ifdef USE_MUMBLE
cl_useMumble = Cvar_Get ("cl_useMumble", "0", CVAR_ARCHIVE);
cl_mumbleScale = Cvar_Get ("cl_mumbleScale", "0.0254", CVAR_ARCHIVE);
#endif
#if USE_VOIP
cl_voipSend = Cvar_Get ("cl_voipSend", "0", 0);
cl_voipGainDuringCapture = Cvar_Get ("cl_voipGainDuringCapture", "0.2", CVAR_ARCHIVE);
voip = Cvar_Get ("voip", "0", CVAR_USERINFO | CVAR_ARCHIVE);
#endif
// userinfo
Cvar_Get ("name", "UnnamedPlayer", CVAR_USERINFO | CVAR_ARCHIVE );
Cvar_Get ("rate", "3000", CVAR_USERINFO | CVAR_ARCHIVE );
@ -3038,6 +3027,29 @@ void CL_Init( void ) {
Cvar_Get ("password", "", CVAR_USERINFO);
Cvar_Get ("cg_predictItems", "1", CVAR_USERINFO | CVAR_ARCHIVE );
#ifdef USE_MUMBLE
cl_useMumble = Cvar_Get ("cl_useMumble", "0", CVAR_ARCHIVE);
cl_mumbleScale = Cvar_Get ("cl_mumbleScale", "0.0254", CVAR_ARCHIVE);
#endif
#if USE_VOIP
cl_voipSend = Cvar_Get ("cl_voipSend", "0", 0);
cl_voipGainDuringCapture = Cvar_Get ("cl_voipGainDuringCapture", "0.2", CVAR_ARCHIVE);
voip = Cvar_Get ("voip", "0", CVAR_USERINFO | CVAR_ARCHIVE);
// If your data rate is too low, you'll get Connection Interrupted warnings
// when VoIP packets arrive, even if you have a broadband connection.
// This might work on rates lower than 25000, but for safety's sake, we'll
// just demand it. Who doesn't have at least a DSL line now, anyhow? If
// you don't, you don't need VoIP. :)
if ((voip->integer) && (Cvar_VariableIntegerValue("rate") < 25000)) {
Com_Printf("Your network rate is too slow for VoIP.\n");
Com_Printf("Set 'Data Rate' to 'LAN/Cable/xDSL' in 'Setup/System/Network' and restart.\n");
Com_Printf("Until then, VoIP is disabled.\n");
Cvar_Set("voip", "0");
}
#endif
// cgame might not be initialized before menu is used
Cvar_Get ("cg_viewsize", "100", CVAR_ARCHIVE );