网战录像流强行将每段数据长度补足到3的倍数保证base64后的数据不会被等号填充

This commit is contained in:
MrZ626
2021-05-18 01:04:13 +08:00
parent 2824bef04a
commit 2a571bbb97

View File

@@ -239,13 +239,17 @@ function scene.update(dt)
--Upload stream
if P1.frameRun-lastUpstreamTime>8 then
local stream
stream,upstreamProgress=DATA.dumpRecording(GAME.rep,upstreamProgress)
if #stream>0 then
NET.uploadRecStream(stream)
else
if not GAME.rep[upstreamProgress]then
ins(GAME.rep,P1.frameRun)
ins(GAME.rep,0)
end
stream,upstreamProgress=DATA.dumpRecording(GAME.rep,upstreamProgress)
if #stream%3==1 then
stream=stream.."\0\0"
elseif #stream%3==2 then
stream=stream.."\0\0\0\0"
end
NET.uploadRecStream(stream)
lastUpstreamTime=PLAYERS[1].alive and P1.frameRun or 1e99
end
else