================== idAsyncServer::SendReliableGameMessage ================== */
| 2240 | ================== |
| 2241 | */ |
| 2242 | void 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 | ================== |