修复录像(流)的一帧误差问题,移除玩家keyRec属性

This commit is contained in:
MrZ626
2021-02-14 03:15:37 +08:00
parent fd5455e71f
commit b06d07bd47
4 changed files with 49 additions and 57 deletions

View File

@@ -270,30 +270,29 @@ function scene.update(dt)
touchMoveLastFrame=false
updateVirtualkey()
GAME.frame=GAME.frame+1
--Counting, include pre-das
if checkStart()then return end
--Update players
for p=1,#PLAYERS do PLAYERS[p]:update(dt)end
--Warning check
checkWarning()
--Upload stream
if GAME.frame-lastUpstreamTime>8 then
local stream
stream,upstreamProgress=dumpRecording(GAME.rep,upstreamProgress)
if #stream>0 then
wsWrite("S"..data.encode("string","base64",stream))
else
ins(GAME.rep,GAME.frame+1)
ins(GAME.rep,GAME.frame)
ins(GAME.rep,0)
end
lastUpstreamTime=PLAYERS[1].alive and GAME.frame or 1e99
end
--Counting, include pre-das
if checkStart()then return end
--Update players
for p=1,#PLAYERS do
PLAYERS[p]:update(dt)
end
--Warning check
checkWarning()
end
function scene.draw()