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

Function CL_CheckTimeout

code/client/cl_main.cpp:694–710  ·  view source on GitHub ↗

================== CL_CheckTimeout ================== */

Source from the content-addressed store, hash-verified

692==================
693*/
694void CL_CheckTimeout( void ) {
695 //
696 // check timeout
697 //
698 if ( ( !CL_CheckPaused() || !sv_paused->integer )
699// && cls.state >= CA_CONNECTED && cls.state != CA_CINEMATIC
700 && cls.state >= CA_CONNECTED && (cls.state != CA_CINEMATIC && !CL_IsRunningInGameCinematic())
701 && cls.realtime - clc.lastPacketTime > cl_timeout->value*1000) {
702 if (++cl.timeoutcount > 5) { // timeoutcount saves debugger
703 Com_Printf ("\nServer connection timed out.\n");
704 CL_Disconnect ();
705 return;
706 }
707 } else {
708 cl.timeoutcount = 0;
709 }
710}
711
712/*
713==================

Callers 1

CL_FrameFunction · 0.70

Calls 4

CL_CheckPausedFunction · 0.70
CL_DisconnectFunction · 0.70
Com_PrintfFunction · 0.50

Tested by

no test coverage detected