![]() |
|
Can't send compressed data - Printable Version +- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk) +-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html) +--- Forum: Starfall (https://teamscm.co.uk/forum-7.html) +--- Thread: Can't send compressed data (/thread-1210.html) |
Can't send compressed data - LocInt - 07-08-2015 Can't send compressed data over using net messages. When I catch the compressed net message it output only "]" and if I try to decompress it well it returns nothing. If I decompress it right after compressing it the data is correct. This means I haven't sent the data yet using net messages. Not sure if compress works either due it doesn't decrease the amount of bytes i'm trying to send. RE: Can't send compressed data - Person8880 - 07-08-2015 Compression is not an "I win" button. It has its place for large strings, and that's it. Compressing tiny amounts of data will not provide any significant improvement. Printing will yield nothing useful as there's likely null bytes that stop the output early. Also, if you want to network compressed data properly, you don't use net.writeString() (as strings are null-terminated and the compressed data is full of null bytes). Instead, you do:
and to read:
RE: Can't send compressed data - LocInt - 07-08-2015 (07-08-2015, 05:49 PM)Person8880 Wrote: Compression is not an "I win" button. It has its place for large strings, and that's it. Compressing tiny amounts of data will not provide any significant improvement. Printing will yield nothing useful as there's likely null bytes that stop the output early. Thanks. Seems to work. Good old magic button. |