From fe2d34b05795df305593f12136da1cfe72ba3960 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Wed, 12 May 2021 01:44:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9ws=E7=9A=84ping=E9=97=B4?= =?UTF-8?q?=E9=9A=94=E5=92=8C=E8=87=AA=E6=88=91=E8=AE=A4=E5=AE=9A=E6=8E=89?= =?UTF-8?q?=E7=BA=BF=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/websocket.lua | 6 +++--- parts/updateLog.lua | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Zframework/websocket.lua b/Zframework/websocket.lua index 646b75f7..baf8fe5a 100644 --- a/Zframework/websocket.lua +++ b/Zframework/websocket.lua @@ -243,7 +243,7 @@ function WS.connect(name,subPath,body) readCHN=love.thread.newChannel(), lastPingTime=0, lastPongTime=timer(), - pingInterval=26, + pingInterval=12, status='connecting',--connecting, running, dead sendTimer=0, alertTimer=0, @@ -269,7 +269,7 @@ end function WS.setPingInterval(name,time) local ws=wsList[name] - ws.pingInterval=math.max(time or 1,2.6) + ws.pingInterval=math.max(time or 2.6,2.6) end function WS.alert(name) @@ -348,7 +348,7 @@ function WS.update(dt) ws.sendCHN:push("")--ping ws.lastPingTime=time end - if time-ws.lastPongTime>10+3*ws.pingInterval then + if time-ws.lastPongTime>6+2*ws.pingInterval then WS.close(name) end end diff --git a/parts/updateLog.lua b/parts/updateLog.lua index 490648eb..fc59bbcc 100644 --- a/parts/updateLog.lua +++ b/parts/updateLog.lua @@ -45,6 +45,7 @@ return STRING.split([=[ 取消软件锁功能 简化击杀标记 控制台支持滚轮和键盘导航 + 缩短联网ping间隔和自我认定掉线时间 代码: 场景模块支持拖拽文件(夹)事件 允许模式给每个玩家初始化多个任务