From e682202b60981a3be8fb28b7b3ea99c8cd27f05b Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Mon, 24 Oct 2022 14:15:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E5=A4=9Aws=E8=BF=9E=E6=8E=A5=E7=82=B8?= =?UTF-8?q?=E6=8E=89=E7=9A=84=E6=97=B6=E5=80=99=E8=87=AA=E5=8A=A8=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=B8=BB=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/net.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/parts/net.lua b/parts/net.lua index 71e01c15..e3898b02 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -720,6 +720,8 @@ function NET.ws_update() while true do TEST.yieldT(1/26) if WS.status('game')=='dead' then + TEST.yieldUntilNextScene() + NET.connectLost() return elseif WS.status('game')=='running' then break @@ -750,7 +752,11 @@ function NET.ws_update() while true do TEST.yieldT(.01)-- Network messages, max 126 FPS is enough - if WS.status('game')=='dead' then return end + if WS.status('game')=='dead' then + TEST.yieldUntilNextScene() + NET.connectLost() + return + end updateOnlineCD=updateOnlineCD%626+1 if updateOnlineCD==1 then NET.global_getOnlineCount() end