From 2a571bbb97acb1d44bf715945f069e4f7b862cce Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 18 May 2021 01:04:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E6=88=98=E5=BD=95=E5=83=8F=E6=B5=81?= =?UTF-8?q?=E5=BC=BA=E8=A1=8C=E5=B0=86=E6=AF=8F=E6=AE=B5=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=95=BF=E5=BA=A6=E8=A1=A5=E8=B6=B3=E5=88=B03=E7=9A=84?= =?UTF-8?q?=E5=80=8D=E6=95=B0=E4=BF=9D=E8=AF=81base64=E5=90=8E=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=B8=8D=E4=BC=9A=E8=A2=AB=E7=AD=89=E5=8F=B7?= =?UTF-8?q?=E5=A1=AB=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/scenes/net_game.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 4b5a2cf1..842576d5 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -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