springtg / lidgren-network-gen3

Automatically exported from code.google.com/p/lidgren-network-gen3
0 stars 0 forks source link

Feature Request: Compression #170

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I think it would be nice to have the ability to Compress/Decompress our 
Net_Messages. 

My approach needs more testing and but should do it... 

I think there's a better way to do this too - because until now there's no way 
to figure out if the NetIncomingMessage is Compressed or not, maybe a new 
NetIncomingMessageType?? But for now i don't figure out how to accomplish 
this...

Original issue reported on code.google.com by aeronau...@gmail.com on 3 Aug 2014 at 6:15

GoogleCodeExporter commented 9 years ago
Added De/Compress Methode's to the Net_Message's.

For Compression recalculate the m_bitLength of the NetBuffer is seems to be 
necessary. For this i modified the NetBuffer.Data Property.

I think it will be a good idea to use this modified Property in Encryption too 
instead of modifying m_data directly...

At this point we can use:
.Compress() on a NetOutgoingMessage and
.Decompress() on a NetIncomingMessage

And it seems to be Stable for now.

Original comment by aeronau...@gmail.com on 4 Aug 2014 at 8:25

GoogleCodeExporter commented 9 years ago
For Unity System.IO.Compression doesn't work, this is NULLED.

But Ionic.Zip.dll from DotNetZip works fine...

And again new Patch :-)

Original comment by aeronau...@gmail.com on 4 Aug 2014 at 9:16

Attachments:

GoogleCodeExporter commented 9 years ago
Maybe have a enum argument to the compression algorithm for different 
compression algorithms?

.Compress(CompressionAlgorithm.GZip), .Compress(CompressionAlgorithm.Defalte) 
.Compress(CompressionAlgorithm.7z)?

Original comment by kirkmacm...@gmail.com on 29 Aug 2014 at 5:15