diff --git a/parts/net.lua b/parts/net.lua index 9aedcfac..2051c0e5 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -476,7 +476,7 @@ function NET.updateWS_play() NET.wsconn_stream() elseif res.action==9 then--Game finished NET.roomState.start=false - NET.watch=false + NET.spectate=false if SCN.socketRead then SCN.socketRead('finish',d)end NET.wsclose_stream() end @@ -522,7 +522,7 @@ function NET.updateWS_stream() end end netPLY.setConnect(d.uid) - NET.watch=d.watch==true + NET.spectate=d.watch==true else if d.watch then netPLY.setWatch(d.uid) diff --git a/parts/player/player.lua b/parts/player/player.lua index 9b8f4b35..8042e773 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -1764,7 +1764,7 @@ function Player:lose(force) end gameOver() self:newTask(#PLAYERS>1 and tick_lose or tick_finish) - if GAME.net then + if GAME.net and not NET.spectate then NET.signal_die() else TASK.new(tick_autoPause) diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index d01839fc..b6a3963e 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -47,7 +47,8 @@ end scene.mouseDown=NULL function scene.mouseMove(x,y)netPLY.mouseMove(x,y)end function scene.touchDown(x,y) - if not playing or noTouch then return end + if not playing then netPLY.mouseMove(x,y)return end + if noTouch then return end local t=VK.on(x,y) if t then @@ -63,9 +64,8 @@ function scene.touchUp(x,y) VK.release(n) end end -function scene.touchMove(x,y) - if not playing then netPLY.mouseMove(x,y)return end - if touchMoveLastFrame or noTouch then return end +function scene.touchMove() + if touchMoveLastFrame or not playing or noTouch then return end touchMoveLastFrame=true local L=tc.getTouches() @@ -237,7 +237,7 @@ function scene.update(dt) checkWarning() --Upload stream - if P1.frameRun-lastUpstreamTime>8 then + if not NET.spectate and P1.frameRun-lastUpstreamTime>8 then local stream if not GAME.rep[upstreamProgress]then ins(GAME.rep,P1.frameRun) diff --git a/parts/scenes/net_rooms.lua b/parts/scenes/net_rooms.lua index 00c86a88..f40b1a58 100644 --- a/parts/scenes/net_rooms.lua +++ b/parts/scenes/net_rooms.lua @@ -29,7 +29,7 @@ local scene={} function scene.sceneInit() BG.set() - NET.watch=false + NET.spectate=false NET.allReady=false NET.connectingStream=false NET.waitingStream=false