Compare commits

..

No commits in common. "ef620772d90b318f95b3b3ca9602835ddce60e15" and "12ca9aca540adf0a53610a24daa9d94284bd0e20" have entirely different histories.

View File

@ -123,16 +123,9 @@ Ghosts = {
this:reset()
local headers = Index:getMap(gamemap, mapChecksum(gamemap))
local ok, data
local data
for _, header in ipairs(headers) do
ok, data = pcall(Ghost.read, header, Ghost.tableReader)
if not ok then
print(data)
print("\x85\ERROR:\x80 invalid ghost data, removing entry")
Index:remove(header)
Index:write()
continue
end
data = Ghost.read(header, Ghost.tableReader)
this:set(header, data)
end
end,
@ -413,10 +406,6 @@ Server = {
transmitters = {},
callback = function(cmd, handle)
if handle.transmitters[cmd] then
return
end
local mapindex = Index:getMap(gamemap, mapChecksum(gamemap))
local header = assert(mapindex[tonumber(cmd)])
local data = Ghost.read(header, Ghost.stringReader)
@ -590,7 +579,7 @@ local function open(filename, mode, fn)
f:close()
if not ok then
err = string.format("%s\n(\x82%s\x80 (%s))", err, filename, mode)
err = string.format("%s\n(%s (%s))", err, filename, mode)
end
return ok, err
@ -613,17 +602,6 @@ Index = {
this:setMap(header.map, header.checksum, map)
end,
remove = function(this, header)
local map = this:getMap(header.map, header.checksum)
for i, h in ipairs(map) do
if h.player == header.player then
map[i] = nil
this:setMap(header.map, header.checksum, map)
return
end
end
end,
find = function(this, header)
local index = this:getMap(header.map, header.checksum)
for i, h in ipairs(index) do
@ -667,10 +645,10 @@ Index = {
map = c:next(),
checksum = c:next(),
player = c:next(),
time = tonumber(c:next()),
flags = tonumber(c:next()),
time = c:next(),
flags = c:next(),
skin = c:next(),
color = tonumber(c:next())
color = c:next()
}
end,