=============== idMsgChannel::WriteMessageData ================ */
| 332 | ================ |
| 333 | */ |
| 334 | void idMsgChannel::WriteMessageData( idBitMsg &out, const idBitMsg &msg ) { |
| 335 | idBitMsg tmp; |
| 336 | byte tmpBuf[MAX_MESSAGE_SIZE]; |
| 337 | |
| 338 | tmp.Init( tmpBuf, sizeof( tmpBuf ) ); |
| 339 | |
| 340 | // write acknowledgement of last received reliable message |
| 341 | tmp.WriteInt( reliableReceive.GetLast() ); |
| 342 | |
| 343 | // write reliable messages |
| 344 | reliableSend.CopyToBuffer( tmp.GetData() + tmp.GetSize() ); |
| 345 | tmp.SetSize( tmp.GetSize() + reliableSend.GetTotalSize() ); |
| 346 | tmp.WriteShort( 0 ); |
| 347 | |
| 348 | // write data |
| 349 | tmp.WriteData( msg.GetData(), msg.GetSize() ); |
| 350 | |
| 351 | // write message size |
| 352 | out.WriteShort( tmp.GetSize() ); |
| 353 | |
| 354 | // compress message |
| 355 | idFile_BitMsg file( out ); |
| 356 | compressor->Init( &file, true, 3 ); |
| 357 | compressor->Write( tmp.GetData(), tmp.GetSize() ); |
| 358 | compressor->FinishCompress(); |
| 359 | outgoingCompression = compressor->GetCompressionRatio(); |
| 360 | } |
| 361 | |
| 362 | /* |
| 363 | =============== |
nothing calls this directly
no test coverage detected