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, 06:02 PM, (This post was last modified: 07-08-2015, 06:58 PM by LocInt.)
#3
LocInt Offline
Long gone
****
Posts: 489
Threads: 91
Joined: Aug 2014
RE: Can't send compressed data
(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.

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 )

Thanks. Seems to work. Good old magic button.

тѕсм.Person8880 hovers the nerf bat over Tetryon damage
Website 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:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.