]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
print E5_COMPLEXANIMATION and E5_TRAILEFFECTNUM in
[xonotic/darkplaces.git] / cl_parse.c
index 7ff8ead9a80783cf07ace98d9bf8c73f7e6df53f..5f97c53aa23fc08f95294c0dea1a4a6c5de82f58 100644 (file)
@@ -167,7 +167,7 @@ cvar_t cl_worldname = {CVAR_READONLY, "cl_worldname", "", "name of current world
 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)"};
@@ -303,13 +303,12 @@ so the server doesn't disconnect.
 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;
@@ -317,21 +316,29 @@ void CL_KeepaliveMessage (qboolean readmessages)
        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;
@@ -349,11 +356,11 @@ void CL_KeepaliveMessage (qboolean readmessages)
                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");
@@ -377,13 +384,13 @@ void CL_ParseEntityLump(char *entdata)
        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
@@ -393,7 +400,7 @@ void CL_ParseEntityLump(char *entdata)
                        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))