整理网络相关全局变量放入NET,删除WSCONN,调整进入联网菜单的逻辑

This commit is contained in:
MrZ626
2021-03-28 02:40:49 +08:00
parent 0cc6840506
commit d34627fab6
6 changed files with 27 additions and 22 deletions

View File

@@ -31,7 +31,6 @@ local scene={}
function scene.sceneBack()
WS.send("play","Q")
WSCONN=false
LOG.print(text.wsDisconnected,"warn")
love.keyboard.setKeyRepeat(true)
end
@@ -123,7 +122,6 @@ end
function scene.gamepadDown(key)
if key=="back"then
if TIME()-lastBackTime<1 then
WSCONN=false
SCN.back()
else
lastBackTime=TIME()
@@ -263,7 +261,7 @@ function scene.update(dt)
local _
local GAME=GAME
if not WSCONN and not SCN.swapping then SCN.back()end
if WS.status("play")~="running"and not SCN.swapping then SCN.back()end
if not playing then
heartBeatTimer=heartBeatTimer+dt
if heartBeatTimer>42 then