MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / SendEmptyToClient

Method SendEmptyToClient

neo/framework/async/AsyncServer.cpp:1042–1069  ·  view source on GitHub ↗

================== idAsyncServer::SendEmptyToClient ================== */

Source from the content-addressed store, hash-verified

1040==================
1041*/
1042bool 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==================

Callers

nothing calls this directly

Calls 6

GetIntegerMethod · 0.80
PrintfMethod · 0.45
InitMethod · 0.45
WriteIntMethod · 0.45
WriteByteMethod · 0.45
SendMessageMethod · 0.45

Tested by

no test coverage detected