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;