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

Method WriteMessageData

neo/framework/async/MsgChannel.cpp:334–360  ·  view source on GitHub ↗

=============== idMsgChannel::WriteMessageData ================ */

Source from the content-addressed store, hash-verified

332================
333*/
334void 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===============

Callers

nothing calls this directly

Calls 13

GetLastMethod · 0.80
CopyToBufferMethod · 0.80
GetTotalSizeMethod · 0.80
FinishCompressMethod · 0.80
GetCompressionRatioMethod · 0.80
InitMethod · 0.45
WriteIntMethod · 0.45
GetDataMethod · 0.45
GetSizeMethod · 0.45
SetSizeMethod · 0.45
WriteShortMethod · 0.45
WriteDataMethod · 0.45

Tested by

no test coverage detected