Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 12 13 14 15 16 … 18 Next »
Can't send compressed data
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linear Mode
Can't send compressed data
07-08-2015, 05:49 PM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Can't send compressed data
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:
local Size = #CompressedData
net.writeUInt( Size, 32 )
net.writeData( CompressedData, Size )
and to read:
local Size = net.readUInt( 32 )
local Data = net.readData( Size )
Find
Reply
« Next Oldest | Next Newest »


Messages In This Thread
Can't send compressed data - by LocInt - 07-08-2015, 12:36 AM
RE: Can't send compressed data - by Person8880 - 07-08-2015, 05:49 PM
RE: Can't send compressed data - by LocInt - 07-08-2015, 06:02 PM

  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.