Compare commits

...

2 Commits

Author SHA1 Message Date
Not 12ca9aca54 download ghosts if they differ 2023-10-12 18:04:44 +02:00
Not 85e49ecd73 use ST_SEP when resetting ScoreTabe 2023-10-11 18:47:18 +02:00
2 changed files with 23 additions and 3 deletions

View File

@ -75,6 +75,15 @@ local function Columns(line, sep)
}
end
local function compareTables(a, b, ...)
for _, key in ipairs({...}) do
if a[key] != b[key] then
return false
end
end
return true
end
Ghosts = {
map,
players = {},
@ -449,7 +458,7 @@ Client = {
end,
callback = function(data, this)
local header
local header, storedHeader
local cmd = 1
for str in data:gmatch("(.-)\n") do
if Client.data:busy(cmd) then
@ -457,7 +466,18 @@ Client = {
end
header = Index.parseHeader(str)
if not Index:find(header) then
storedHeader = Index:find(header)
if not (
storedHeader
and compareTables(
header,
storedHeader,
"time",
"flags",
"skin",
"color"
)
) then
local tr = Transmitter("GC", {stream = true})
tr:transmit(cmd)
Client.data:listen(header, cmd)

View File

@ -1212,7 +1212,7 @@ local function saveTime(player)
MapRecords = GetMapRecords(gamemap, mapChecksum(gamemap), ST_SEP)
-- Set the updated ScoreTable
ScoreTable = MapRecords[Flags]
ScoreTable = MapRecords[ST_SEP & Flags]
for i, score in ipairs(ScoreTable) do
if score.name != player.name then continue end