mirror of
https://github.com/JonnyBro/beatrun.git
synced 2025-01-31 20:14:10 +05:00
Cache couse when loaded from database
This commit is contained in:
parent
7f16185de1
commit
cee696a4c8
1 changed files with 11 additions and 1 deletions
|
@ -52,7 +52,17 @@ function GetCourse(sharecode)
|
||||||
|
|
||||||
PrintTable(headers)
|
PrintTable(headers)
|
||||||
|
|
||||||
LoadCourseRaw(util.Compress(body))
|
local dir = "beatrun/courses/" .. game.GetMap() .. "/"
|
||||||
|
|
||||||
|
file.CreateDir(dir)
|
||||||
|
|
||||||
|
local coursedata = util.Compress(body)
|
||||||
|
|
||||||
|
if not file.Exists(dir .. sharecode .. ".txt", "DATA") then
|
||||||
|
file.Write(dir .. sharecode .. ".txt", coursedata)
|
||||||
|
end
|
||||||
|
|
||||||
|
LoadCourseRaw(coursedata)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue