]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
new entity protocol, GREATLY improved over quake, massive net traffic reduction
[xonotic/darkplaces.git] / cl_input.c
index 481f843d88bac3f452174e69f33be4927cafd70f..11975ce4999f120b6d4760e1a804a32e5acb801c 100644 (file)
@@ -392,7 +392,7 @@ void CL_SendMove (usercmd_t *cmd)
                for (i=0 ; i<3 ; i++)
                        MSG_WriteAngle (&buf, cl.viewangles[i]);
        }
-       
+
     MSG_WriteShort (&buf, forwardmove);
     MSG_WriteShort (&buf, sidemove);
     MSG_WriteShort (&buf, upmove);
@@ -402,11 +402,11 @@ void CL_SendMove (usercmd_t *cmd)
 // send button bits
 //
        bits = 0;
-       
+
        if ( in_attack.state & 3 )
                bits |= 1;
        in_attack.state &= ~2;
-       
+
        if (in_jump.state & 3)
                bits |= 2;
        in_jump.state &= ~2;
@@ -417,12 +417,20 @@ void CL_SendMove (usercmd_t *cmd)
        if (in_button6.state & 3) bits |=  32;in_button6.state &= ~2;
        if (in_button7.state & 3) bits |=  64;in_button7.state &= ~2;
        if (in_button8.state & 3) bits |= 128;in_button8.state &= ~2;
-       
+
     MSG_WriteByte (&buf, bits);
 
     MSG_WriteByte (&buf, in_impulse);
        in_impulse = 0;
 
+       // LordHavoc: should we ack this on receipt instead?  would waste net bandwidth though
+       i = EntityFrame_MostRecentlyRecievedFrameNum(&cl.entitydatabase);
+       if (i > 0)
+       {
+               MSG_WriteByte (&buf, clc_ackentities);
+               MSG_WriteLong (&buf, i);
+       }
+
 //
 // deliver the message
 //