From 9fdfbecc7aed852b6709f4dfaeeb66d79d60eb22 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Mon, 1 Apr 2024 18:23:06 +0500 Subject: [PATCH] fix big courses upload part 1 --- beatrun/gamemodes/beatrun/gamemode/cl/CoursesDatabase.lua | 4 ++-- beatrun/gamemodes/beatrun/gamemode/sh/BuildMode.lua | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/CoursesDatabase.lua b/beatrun/gamemodes/beatrun/gamemode/cl/CoursesDatabase.lua index 3a8c11e..685324f 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/CoursesDatabase.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/CoursesDatabase.lua @@ -82,7 +82,7 @@ function UploadCourse() local url = domain:GetString() .. "/api/upload" 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) local response = util.JSONToTable(body) @@ -118,7 +118,7 @@ function UpdateCourse(course_code) local url = domain:GetString() .. "/api/update" 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) local response = util.JSONToTable(body) diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/BuildMode.lua b/beatrun/gamemodes/beatrun/gamemode/sh/BuildMode.lua index 610a0c5..4a5ca32 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/BuildMode.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/BuildMode.lua @@ -1009,6 +1009,7 @@ if CLIENT then Course_ID = id end + --[[ concommand.Add("Beatrun_PrintCourse", function(ply, cmd, args, argstr) local dir = "beatrun/courses/" .. game.GetMap() .. "/" local save = file.Read(dir .. args[1] .. ".txt", "DATA") @@ -1019,8 +1020,9 @@ if CLIENT then return end - PrintTable(save) + print(save) end) + --]] net.Receive("BuildMode_Sync", function() local x = net.ReadFloat()