4char padding, do proper string concat on map..checksum
This commit is contained in:
parent
907c07a25d
commit
db0696294b
@ -165,7 +165,7 @@ local function mapChecksum(mapnum)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local digest = string.format("%02x", djb2(mh.lvlttl+mh.subttl+mh.zonttl))
|
local digest = string.format("%04x", djb2(mh.lvlttl+mh.subttl+mh.zonttl))
|
||||||
return string.sub(digest, #digest - 3)
|
return string.sub(digest, #digest - 3)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -173,13 +173,13 @@ local function setST(t, map, flags, scoreTable)
|
|||||||
local mode = flags & ST_SEP
|
local mode = flags & ST_SEP
|
||||||
local cks = mapChecksum(map)
|
local cks = mapChecksum(map)
|
||||||
t[mode] = t[mode] or {}
|
t[mode] = t[mode] or {}
|
||||||
t[mode][map + (cks or "")] = scoreTable
|
t[mode][tostring(map)..(cks or "")] = scoreTable
|
||||||
end
|
end
|
||||||
|
|
||||||
local function getST(t, map, flags)
|
local function getST(t, map, flags)
|
||||||
local mode = flags & ST_SEP
|
local mode = flags & ST_SEP
|
||||||
local cks = mapChecksum(map)
|
local cks = mapChecksum(map)
|
||||||
return t[mode] and t[mode][map + (cks or "")] or nil
|
return t[mode] and t[mode][tostring(map)..(cks or "")] or nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local function setScoreTable(map, flags, scoreTable)
|
local function setScoreTable(map, flags, scoreTable)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user