mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-29 05:13:02 +05:00
fix big courses upload part 1
This commit is contained in:
parent
19d056bcd7
commit
9fdfbecc7a
2 changed files with 5 additions and 3 deletions
|
@ -82,7 +82,7 @@ function UploadCourse()
|
||||||
|
|
||||||
local url = domain:GetString() .. "/api/upload"
|
local url = domain:GetString() .. "/api/upload"
|
||||||
local data = file.Open("beatrun/courses/" .. currentMap .. "/" .. Course_ID .. ".txt", "rb", "DATA")
|
local data = file.Open("beatrun/courses/" .. currentMap .. "/" .. Course_ID .. ".txt", "rb", "DATA")
|
||||||
local filedata = util.Decompress(data:Read(data:Size())) or data:Read(data:Size())
|
local filedata = data:Read()
|
||||||
|
|
||||||
http.Post(url, NULL, function(body, length, headers, code)
|
http.Post(url, NULL, function(body, length, headers, code)
|
||||||
local response = util.JSONToTable(body)
|
local response = util.JSONToTable(body)
|
||||||
|
@ -118,7 +118,7 @@ function UpdateCourse(course_code)
|
||||||
|
|
||||||
local url = domain:GetString() .. "/api/update"
|
local url = domain:GetString() .. "/api/update"
|
||||||
local data = file.Open("beatrun/courses/" .. currentMap .. "/" .. Course_ID .. ".txt", "rb", "DATA")
|
local data = file.Open("beatrun/courses/" .. currentMap .. "/" .. Course_ID .. ".txt", "rb", "DATA")
|
||||||
local filedata = util.Decompress(data:Read(data:Size())) or data:Read(data:Size())
|
local filedata = data:Read()
|
||||||
|
|
||||||
http.Post(url, NULL, function(body, length, headers, code)
|
http.Post(url, NULL, function(body, length, headers, code)
|
||||||
local response = util.JSONToTable(body)
|
local response = util.JSONToTable(body)
|
||||||
|
|
|
@ -1009,6 +1009,7 @@ if CLIENT then
|
||||||
Course_ID = id
|
Course_ID = id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--[[
|
||||||
concommand.Add("Beatrun_PrintCourse", function(ply, cmd, args, argstr)
|
concommand.Add("Beatrun_PrintCourse", function(ply, cmd, args, argstr)
|
||||||
local dir = "beatrun/courses/" .. game.GetMap() .. "/"
|
local dir = "beatrun/courses/" .. game.GetMap() .. "/"
|
||||||
local save = file.Read(dir .. args[1] .. ".txt", "DATA")
|
local save = file.Read(dir .. args[1] .. ".txt", "DATA")
|
||||||
|
@ -1019,8 +1020,9 @@ if CLIENT then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
PrintTable(save)
|
print(save)
|
||||||
end)
|
end)
|
||||||
|
--]]
|
||||||
|
|
||||||
net.Receive("BuildMode_Sync", function()
|
net.Receive("BuildMode_Sync", function()
|
||||||
local x = net.ReadFloat()
|
local x = net.ReadFloat()
|
||||||
|
|
Loading…
Reference in a new issue