1
0
mirror of https://github.com/LDDestroier/CC/ synced 2024-12-13 19:50:29 +00:00

Backporting for 1.75

This commit is contained in:
LDDestroier 2019-04-20 23:39:50 -04:00 committed by GitHub
parent 5ad679939d
commit 600aedb8f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1159,6 +1159,14 @@ local drawGrid = function(x, y, onlyDrawGrid, useSetVisible)
tsv(true) tsv(true)
end end
local getTime = function()
if os.epoch then
return os.epoch("utc")
else
return 24 * os.day() + os.time()
end
end
local render = function(useSetVisible, netTime) local render = function(useSetVisible, netTime)
local p = player[you] local p = player[you]
drawGrid(scrollX + scrollAdjX, scrollY + scrollAdjY, false, useSetVisible) drawGrid(scrollX + scrollAdjX, scrollY + scrollAdjY, false, useSetVisible)
@ -1184,7 +1192,7 @@ local render = function(useSetVisible, netTime)
end end
term.setCursorPos(1,2) term.setCursorPos(1,2)
if netTime and useSkynet then if netTime and useSkynet then
ping = (os.epoch("utc") - netTime) ping = (getTime() - netTime)
term.setTextColor(colors.white) term.setTextColor(colors.white)
term.write(" " .. tostring(ping) .. " ms") term.write(" " .. tostring(ping) .. " ms")
end end
@ -1701,7 +1709,7 @@ local sendInfo = function(gameID, doSendTime)
name = player[you].name, name = player[you].name,
putTrail = isPuttingDown, putTrail = isPuttingDown,
gameID = gameID, gameID = gameID,
time = doSendTime and os.epoch("utc"), time = doSendTime and getTime(),
keysDown = isHost and nil or keysDown, keysDown = isHost and nil or keysDown,
trail = isHost and lastTrails or nil, trail = isHost and lastTrails or nil,
deadGuys = isHost and deadGuys or nil, deadGuys = isHost and deadGuys or nil,
@ -2031,7 +2039,7 @@ local startGame = function()
end end
waitingForGame = true waitingForGame = true
cTime = os.epoch("utc") cTime = getTime()
transmit(port, { transmit(port, {
player = player, player = player,
gameID = gamename, gameID = gamename,