cvar_t cl_worldnamenoextension = {CVAR_READONLY, "cl_worldnamenoextension", "", "name of current worldmodel without extension"};
cvar_t cl_worldbasename = {CVAR_READONLY, "cl_worldbasename", "", "name of current worldmodel without maps/ prefix or extension"};
-cvar_t developer_networkentities = {0, "developer_networkentities", "0", "prints received entities, value is 0-4 (higher for more info)"};
+cvar_t developer_networkentities = {0, "developer_networkentities", "0", "prints received entities, value is 0-10 (higher for more info, 10 being the most verbose)"};
cvar_t cl_gameplayfix_soundsmovewithentities = {0, "cl_gameplayfix_soundsmovewithentities", "1", "causes sounds made by lifts, players, projectiles, and any other entities, to move with the entity, so for example a rocket noise follows the rocket rather than staying at the starting position"};
cvar_t cl_sound_wizardhit = {0, "cl_sound_wizardhit", "wizard/hit.wav", "sound to play during TE_WIZSPIKE (empty cvar disables sound)"};
cvar_t cl_sound_hknighthit = {0, "cl_sound_hknighthit", "hknight/hit.wav", "sound to play during TE_KNIGHTSPIKE (empty cvar disables sound)"};
static unsigned char olddata[NET_MAXMESSAGE];
void CL_KeepaliveMessage (qboolean readmessages)
{
+ static double lastdirtytime = 0;
static qboolean recursive = false;
- double time;
- static double nextmsg = -1;
- static double nextupdate = -1;
-#if 0
- static double lasttime = -1;
-#endif
+ double dirtytime;
+ double deltatime;
+ static double countdownmsg = 0;
+ static double countdownupdate = 0;
sizebuf_t old;
qboolean thisrecursive;
thisrecursive = recursive;
recursive = true;
- time = Sys_DirtyTime();
+ dirtytime = Sys_DirtyTime();
+ deltatime = dirtytime - lastdirtytime;
+ lastdirtytime = dirtytime;
+ if (deltatime <= 0 || deltatime >= 1800.0)
+ return;
+
+ countdownmsg -= deltatime;
+ countdownupdate -= deltatime;
+
if(!thisrecursive)
{
if(cls.state != ca_dedicated)
{
- if(time >= nextupdate || time < nextupdate) // check if time stepped backwards
+ if(countdownupdate <= 0) // check if time stepped backwards
{
SCR_UpdateLoadingScreenIfShown();
- nextupdate = time + 2;
+ countdownupdate = 2;
}
}
}
// no need if server is local and definitely not if this is a demo
- if (!cls.netcon || cls.protocol == PROTOCOL_QUAKEWORLD || cls.signon >= SIGNONS)
+ if (sv.active || !cls.netcon || cls.protocol == PROTOCOL_QUAKEWORLD || cls.signon >= SIGNONS)
{
recursive = thisrecursive;
return;
memcpy(cl_message.data, olddata, cl_message.cursize);
}
- if (cls.netcon && (time >= nextmsg || time < nextmsg)) // check if time stepped backwards
+ if (cls.netcon && countdownmsg <= 0) // check if time stepped backwards
{
sizebuf_t msg;
unsigned char buf[4];
- nextmsg = time + 5;
+ countdownmsg = 5;
// write out a nop
// LordHavoc: must use unreliable because reliable could kill the sigon message!
Con_Print("--> client to server keepalive\n");
data = entdata;
if (!data)
return;
- if (!COM_ParseToken_Simple(&data, false, false))
+ if (!COM_ParseToken_Simple(&data, false, false, true))
return; // error
if (com_token[0] != '{')
return; // error
while (1)
{
- if (!COM_ParseToken_Simple(&data, false, false))
+ if (!COM_ParseToken_Simple(&data, false, false, true))
return; // error
if (com_token[0] == '}')
break; // end of worldspawn
strlcpy (key, com_token, sizeof (key));
while (key[strlen(key)-1] == ' ') // remove trailing spaces
key[strlen(key)-1] = 0;
- if (!COM_ParseToken_Simple(&data, false, false))
+ if (!COM_ParseToken_Simple(&data, false, false, true))
return; // error
strlcpy (value, com_token, sizeof (value));
if (!strcmp("sky", key))