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. |
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. Fortunately, with Microsoft releasing much of the .Net core as open source code, some helpful people at http://www.hitcents.com/ have migrated the
GZipStream
into a Unity asset. This has been imported into the
Tes.IO.Compression
namespace.
The zip code asset is available from here: https://www.assetstore.unity3d.com/en/#!/content/31902 Courtesy of http://www.hitcents.com/
Note: This class is currently very slow in decoding collated and compress packets. Needs to be improved to have less buffer allocation.
PacketBuffer Tes::Util::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::Util::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