退出聊天室会断开连接

This commit is contained in:
MrZ626
2020-12-04 22:18:56 +08:00
parent b6a4412c7b
commit d52e69ac9d
2 changed files with 5 additions and 0 deletions

View File

@@ -25,6 +25,10 @@ function scene.sceneInit()
)
end
function scene.sceneBack()
WSCONN=nil
end
function scene.keyDown(k)
if k=="return"then
sendMessage()

View File

@@ -338,6 +338,7 @@ end
function Tick.wsCONN_read()
while true do
yield()
if not WSCONN then return end
local messages,readErr=client.read(WSCONN)
if messages then
if messages[1]then