From 490ecea3eac1ad37f729662b9616ffe23e9990d3 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Wed, 24 May 2023 15:05:29 +0500 Subject: [PATCH] yapie --- FIXES.md | 18 +++++++++--- .../entities/entities/br_databank/shared.lua | 8 ++++-- .../beatrun/gamemode/cl/OnlineCourse.lua | 28 ++++++++++--------- .../beatrun/gamemode/sh/DataTheft.lua | 2 +- .../beatrun/gamemode/sh/Endless_Run.lua | 2 -- .../gamemodes/beatrun/gamemode/sh/Grapple.lua | 8 +++--- .../beatrun/gamemode/sh/Quickturn.lua | 2 +- .../beatrun/gamemode/sh/sh_buildmode.lua | 14 +++++++--- 8 files changed, 50 insertions(+), 32 deletions(-) diff --git a/FIXES.md b/FIXES.md index 48799a0..e3439d7 100644 --- a/FIXES.md +++ b/FIXES.md @@ -1,12 +1,22 @@ # Добавлено мной +* Свой сервер онлайн курсов! Для получения API ключа пишите @Jonny_Bro#4226. * Разрешение Overdrive на сервере - *Beatrun_AllowOvedriveInMultiplayer*. * Измение цвета худа - *Beatrun_HUDTextColor*, *Beatrun_HUDCornerColor*, *Beatrun_HUDFloatingXPColor*. * Discord Rich Presence (Нужны модули из lua/bin) * Небольшой толчок камеры при нырянии. * Изменение максимальной скорости - *Beatrun_MaxSpeed* (Спасибо c4nk, я слепой). * Возможность удалять зиплайны от Zipline Gun на ПКМ. - +* Убран ваш SteamID в углу потому что могу. +
# Фиксы с предыдущей версии -* Теперь точно починил сохранение курсов. -* Фикс раскачивающихся верёвок в курсах. -* Фикс загрузки курса если он не сжат. \ No newline at end of file +* *Beatrun_PrintCourse* теперь выдаёт определённый курс, а не все сразу. +* Краш DataTheft при касании дата банка. +* Использование кошки в курсах. +
+# Все фиксы +* Сохранение курсов работает при сжатии и без. +* Быстрый поворот только с руками бегуна (фикс поворотов при прицеливании и т.п.). +* Ошибка при запуске курса. +* Краш DataTheft при касании дата банка. +* Использование кошки в курсах и режимах. +* Сортировка таблицы лидеров выдавала ошибку. \ No newline at end of file diff --git a/beatrun/gamemodes/beatrun/entities/entities/br_databank/shared.lua b/beatrun/gamemodes/beatrun/entities/entities/br_databank/shared.lua index 4735edd..1c054ae 100644 --- a/beatrun/gamemodes/beatrun/entities/entities/br_databank/shared.lua +++ b/beatrun/gamemodes/beatrun/entities/entities/br_databank/shared.lua @@ -119,18 +119,20 @@ hook.Add("HUDPaint", "DataBank", function() end end) -local player = FindMetaTable("Player") +local meta = FindMetaTable("Player") if SERVER then - function player:DataTheft_Bank() + function meta:DataTheft_Bank() local dbtbl = ents.FindByClass("br_databank") - local bank = dbtbl[1] + local bank = dbtbl[math.random(1, #dbtbl)] + --[[ while self:GetNW2Entity("DataBank") == bank do table.Shuffle(dbtbl) bank = dbtbl[1] end + ]] if bank then self:SetNW2Entity("DataBank", bank) diff --git a/beatrun/gamemodes/beatrun/gamemode/cl/OnlineCourse.lua b/beatrun/gamemodes/beatrun/gamemode/cl/OnlineCourse.lua index e54a227..faf40cf 100644 --- a/beatrun/gamemodes/beatrun/gamemode/cl/OnlineCourse.lua +++ b/beatrun/gamemodes/beatrun/gamemode/cl/OnlineCourse.lua @@ -1,4 +1,5 @@ -local apikey = CreateConVar("beatrun_apikey", "0", true, {FCVAR_ARCHIVE, FCVAR_UNLOGGED}) +local apikey = CreateConVar("Beatrun_Apikey", "0", true, {FCVAR_ARCHIVE, FCVAR_UNLOGGED}) +local domain = CreateConVar("Beatrun_Domain", "localhost", true, {FCVAR_ARCHIVE, FCVAR_UNLOGGED}) function UploadCourse() if Course_Name == "" or Course_ID == "" then return print("Can't upload in Freeplay") end @@ -7,8 +8,8 @@ function UploadCourse() local filedata = util.Decompress(file:Read(file:Size())) local function h_success(code, body, headers) - print("YOUR SHARE CODE: ", code) - print("Successfully uploaded course: ", body) + print("Response: ", code) + print("Your Share Code: ", body) end local function h_failed(reason) @@ -16,14 +17,14 @@ function UploadCourse() end local h_method = "POST" - local h_url = "https://example.org/beatrun/upload.php" + local h_url = "http://" .. domain:GetString() .. "/upload.php" local h_type = "text/plain" local h_body = filedata local h_headers = { ["Content-Type"] = "text/plain", ["Content-Length"] = filedata:len(), - ["User-Agent"] = "Beatrun/1.0.0", + ["User-Agent"] = "Valve/Steam HTTP Client 1.0 (4000)", ["Accept-Encoding"] = "gzip, deflate", Authorization = apikey:GetString(), ["Game-Map"] = game.GetMap() @@ -43,19 +44,20 @@ end concommand.Add("Beatrun_UploadCourse", UploadCourse) local GetCourse_Errors = { - ["Bad map"] = "Error: You are not playing on the map this course was intended for.", - ["Invalid API Key"] = "Plese message me for a key.", - ["Bad code"] = "Error: The share code provided is invalid.", - ["Not valid key"] = "Error: The API key used is not valid." + ["Not valid map"] = "Error: You are not playing on the map this course was intended for.", + ["Not valid share code"] = "Error: The share code provided is invalid.", + ["Not valid key"] = "Plese message @Jonny_Bro#4226 for a key.", + ["Ratelimited"] = "You are ratelimited, please try again later!" } function GetCourse(sharecode) - http.Fetch("https://example/beatrun/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] if not errorcode then - print("Success | Code:", code, "Length:", length) - PrintTable(headers) + print("Success! | Response:", code, "Length:", length) + print("Loading course...") + -- PrintTable(headers) LoadCourseRaw(util.Compress(body)) return true @@ -66,7 +68,7 @@ function GetCourse(sharecode) end end, function(message) - print("An error occurred.", message) + print("An error occurred: ", message) return false end, diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua b/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua index 1f6cb92..cd1858e 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/DataTheft.lua @@ -1,7 +1,7 @@ GM_DATATHEFT = 1 DATATHEFT_LOADOUTS = { - {"weapon_ss2_colt", "weapon_ss2_circularsaw"} + {"mg_swhiskey", "mg_mike4"} } if SERVER then diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Endless_Run.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Endless_Run.lua index a6a1c2b..8bba046 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Endless_Run.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Endless_Run.lua @@ -1,5 +1,3 @@ -print("h") - --[[ local prefabs = { basic_floor = { diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua index f9f47c1..9856b94 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Grapple.lua @@ -52,8 +52,8 @@ local zpunchstart = Angle(2, 0, 0) hook.Add("SetupMove", "Grapple", function(ply, mv, cmd) if ply:GetMantle() ~= 0 or ply:GetClimbing() ~= 0 then return end - if not ply:Alive() or (Course_Name ~= "" and ply:GetNW2Int("CPNum", 1) ~= -1 and not ply:GetNW2Entity("Swingrope")) then return end - if GetGlobalBool(GM_INFECTION) --[[and not ply:GetNW2Entity("Swingrope")]] then return end + if not ply:Alive() or Course_Name ~= "" and ply:GetNW2Int("CPNum", 1) ~= -1 and not ply:GetNW2Entity("Swingrope"):IsValid() then return end + if GetGlobalBool(GM_INFECTION) and not ply:GetNW2Entity("Swingrope"):IsValid() then return end local activewep = ply:GetActiveWeapon() local usingrh = IsValid(activewep) and activewep:GetClass() == "runnerhands" @@ -165,8 +165,8 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd) tr.endpos = mv:GetOrigin() local mins, maxs = ply:GetHull() - mins:Mul(1.01) - maxs:Mul(1.01) + mins:Mul(1.2) + maxs:Mul(1.2) tr.mins = mins tr.maxs = maxs diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua b/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua index 1470fac..66e025e 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/Quickturn.lua @@ -1,5 +1,5 @@ if CLIENT then - QuickturnGround = CreateClientConVar("Beatrun_QuickturnGround", "1", true, true, "Enables quickturning with secondary attack while on the ground") + QuickturnGround = CreateClientConVar("Beatrun_QuickturnGround", "0", true, true, "Enables quickturning with secondary attack while on the ground") end function DoJumpTurn(lookbehind) diff --git a/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua b/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua index bb50f31..0c021fe 100644 --- a/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua +++ b/beatrun/gamemodes/beatrun/gamemode/sh/sh_buildmode.lua @@ -962,7 +962,7 @@ if CLIENT then local save = file.Read(dir .. id .. ".txt", "DATA") if not save then - print("NON-EXISTENT SAVE", id) + print("NON-EXISTENT SAVE: ", id) return end @@ -999,10 +999,16 @@ if CLIENT then end concommand.Add("Beatrun_PrintCourse", function(ply, cmd, args, argstr) - local dir = "beatrun/courses/" .. game.GetMap() .. "/*.txt" - local files = file.Find(dir, "DATA", "datedesc") + local dir = "beatrun/courses/" .. game.GetMap() .. "/" + local save = file.Read(dir .. args[1] .. ".txt", "DATA") - PrintTable(files) + if not save then + print("NON-EXISTENT SAVE: ", args[1]) + + return + end + + PrintTable(save) end) net.Receive("BuildMode_Sync", function()