fixed online courses

This commit is contained in:
Jonny_Bro (Nikita) 2023-05-25 17:18:41 +05:00
parent ce0c12a55d
commit 492f762989

View file

@ -25,7 +25,7 @@ function UploadCourse()
["Content-Type"] = "text/plain", ["Content-Type"] = "text/plain",
["Content-Length"] = filedata:len(), ["Content-Length"] = filedata:len(),
["User-Agent"] = "Valve/Steam HTTP Client 1.0 (4000)", ["User-Agent"] = "Valve/Steam HTTP Client 1.0 (4000)",
["Accept-Encoding"] = "gzip, deflate", ["Accept-Encoding"] = "gzip",
Authorization = apikey:GetString(), Authorization = apikey:GetString(),
["Game-Map"] = game.GetMap() ["Game-Map"] = game.GetMap()
} }
@ -54,6 +54,8 @@ function GetCourse(sharecode)
http.Fetch("http://" .. domain:GetString() .. "/getcourse.php?sharecode=" .. sharecode .. "&map=" .. game.GetMap() .. "&key=" .. apikey:GetString(), function(body, length, headers, code) http.Fetch("http://" .. domain:GetString() .. "/getcourse.php?sharecode=" .. sharecode .. "&map=" .. game.GetMap() .. "&key=" .. apikey:GetString(), function(body, length, headers, code)
local errorcode = GetCourse_Errors[body] local errorcode = GetCourse_Errors[body]
print(body)
if not errorcode then if not errorcode then
print("Success! | Response:", code, "Length:", length) print("Success! | Response:", code, "Length:", length)
print("Loading course...") print("Loading course...")
@ -73,7 +75,8 @@ function GetCourse(sharecode)
return false return false
end, end,
{ {
["accept-encoding"] = "gzip, deflate" ["User-Agent"] = "Valve/Steam HTTP Client 1.0 (4000)",
["Accept-Encoding"] = "gzip"
}) })
end end