C4 Engine
C4 Engine API Documentation

Message::DecompressMessage

Defined in:  C4Messages.h
Called by the Message Manager to decompress and validate message data stored in a memory buffer.
Prototype

virtual bool DecompressMessage(Decompressor& data) override;

Parameters
data The Decompressor object that holds the message's data.
Description
The Message Manager calls the DecompressMessage function to decompress a data packet into a message object and validate its contents. The implementation should decompress the data using the member functions of the Decompressor object referenced by the data parameter. The size of the data stored in the object can be determined by calling Decompressor::GetDataSize. After decompressing the data, the DecompressMessage function should validate the contents of the message in whatever manner it can and return a boolean value indicating whether the data appears to be valid. If the DecompressMessage function returns false, then the Message Manager discards the message.
See Also

Message::CompressMessage