Only save/load files for the server #6

Merged
Not merged 1 commits from Lonsfor/srb2k-leaderboard:lonsfor-patch-3 into master 2022-11-14 14:22:44 +01:00
1 changed files with 71 additions and 67 deletions

View File

@ -257,6 +257,7 @@ local function stat_str(stat)
end
-- Read the leaderboard
if isserver then
local f = io.open(FILENAME, "r")
if f then
for l in f:lines() do
@ -312,6 +313,7 @@ if f then
else
print("Failed to open file: ", FILENAME)
end
end
function allowJoin(v)
if not cv_interrupt.value then
@ -1259,6 +1261,7 @@ local function saveTime(player)
StatTrack = true
end
if isserver then
local f = assert(io.open(FILENAME, "w"))
if f == nil then
print("Failed to open file for writing: " + FILENAME)
@ -1284,6 +1287,7 @@ local function saveTime(player)
f:close()
end
end
-- DEBUGGING
--local function saveLeaderboard(player, ...)