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

Function CL_AddReliableCommand

code/client/cl_main.cpp:115–129  ·  view source on GitHub ↗

====================== CL_AddReliableCommand The given command will be transmitted to the server, and is gauranteed to not have future usercmd_t executed before it is executed ====================== */

Source from the content-addressed store, hash-verified

113======================
114*/
115void CL_AddReliableCommand( const char *cmd ) {
116 int index;
117
118 // if we would be losing an old command that hasn't been acknowledged,
119 // we must drop the connection
120 if ( clc.reliableSequence - clc.reliableAcknowledge > MAX_RELIABLE_COMMANDS ) {
121 Com_Error( ERR_DROP, "Client command overflow" );
122 }
123 clc.reliableSequence++;
124 index = clc.reliableSequence & ( MAX_RELIABLE_COMMANDS - 1 );
125 if ( clc.reliableCommands[ index ] ) {
126 Z_Free( clc.reliableCommands[ index ] );
127 }
128 clc.reliableCommands[ index ] = CopyString( cmd );
129}
130
131//======================================================================
132

Callers 5

CL_DisconnectFunction · 0.70
CL_ForwardToServer_fFunction · 0.70
CL_CheckUserinfoFunction · 0.70
CL_CgameSystemCallsFunction · 0.70

Calls 3

Com_ErrorFunction · 0.50
Z_FreeFunction · 0.50
CopyStringFunction · 0.50

Tested by

no test coverage detected