自动登录时机修改为ws-app连接成功并且版本是最新

This commit is contained in:
MrZ626
2021-04-11 20:43:29 +08:00
parent 15d8bbead9
commit 6fbec2b298
2 changed files with 6 additions and 4 deletions

View File

@@ -259,7 +259,12 @@ function NET.updateWS_app()
if res then
if res.type=="Connect"then
NET.connected=true
NET.allow_online=VERSION.code>=res.lowest
if VERSION.code>=res.lowest then
NET.allow_online=true
if USER.authToken then
NET.wsconn_user_token(USER.uid,USER.authToken)
end
end
if VERSION.code<res.newestCode then
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky)
end

View File

@@ -181,9 +181,6 @@ local loadingThread=coroutine.wrap(function()
TASK.new(NET.updateWS_user)
TASK.new(NET.updateWS_play)
NET.wsconn_app()
if USER.authToken then
NET.wsconn_user_token(USER.uid,USER.authToken)
end
while true do
if math.random()<.126 then