From cb82489f3335f91d1ad92e51099ea0e044b17916 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 27 Mar 2021 19:23:25 +0800 Subject: [PATCH] =?UTF-8?q?WS=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5=E5=90=8E?= =?UTF-8?q?=E4=BC=9A=E7=AD=89=E4=B8=80=E7=A7=92=EF=BC=8CWS-app=E8=BF=9E?= =?UTF-8?q?=E6=8E=A5=E7=9A=84body=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/gametoolfunc.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index e6043557..f7698d02 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -9,6 +9,7 @@ local sin=math.sin local sub=string.sub local char,byte=string.char,string.byte local ins,rem=table.insert,table.remove +local YIELD=YIELD @@ -1231,8 +1232,11 @@ do message=JSON.decode(message) end end - elseif status~="connecting"then - WS.connect("app","/app") + elseif status=="dead"then + for _=1,60 do YIELD()end + WS.connect("app","/app",JSON.encode{ + version=VERSION_CODE, + }) end end end @@ -1254,6 +1258,11 @@ do message=JSON.decode(message) end end + elseif status=="dead"then + for _=1,60 do YIELD()end + WS.connect("chat","/chat",JSON.encode{ + version=VERSION_CODE, + }) end end end