1
0
mirror of https://github.com/LDDestroier/CC/ synced 2025-06-26 15:12:52 +00:00

Actually fixed simultaneous messages

This commit is contained in:
LDDestroier 2019-05-02 00:53:13 -04:00 committed by GitHub
parent 091c0d0c13
commit 54f54be8fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,7 +156,7 @@ disknet.receive = function(channel)
local output, contents local output, contents
local doRewrite = false local doRewrite = false
local look = 1
while true do while true do
loadFList() loadFList()
for i = 1, #fList do for i = 1, #fList do
@ -164,20 +164,23 @@ disknet.receive = function(channel)
if contents ~= "" then if contents ~= "" then
contents = textutils.unserialize(contents) contents = textutils.unserialize(contents)
if type(contents) == "table" then if type(contents) == "table" then
if contents[look] then if contents[1] then
if not output then if not output then
if (contents[look].uniqueID ~= uniqueID) and (not msgCheckList[contents[1].messageID]) then for look = 1, #contents do
if getTime() - (contents[look].time or 0) <= 0.01 then if (contents[look].uniqueID ~= uniqueID) and (not msgCheckList[contents[look].messageID]) then
msgCheckList[contents[look].messageID] = true if getTime() - (contents[look].time or 0) <= 0.01 then
output = {} msgCheckList[contents[look].messageID] = true
for k,v in pairs(contents[look]) do output = {}
output[k] = v for k,v in pairs(contents[look]) do
output[k] = v
end
break
end end
end end
else
look = math.min(look + 1, #contents)
end end
end end
-- delete old msesages
doRewrite = false doRewrite = false
for t = #contents, 1, -1 do for t = #contents, 1, -1 do
if getTime() - (contents[t].time or 0) > 0.01 then if getTime() - (contents[t].time or 0) > 0.01 then