================= CL_SendCmd Called every frame to builds and sends a command packet to the server. ================= */
| 910 | ================= |
| 911 | */ |
| 912 | void CL_SendCmd( void ) { |
| 913 | // don't send any message if not connected |
| 914 | if ( cls.state < CA_CONNECTED ) { |
| 915 | return; |
| 916 | } |
| 917 | |
| 918 | // don't send commands if paused |
| 919 | if ( com_sv_running->integer && sv_paused->integer && cl_paused->integer ) { |
| 920 | return; |
| 921 | } |
| 922 | |
| 923 | // we create commands even if a demo is playing, |
| 924 | CL_CreateNewCommands(); |
| 925 | |
| 926 | // don't send a packet if the last packet was sent too recently |
| 927 | if ( !CL_ReadyToSendPacket() ) { |
| 928 | return; |
| 929 | } |
| 930 | |
| 931 | CL_WritePacket(); |
| 932 | } |
| 933 | |
| 934 | |
| 935 | /* |
no test coverage detected