ws-app支持接收显示服务器广播信息

This commit is contained in:
MrZ626
2021-06-04 00:00:24 +08:00
parent 69b47c66b4
commit 94d769c01c

View File

@@ -318,22 +318,22 @@ function NET.updateWS_app()
end end
end end
if VERSION.code<res.newestCode then if VERSION.code<res.newestCode then
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,'message') LOG.print(text.oldVersion:gsub("$1",res.newestName),180)
end end
LOG.print(res.notice,300,'message') LOG.print(res.notice,300)
NET.tryLogin(true) NET.tryLogin(true)
elseif res.action==0 then--Get new version info elseif res.action==0 then--Broadcast
--? LOG.print(res.data.message,300)
elseif res.action==1 then--Get notice elseif res.action==1 then--Get notice
--? --?
elseif res.action==2 then--Register elseif res.action==2 then--Register
if res.type=='Self'or res.type=='Server'then if res.type=='Self'or res.type=='Server'then
LOG.print(res.data.message,300,'message') LOG.print(res.data.message,300)
if SCN.cur=='register'then if SCN.cur=='register'then
SCN.back() SCN.back()
end end
else else
LOG.print(res.reason or"Registration failed",300,'message') LOG.print(res.reason or"Registration failed",300)
end end
NET.unlock('register') NET.unlock('register')
elseif res.action==3 then--Get player counts elseif res.action==3 then--Get player counts