修改ws的ping间隔和自我认定掉线时间

This commit is contained in:
MrZ626
2021-05-12 01:44:21 +08:00
parent e3b36c8ad1
commit fe2d34b057
2 changed files with 4 additions and 3 deletions

View File

@@ -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

View File

@@ -45,6 +45,7 @@ return STRING.split([=[
取消软件锁功能
简化击杀标记
控制台支持滚轮和键盘导航
缩短联网ping间隔和自我认定掉线时间
代码:
场景模块支持拖拽文件(夹)事件
允许模式给每个玩家初始化多个任务