C4 Engine
C4 Engine API Documentation

Message::CompressMessage

Defined in:  C4Messages.h
Called by the Message Manager to compress and serialize message data into a memory buffer.
Prototype

virtual void CompressMessage(Compressor& data) const override;

Parameters
data The Compressor object that will hold the message's data.
Description
The Message Manager calls the CompressMessage function to compress and serialize the message data into a the buffer that will be transmitted as a data packet on the network. The implementation should compress the message data in whatever manner it wishes and write the data using the member functions of the Compressor object referenced by the data parameter. No more than kMaxMessageSize - 1 bytes should be written to this object. (This length is one less than kMaxMessageSize because the first byte is used as the message type identifier.)
See Also

Message::DecompressMessage