mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-27 20:43:02 +05:00
yapie
This commit is contained in:
parent
6fd0f963ba
commit
490ecea3ea
8 changed files with 50 additions and 32 deletions
18
FIXES.md
18
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 в углу потому что могу.
|
||||
<br>
|
||||
# Фиксы с предыдущей версии
|
||||
* Теперь точно починил сохранение курсов.
|
||||
* Фикс раскачивающихся верёвок в курсах.
|
||||
* Фикс загрузки курса если он не сжат.
|
||||
* *Beatrun_PrintCourse* теперь выдаёт определённый курс, а не все сразу.
|
||||
* Краш DataTheft при касании дата банка.
|
||||
* Использование кошки в курсах.
|
||||
<br>
|
||||
# Все фиксы
|
||||
* Сохранение курсов работает при сжатии и без.
|
||||
* Быстрый поворот только с руками бегуна (фикс поворотов при прицеливании и т.п.).
|
||||
* Ошибка при запуске курса.
|
||||
* Краш DataTheft при касании дата банка.
|
||||
* Использование кошки в курсах и режимах.
|
||||
* Сортировка таблицы лидеров выдавала ошибку.
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
GM_DATATHEFT = 1
|
||||
|
||||
DATATHEFT_LOADOUTS = {
|
||||
{"weapon_ss2_colt", "weapon_ss2_circularsaw"}
|
||||
{"mg_swhiskey", "mg_mike4"}
|
||||
}
|
||||
|
||||
if SERVER then
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
print("h")
|
||||
|
||||
--[[
|
||||
local prefabs = {
|
||||
basic_floor = {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue