Skip to content

Instantly share code, notes, and snippets.

View Velkon's full-sized avatar

Velkon

View GitHub Profile
SENDING_DATA = false
function net.SendChunk(id, data, ply, callback, max, rate)
max = max or (2^16-2^10)-1
rate = rate or 1/4
assert(not SENDING_DATA)
SENDING_DATA = true
local chunk_count = math.ceil(string.len(data) / max)