拉取ws消息更不容易爆炸

This commit is contained in:
MrZ626
2021-03-29 01:07:00 +08:00
parent ccbe7646da
commit 0233adc184

View File

@@ -1130,6 +1130,7 @@ do
return
else
local res=JSON.decode(message)
if res then
if VERSION_CODE>=res.lowest then
NET.allow_online=true
end
@@ -1137,6 +1138,9 @@ do
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky)
end
LOG.print(res.notice,300,COLOR.sky)
else
WS.alert("app")
end
end
end
elseif status=="dead"then
@@ -1165,7 +1169,7 @@ do
return
else
local res=JSON.decode(message)
if not res then return end
if res then
if res.message=="Connected"then
NET.login=true
if res.id then
@@ -1188,6 +1192,9 @@ do
USER.avatar=res.avatar
FILE.save(USER,"conf/user")
end
else
WS.alert("user")
end
end
end
end
@@ -1211,7 +1218,11 @@ do
return
else
local res=JSON.decode(message)
if res then
--TODO
else
WS.alert("chat")
end
end
end
end
@@ -1235,9 +1246,13 @@ do
return
else
local res=JSON.decode(message)
if res then
if res.message=="Connected"then
SCN.go("net_menu")
end
else
WS.alert("play")
end
end
end
end
@@ -1260,7 +1275,6 @@ do
end
return
else
local res=JSON.decode(message)
--TODO
end
end