Lua loaded records #9

Merged
Not merged 21 commits from partition into master 2022-12-06 18:05:51 +00:00
Showing only changes of commit 3c5234f7b2 - Show all commits

View File

@ -275,8 +275,6 @@ local function moveRecords(from, to, modeSep)
return 0
end
local moveCount = #store[from.id][from.checksum]
store[to.id] = $ or {}
store[to.id][to.checksum] = $ or {}
for i, score in ipairs(store[from.id][from.checksum]) do
@ -287,24 +285,21 @@ local function moveRecords(from, to, modeSep)
-- Destroy the original table
store[from.id][from.checksum] = nil
return moveCount
end
-- move livestore records and write to disk
local moveCount = moveRecordsInStore(LiveStore)
dumpStoreToFile(LEADERBOARD_FILE, LiveStore)
moveRecordsInStore(LiveStore)
-- move coldstore records
if isserver then
dumpStoreToFile(LEADERBOARD_FILE, LiveStore)
-- move coldstore records
local ok, coldstore = pcall(loadStoreFile, COLDSTORE_FILE)
if ok and coldstore then
moveRecordsInStore(coldstore)
dumpStoreToFile(COLDSTORE_FILE, coldstore)
end
end
return moveCount
end
rawset(_G, "lb_move_records", moveRecords)