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

Method SendReliableGameMessage

neo/framework/async/AsyncServer.cpp:2242–2264  ·  view source on GitHub ↗

================== idAsyncServer::SendReliableGameMessage ================== */

Source from the content-addressed store, hash-verified

2240==================
2241*/
2242void idAsyncServer::SendReliableGameMessage( int clientNum, const idBitMsg &msg ) {
2243 int i;
2244 idBitMsg outMsg;
2245 byte msgBuf[MAX_MESSAGE_SIZE];
2246
2247 outMsg.Init( msgBuf, sizeof( msgBuf ) );
2248 outMsg.WriteByte( SERVER_RELIABLE_MESSAGE_GAME );
2249 outMsg.WriteData( msg.GetData(), msg.GetSize() );
2250
2251 if ( clientNum >= 0 && clientNum < MAX_ASYNC_CLIENTS ) {
2252 if ( clients[clientNum].clientState == SCS_INGAME ) {
2253 SendReliableMessage( clientNum, outMsg );
2254 }
2255 return;
2256 }
2257
2258 for ( i = 0; i < MAX_ASYNC_CLIENTS; i++ ) {
2259 if ( clients[i].clientState != SCS_INGAME ) {
2260 continue;
2261 }
2262 SendReliableMessage( i, outMsg );
2263 }
2264}
2265
2266/*
2267==================

Callers 2

Calls 5

InitMethod · 0.45
WriteByteMethod · 0.45
WriteDataMethod · 0.45
GetDataMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected