1
0
mirror of https://github.com/XeonSquared/OC-Copper.git synced 2024-11-11 04:18:06 +11:00

Update culib.lua

This commit is contained in:
20kdc 2017-08-16 15:41:13 +01:00 committed by GitHub
parent de672239be
commit 3da01661ba

View File

@ -55,7 +55,7 @@ return function (hostname, transmit, onReceive, time)
local tuningFlushLoopDetector = 60 local tuningFlushLoopDetector = 60
-- Do not change this value unless protocol has changed accordingly. -- Do not change this value unless protocol has changed accordingly.
local tuningAutorejectLen = 1506 local tuningAutorejectLen = 1507
local loopDetectorNext = time() + tuningFlushLoopDetector local loopDetectorNext = time() + tuningFlushLoopDetector
@ -187,6 +187,7 @@ return function (hostname, transmit, onReceive, time)
end end
culib.refresh = refresh culib.refresh = refresh
culib.output = function (fnam, tnam, message) culib.output = function (fnam, tnam, message)
if message:len() > tuningAutorejectLen then error("Attempted to send too long packet") end
onReceive(fnam, tnam, message) onReceive(fnam, tnam, message)
if tnam == culib.hostname then return end if tnam == culib.hostname then return end
local m = cdlib.encode(0, fnam, tnam, message) local m = cdlib.encode(0, fnam, tnam, message)