forked from Not/srb2k-leaderboard
Only save/load files for the server
This commit is contained in:
parent
a840a5fa83
commit
518e9f7893
@ -257,6 +257,7 @@ local function stat_str(stat)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Read the leaderboard
|
-- Read the leaderboard
|
||||||
|
if isserver then
|
||||||
local f = io.open(FILENAME, "r")
|
local f = io.open(FILENAME, "r")
|
||||||
if f then
|
if f then
|
||||||
for l in f:lines() do
|
for l in f:lines() do
|
||||||
@ -312,6 +313,7 @@ if f then
|
|||||||
else
|
else
|
||||||
print("Failed to open file: ", FILENAME)
|
print("Failed to open file: ", FILENAME)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function allowJoin(v)
|
function allowJoin(v)
|
||||||
if not cv_interrupt.value then
|
if not cv_interrupt.value then
|
||||||
@ -1259,6 +1261,7 @@ local function saveTime(player)
|
|||||||
StatTrack = true
|
StatTrack = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if isserver then
|
||||||
local f = assert(io.open(FILENAME, "w"))
|
local f = assert(io.open(FILENAME, "w"))
|
||||||
if f == nil then
|
if f == nil then
|
||||||
print("Failed to open file for writing: " + FILENAME)
|
print("Failed to open file for writing: " + FILENAME)
|
||||||
@ -1284,6 +1287,7 @@ local function saveTime(player)
|
|||||||
|
|
||||||
f:close()
|
f:close()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- DEBUGGING
|
-- DEBUGGING
|
||||||
--local function saveLeaderboard(player, ...)
|
--local function saveLeaderboard(player, ...)
|
||||||
|
Loading…
Reference in New Issue
Block a user