3rd Eye Scene C#
3rd Eye Scene C# documentation
|
A utility class for decoding CollatedPacketMessage packets. More...
Public Member Functions | |
bool | SetPacket (PacketBuffer packet) |
Sets the packet to decode. | |
PacketBuffer | Next () |
Extracts the next packet from the collated buffer. | |
Properties | |
bool | Decoding [get] |
True while we have more packets to decode/extract. |
A utility class for decoding CollatedPacketMessage packets.
Unity does not support classes from
System.IO.Compression
, thus we can't use
GZipStream
from there directly. Whilst .Net Core source code is available and can be ported, the managed implementation supports only one, default compression level. The default .Net Core GZip implementation uses native ZLib, which cannot be supported herre to maintain higher platform independence. In the end we use a DotNetZip NuGet package.
PacketBuffer Tes::IO::CollatedPacketDecoder::Next | ( | ) | [inline] |
Extracts the next packet from the collated buffer.
For collated packets, this decodes and decompresses the next packet. For non-collated packets, this simply returns the packet given to PacketBuffer, then
null
on the following call.
bool Tes::IO::CollatedPacketDecoder::SetPacket | ( | PacketBuffer | packet | ) | [inline] |
Sets the packet to decode.
packet |
The packet need not be a collated packet, in which case it will be immediately returned on calling Next(), followed by
null