MCPcopy Create free account
hub / github.com/JACoders/OpenJK / CL_ReadyToSendPacket

Function CL_ReadyToSendPacket

code/client/cl_input.cpp:773–790  ·  view source on GitHub ↗

================= CL_ReadyToSendPacket Returns qfalse if we are over the maxpackets limit and should choke back the bandwidth a bit by not sending a packet this frame. All the commands will still get delivered in the next packet, but saving a header and getting more delta compression will reduce total bandwidth. ================= */

Source from the content-addressed store, hash-verified

771=================
772*/
773qboolean CL_ReadyToSendPacket( void ) {
774 // don't send anything if playing back a demo
775// if ( cls.state == CA_CINEMATIC )
776 if ( cls.state == CA_CINEMATIC || CL_IsRunningInGameCinematic())
777 {
778 return qfalse;
779 }
780
781 // if we don't have a valid gamestate yet, only send
782 // one packet a second
783 if ( cls.state != CA_ACTIVE && cls.state != CA_PRIMED
784 && cls.realtime - clc.lastPacketSentTime < 1000 ) {
785 return qfalse;
786 }
787
788 // send every frame for loopbacks
789 return qtrue;
790}
791
792/*
793===================

Callers 1

CL_SendCmdFunction · 0.70

Calls 1

Tested by

no test coverage detected