From: havoc Date: Sat, 3 Mar 2007 00:51:48 +0000 (+0000) Subject: minor cleanup of CL_SendMove comments regarding packet timing X-Git-Tag: xonotic-v0.1.0preview~3482 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=946aeb7d23ecb1b9e1b5f156242a4d91ceb12ee4;p=xonotic%2Fdarkplaces.git minor cleanup of CL_SendMove comments regarding packet timing changed predicted move sending code to not care about the value of cls.signon git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6934 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_input.c b/cl_input.c index 720f8f09..b3436b84 100644 --- a/cl_input.c +++ b/cl_input.c @@ -1272,37 +1272,35 @@ void CL_SendMove(void) if (!cls.netcon) return; + // don't send too often or else network connections can get clogged by a high renderer framerate packettime = 1.0 / bound(10, cl_netinputpacketspersecond.value, 100); - // on quakeworld servers the server replies to client input, so we send - // packets whenever we want to - // on non-quakeworld servers the client replies to server updates + // quakeworld servers take only frametimes + // predicted dp7 servers take current interpolation time + // unpredicted servers take an echo of the latest server timestamp if (cls.protocol == PROTOCOL_QUAKEWORLD) { - // don't send too often or else network connections can get clogged by a high renderer framerate if (realtime < lastsendtime + packettime) return; cl.cmd.time = realtime; } - else if (cl.movement_predicted || cls.signon < SIGNONS) + else if (cl.movement_predicted) { - // don't send too often or else network connections can get clogged by a high renderer framerate if (realtime < lastsendtime + packettime) return; - cl.cmd.time = cls.protocol == PROTOCOL_QUAKEWORLD ? realtime : cl.time; + cl.cmd.time = cl.time; } else { - // if not predicted, we should just reply to server packets, and - // report the real latest packet time rather than our interpolated - // time + // unpredicted movement should be sent immediately whenever a server + // packet is received, to minimize ping times if (!cl.movement_needupdate && realtime < lastsendtime + packettime) return; - cl.cmd.time = cls.protocol == PROTOCOL_QUAKEWORLD ? realtime : cl.mtime[0]; + cl.cmd.time = cl.mtime[0]; } // don't let it fall behind if CL_SendMove hasn't been called recently // (such is the case when framerate is too low for instance) lastsendtime = bound(realtime, lastsendtime + packettime, realtime + packettime); - // clear the note down that we sent a packet recently + // set the flag indicating that we sent a packet recently cl.movement_needupdate = false;