================== idAsyncServer::SendEmptyToClient ================== */
| 1040 | ================== |
| 1041 | */ |
| 1042 | bool idAsyncServer::SendEmptyToClient( int clientNum, bool force ) { |
| 1043 | idBitMsg msg; |
| 1044 | byte msgBuf[MAX_MESSAGE_SIZE]; |
| 1045 | |
| 1046 | serverClient_t &client = clients[clientNum]; |
| 1047 | |
| 1048 | if ( client.lastEmptyTime > realTime ) { |
| 1049 | client.lastEmptyTime = realTime; |
| 1050 | } |
| 1051 | |
| 1052 | if ( !force && ( realTime - client.lastEmptyTime < EMPTY_RESEND_TIME ) ) { |
| 1053 | return false; |
| 1054 | } |
| 1055 | |
| 1056 | if ( idAsyncNetwork::verbose.GetInteger() ) { |
| 1057 | common->Printf( "sending empty to client %d: gameInitId = %d, gameFrame = %d, gameTime = %d\n", clientNum, gameInitId, gameFrame, gameTime ); |
| 1058 | } |
| 1059 | |
| 1060 | msg.Init( msgBuf, sizeof( msgBuf ) ); |
| 1061 | msg.WriteInt( gameInitId ); |
| 1062 | msg.WriteByte( SERVER_UNRELIABLE_MESSAGE_EMPTY ); |
| 1063 | |
| 1064 | client.channel.SendMessage( serverPort, serverTime, msg ); |
| 1065 | |
| 1066 | client.lastEmptyTime = realTime; |
| 1067 | |
| 1068 | return true; |
| 1069 | } |
| 1070 | |
| 1071 | /* |
| 1072 | ================== |
nothing calls this directly
no test coverage detected