aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authoricculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-06-01 18:08:03 +0000
committericculus <icculus@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-06-01 18:08:03 +0000
commit7e919dec12af2881aaf48b6a963da60d74312676 (patch)
tree3629c44b21bbecaf9cc59d0a0d991f4c1024d1f8 /code
parent0f7d8b84d6c906e44982fc1525f2c4d051cb3a0f (diff)
downloadioquake3-aero-7e919dec12af2881aaf48b6a963da60d74312676.tar.gz
ioquake3-aero-7e919dec12af2881aaf48b6a963da60d74312676.zip
Forbid setting voip cvar if network data rate is too low.
This prevents "Connection Interrupted" packets as VoIP data is incoming. git-svn-id: svn://svn.icculus.org/quake3/trunk@1350 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code')
-rw-r--r--code/client/cl_main.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/code/client/cl_main.c b/code/client/cl_main.c
index 2b87857..f09aa4e 100644
--- a/code/client/cl_main.c
+++ b/code/client/cl_main.c
@@ -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 );