Open 3D Engine AzNetworking API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
Packet data compressor interface. More...
#include <ICompressor.h>
Public Member Functions | |
virtual bool | Init ()=0 |
Initialize compressor. | |
virtual CompressorType | GetType () const =0 |
Unique identifier of a given compressor. | |
virtual AZStd::size_t | GetMaxChunkSize (AZStd::size_t maxCompSize) const =0 |
Returns max possible size of uncompressed data chunk needed to fit compressed data in maxCompSize bytes. | |
virtual AZStd::size_t | GetMaxCompressedBufferSize (AZStd::size_t uncompSize) const =0 |
Returns size of compressed buffer needed to uncompress uncompSize of bytes. | |
virtual CompressorError | Compress (const void *uncompData, AZStd::size_t uncompSize, void *compData, AZStd::size_t compDataSize, AZStd::size_t &compSize)=0 |
virtual CompressorError | Decompress (const void *compData, AZStd::size_t compDataSize, void *uncompData, AZStd::size_t uncompDataSize, AZStd::size_t &consumedSize, AZStd::size_t &uncompSize)=0 |
Packet data compressor interface.
ICompressor is an abstract compression interface meant for user provided GEMs to implement (such as the Multiplayer Compression Gem). Compression is supported for both TCP and UDP connections. Instantiation of a compressor is controlled by the net_UdpCompressor
or net_TcpCompressor
cvar for their respective protocols.
|
pure virtual |
Finalizes the stream, and returns composed packet. Chunk based compressors should loop internally in Compress() to compress all chunks of uncompData.
uncompData | buffer to compress |
uncompSize | length of data to compress from uncompData |
compData | should be able to fit at least GetMaxCompressedBufferSize(uncompSize) bytes |
compDataSize | size of compData buffer |
compSize | length of compressed data written into compData |
|
pure virtual |
Decompress packet. Chunk based decompressors should loop internally in Decompress() to decompress all chunks of compData.
compData | buffer to decompress |
compSize | length of data to decompress from compData |
uncompData | should be able to fit at least GetDecompressedBufferSize(compressedDataSize) |
uncompDataSize | size of uncompData buffer. |
consumedSize | the number of bytes processed out of compData. (previously named chunkSize) |
uncompSize | length of decompressed data written into uncompData |