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))
+ cl.loadsound_total * LOADPROGRESSWEIGHT_SOUND
)
);
- SCR_BeginLoadingPlaque();
+ SCR_BeginLoadingPlaque(false);
}
for (;cl.loadmodel_current < cl.loadmodel_total;cl.loadmodel_current++)
{
{
Con_Printf("Downloaded \"%s\" (%i bytes, %i CRC)\n", name, size, crc);
FS_WriteFile(name, cls.qw_downloadmemory, cls.qw_downloadmemorycursize);
+ if(!strcmp(cls.qw_downloadname, csqc_progname.string))
+ {
+ if(cls.caughtcsprogsdata)
+ Mem_Free(cls.caughtcsprogsdata);
+ cls.caughtcsprogsdata = (unsigned char *) Mem_Alloc(cls.permanentmempool, cls.qw_downloadmemorycursize);
+ memcpy(cls.caughtcsprogsdata, cls.qw_downloadmemory, cls.qw_downloadmemorycursize);
+ cls.caughtcsprogsdatasize = cls.qw_downloadmemorycursize;
+ Con_DPrintf("Buffered \"%s\"\n", name);
+ }
}
}
}
// if server is active, we already began a loading plaque
if (!sv.active)
{
- SCR_BeginLoadingPlaque();
+ SCR_BeginLoadingPlaque(false);
S_StopAllSounds();
// free q3 shaders so that any newly downloaded shaders will be active
Mod_FreeQ3Shaders();
cl.stats[STAT_CELLS] = MSG_ReadShort(&cl_message);
cl.stats[STAT_ACTIVEWEAPON] = (unsigned short) MSG_ReadShort(&cl_message);
}
- else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_NEHAHRABJP || cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3 || cls.protocol == PROTOCOL_NEHAHRABJP || cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3 || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4)
+ else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_NEHAHRABJP || cls.protocol == PROTOCOL_NEHAHRABJP2 || cls.protocol == PROTOCOL_NEHAHRABJP3 || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4)
{
cl.stats[STAT_WEAPONFRAME] = (bits & SU_WEAPONFRAME) ? MSG_ReadByte(&cl_message) : 0;
cl.stats[STAT_ARMOR] = (bits & SU_ARMOR) ? MSG_ReadByte(&cl_message) : 0;
cl.stats[STAT_NAILS] = MSG_ReadByte(&cl_message);
cl.stats[STAT_ROCKETS] = MSG_ReadByte(&cl_message);
cl.stats[STAT_CELLS] = MSG_ReadByte(&cl_message);
- if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE || gamemode == GAME_NEXUIZ)
+ if (gamemode == GAME_HIPNOTIC || gamemode == GAME_ROGUE || gamemode == GAME_QUOTH || gamemode == GAME_NEXUIZ)
cl.stats[STAT_ACTIVEWEAPON] = (1<<MSG_ReadByte(&cl_message));
else
cl.stats[STAT_ACTIVEWEAPON] = MSG_ReadByte(&cl_message);
static void CL_IPLog_Add(const char *address, const char *name, qboolean checkexisting, qboolean addtofile)
{
int i;
+ size_t sz_name, sz_address;
if (!address || !address[0] || !name || !name[0])
return;
if (!cl_iplog_loaded)
Mem_Free(olditems);
}
}
- cl_iplog_items[cl_iplog_numitems].address = (char *) Mem_Alloc(cls.permanentmempool, strlen(address) + 1);
- cl_iplog_items[cl_iplog_numitems].name = (char *) Mem_Alloc(cls.permanentmempool, strlen(name) + 1);
- strlcpy(cl_iplog_items[cl_iplog_numitems].address, address, strlen(address) + 1);
+ sz_address = strlen(address) + 1;
+ sz_name = strlen(name) + 1;
+ cl_iplog_items[cl_iplog_numitems].address = (char *) Mem_Alloc(cls.permanentmempool, sz_address);
+ cl_iplog_items[cl_iplog_numitems].name = (char *) Mem_Alloc(cls.permanentmempool, sz_name);
+ strlcpy(cl_iplog_items[cl_iplog_numitems].address, address, sz_address);
// TODO: maybe it would be better to strip weird characters from name when
// copying it here rather than using a straight strcpy?
- strlcpy(cl_iplog_items[cl_iplog_numitems].name, name, strlen(name) + 1);
+ strlcpy(cl_iplog_items[cl_iplog_numitems].name, name, sz_name);
cl_iplog_numitems++;
if (addtofile)
{
break;
case qw_svc_chokecount:
- i = MSG_ReadByte(&cl_message);
+ (void) MSG_ReadByte(&cl_message);
// FIXME: apply to netgraph
//for (j = 0;j < i;j++)
// cl.frames[(cls.netcon->qw.incoming_acknowledged-1-j)&QW_UPDATE_MASK].receivedtime = -2;