mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-28 12:53: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*.
|
* Разрешение Overdrive на сервере - *Beatrun_AllowOvedriveInMultiplayer*.
|
||||||
* Измение цвета худа - *Beatrun_HUDTextColor*, *Beatrun_HUDCornerColor*, *Beatrun_HUDFloatingXPColor*.
|
* Измение цвета худа - *Beatrun_HUDTextColor*, *Beatrun_HUDCornerColor*, *Beatrun_HUDFloatingXPColor*.
|
||||||
* Discord Rich Presence (Нужны модули из lua/bin)
|
* Discord Rich Presence (Нужны модули из lua/bin)
|
||||||
* Небольшой толчок камеры при нырянии.
|
* Небольшой толчок камеры при нырянии.
|
||||||
* Изменение максимальной скорости - *Beatrun_MaxSpeed* (Спасибо c4nk, я слепой).
|
* Изменение максимальной скорости - *Beatrun_MaxSpeed* (Спасибо c4nk, я слепой).
|
||||||
* Возможность удалять зиплайны от Zipline Gun на ПКМ.
|
* Возможность удалять зиплайны от Zipline Gun на ПКМ.
|
||||||
|
* Убран ваш SteamID в углу потому что могу.
|
||||||
|
<br>
|
||||||
# Фиксы с предыдущей версии
|
# Фиксы с предыдущей версии
|
||||||
* Теперь точно починил сохранение курсов.
|
* *Beatrun_PrintCourse* теперь выдаёт определённый курс, а не все сразу.
|
||||||
* Фикс раскачивающихся верёвок в курсах.
|
* Краш DataTheft при касании дата банка.
|
||||||
* Фикс загрузки курса если он не сжат.
|
* Использование кошки в курсах.
|
||||||
|
<br>
|
||||||
|
# Все фиксы
|
||||||
|
* Сохранение курсов работает при сжатии и без.
|
||||||
|
* Быстрый поворот только с руками бегуна (фикс поворотов при прицеливании и т.п.).
|
||||||
|
* Ошибка при запуске курса.
|
||||||
|
* Краш DataTheft при касании дата банка.
|
||||||
|
* Использование кошки в курсах и режимах.
|
||||||
|
* Сортировка таблицы лидеров выдавала ошибку.
|
|
@ -119,18 +119,20 @@ hook.Add("HUDPaint", "DataBank", function()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local player = FindMetaTable("Player")
|
local meta = FindMetaTable("Player")
|
||||||
|
|
||||||
if SERVER then
|
if SERVER then
|
||||||
function player:DataTheft_Bank()
|
function meta:DataTheft_Bank()
|
||||||
local dbtbl = ents.FindByClass("br_databank")
|
local dbtbl = ents.FindByClass("br_databank")
|
||||||
local bank = dbtbl[1]
|
local bank = dbtbl[math.random(1, #dbtbl)]
|
||||||
|
|
||||||
|
--[[
|
||||||
while self:GetNW2Entity("DataBank") == bank do
|
while self:GetNW2Entity("DataBank") == bank do
|
||||||
table.Shuffle(dbtbl)
|
table.Shuffle(dbtbl)
|
||||||
|
|
||||||
bank = dbtbl[1]
|
bank = dbtbl[1]
|
||||||
end
|
end
|
||||||
|
]]
|
||||||
|
|
||||||
if bank then
|
if bank then
|
||||||
self:SetNW2Entity("DataBank", bank)
|
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()
|
function UploadCourse()
|
||||||
if Course_Name == "" or Course_ID == "" then return print("Can't upload in Freeplay") end
|
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 filedata = util.Decompress(file:Read(file:Size()))
|
||||||
|
|
||||||
local function h_success(code, body, headers)
|
local function h_success(code, body, headers)
|
||||||
print("YOUR SHARE CODE: ", code)
|
print("Response: ", code)
|
||||||
print("Successfully uploaded course: ", body)
|
print("Your Share Code: ", body)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function h_failed(reason)
|
local function h_failed(reason)
|
||||||
|
@ -16,14 +17,14 @@ function UploadCourse()
|
||||||
end
|
end
|
||||||
|
|
||||||
local h_method = "POST"
|
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_type = "text/plain"
|
||||||
local h_body = filedata
|
local h_body = filedata
|
||||||
|
|
||||||
local h_headers = {
|
local h_headers = {
|
||||||
["Content-Type"] = "text/plain",
|
["Content-Type"] = "text/plain",
|
||||||
["Content-Length"] = filedata:len(),
|
["Content-Length"] = filedata:len(),
|
||||||
["User-Agent"] = "Beatrun/1.0.0",
|
["User-Agent"] = "Valve/Steam HTTP Client 1.0 (4000)",
|
||||||
["Accept-Encoding"] = "gzip, deflate",
|
["Accept-Encoding"] = "gzip, deflate",
|
||||||
Authorization = apikey:GetString(),
|
Authorization = apikey:GetString(),
|
||||||
["Game-Map"] = game.GetMap()
|
["Game-Map"] = game.GetMap()
|
||||||
|
@ -43,19 +44,20 @@ end
|
||||||
concommand.Add("Beatrun_UploadCourse", UploadCourse)
|
concommand.Add("Beatrun_UploadCourse", UploadCourse)
|
||||||
|
|
||||||
local GetCourse_Errors = {
|
local GetCourse_Errors = {
|
||||||
["Bad map"] = "Error: You are not playing on the map this course was intended for.",
|
["Not valid map"] = "Error: You are not playing on the map this course was intended for.",
|
||||||
["Invalid API Key"] = "Plese message me for a key.",
|
["Not valid share code"] = "Error: The share code provided is invalid.",
|
||||||
["Bad code"] = "Error: The share code provided is invalid.",
|
["Not valid key"] = "Plese message @Jonny_Bro#4226 for a key.",
|
||||||
["Not valid key"] = "Error: The API key used is not valid."
|
["Ratelimited"] = "You are ratelimited, please try again later!"
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetCourse(sharecode)
|
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]
|
local errorcode = GetCourse_Errors[body]
|
||||||
|
|
||||||
if not errorcode then
|
if not errorcode then
|
||||||
print("Success | Code:", code, "Length:", length)
|
print("Success! | Response:", code, "Length:", length)
|
||||||
PrintTable(headers)
|
print("Loading course...")
|
||||||
|
-- PrintTable(headers)
|
||||||
LoadCourseRaw(util.Compress(body))
|
LoadCourseRaw(util.Compress(body))
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
@ -66,7 +68,7 @@ function GetCourse(sharecode)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
function(message)
|
function(message)
|
||||||
print("An error occurred.", message)
|
print("An error occurred: ", message)
|
||||||
|
|
||||||
return false
|
return false
|
||||||
end,
|
end,
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
GM_DATATHEFT = 1
|
GM_DATATHEFT = 1
|
||||||
|
|
||||||
DATATHEFT_LOADOUTS = {
|
DATATHEFT_LOADOUTS = {
|
||||||
{"weapon_ss2_colt", "weapon_ss2_circularsaw"}
|
{"mg_swhiskey", "mg_mike4"}
|
||||||
}
|
}
|
||||||
|
|
||||||
if SERVER then
|
if SERVER then
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
print("h")
|
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
local prefabs = {
|
local prefabs = {
|
||||||
basic_floor = {
|
basic_floor = {
|
||||||
|
|
|
@ -52,8 +52,8 @@ local zpunchstart = Angle(2, 0, 0)
|
||||||
|
|
||||||
hook.Add("SetupMove", "Grapple", function(ply, mv, cmd)
|
hook.Add("SetupMove", "Grapple", function(ply, mv, cmd)
|
||||||
if ply:GetMantle() ~= 0 or ply:GetClimbing() ~= 0 then return end
|
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 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")]] then return end
|
if GetGlobalBool(GM_INFECTION) and not ply:GetNW2Entity("Swingrope"):IsValid() then return end
|
||||||
|
|
||||||
local activewep = ply:GetActiveWeapon()
|
local activewep = ply:GetActiveWeapon()
|
||||||
local usingrh = IsValid(activewep) and activewep:GetClass() == "runnerhands"
|
local usingrh = IsValid(activewep) and activewep:GetClass() == "runnerhands"
|
||||||
|
@ -165,8 +165,8 @@ hook.Add("SetupMove", "Grapple", function(ply, mv, cmd)
|
||||||
tr.endpos = mv:GetOrigin()
|
tr.endpos = mv:GetOrigin()
|
||||||
|
|
||||||
local mins, maxs = ply:GetHull()
|
local mins, maxs = ply:GetHull()
|
||||||
mins:Mul(1.01)
|
mins:Mul(1.2)
|
||||||
maxs:Mul(1.01)
|
maxs:Mul(1.2)
|
||||||
|
|
||||||
tr.mins = mins
|
tr.mins = mins
|
||||||
tr.maxs = maxs
|
tr.maxs = maxs
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if CLIENT then
|
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
|
end
|
||||||
|
|
||||||
function DoJumpTurn(lookbehind)
|
function DoJumpTurn(lookbehind)
|
||||||
|
|
|
@ -962,7 +962,7 @@ if CLIENT then
|
||||||
local save = file.Read(dir .. id .. ".txt", "DATA")
|
local save = file.Read(dir .. id .. ".txt", "DATA")
|
||||||
|
|
||||||
if not save then
|
if not save then
|
||||||
print("NON-EXISTENT SAVE", id)
|
print("NON-EXISTENT SAVE: ", id)
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -999,10 +999,16 @@ if CLIENT then
|
||||||
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() .. "/*.txt"
|
local dir = "beatrun/courses/" .. game.GetMap() .. "/"
|
||||||
local files = file.Find(dir, "DATA", "datedesc")
|
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)
|
end)
|
||||||
|
|
||||||
net.Receive("BuildMode_Sync", function()
|
net.Receive("BuildMode_Sync", function()
|
||||||
|
|
Loading…
Reference in a new issue