mirror of
https://github.com/JonnyBro/beatrun.git
synced 2025-04-05 18:36:33 +05:00
Serverside: Fix Beatrun replays
This commit is contained in:
parent
4a47bc71ea
commit
89d9dfbd93
1 changed files with 23 additions and 3 deletions
|
@ -36,7 +36,7 @@ end
|
|||
hook.Add("StartCommand", "ReplayStart", ReplayCmd)
|
||||
|
||||
function ReplayStart(ply)
|
||||
if not game.SinglePlayer() then return end
|
||||
--if not game.SinglePlayer() then return end
|
||||
if ply.InReplay then return end
|
||||
|
||||
print("Starting Replay")
|
||||
|
@ -49,7 +49,7 @@ function ReplayStart(ply)
|
|||
end
|
||||
|
||||
function ReplayStop(ply, debugdump)
|
||||
if not game.SinglePlayer() then return end
|
||||
--if not game.SinglePlayer() then return end
|
||||
if not ply.ReplayTicks then return end
|
||||
if ply.InReplay then return end
|
||||
|
||||
|
@ -140,7 +140,7 @@ function ReplayPlayback(ply, cmd)
|
|||
end
|
||||
|
||||
function ReplaySendToClient(ply)
|
||||
if not game.SinglePlayer() then return end
|
||||
--if not game.SinglePlayer() then return end
|
||||
|
||||
local replaydata = util.JSONToTable(util.Decompress(file.Read("beatrun/replays/" .. game.GetMap() .. "/replaydump.txt", "DATA")))
|
||||
|
||||
|
@ -159,6 +159,26 @@ function ReplaySendToClient(ply)
|
|||
hook.Add("StartCommand", "ReplayPlay", ReplayPlayback)
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
--hook.Add("Tick", "TickReplayRecord", function()
|
||||
-- for _, v in ipairs(player.GetAll()) do
|
||||
-- print(v:UserID())
|
||||
-- if Player(v:UserID()).ReplayRecording then
|
||||
-- print("attempting to record tick")
|
||||
-- ReplayCmd(Player(v:UserID()), Player(v:UserID()):GetCurrentCommand())
|
||||
-- --PrintTable(v.ReplayTicks)
|
||||
-- end -- how not to record replays 101
|
||||
-- end
|
||||
--end)
|
||||
function GM:SetupMove(ply, mv, cmd)
|
||||
if ply.ReplayRecording then
|
||||
print("attempting to record tick")
|
||||
ReplayCmd(ply, cmd)
|
||||
--PrintTable(v.ReplayTicks)
|
||||
end -- how not to record replays 101
|
||||
end
|
||||
end
|
||||
|
||||
if CLIENT then
|
||||
local tab = {
|
||||
["$pp_colour_contrast"] = 0.9,
|
||||
|
|
Loading…
Add table
Reference in a new issue