拉取ws消息更不容易爆炸
This commit is contained in:
@@ -1130,6 +1130,7 @@ do
|
|||||||
return
|
return
|
||||||
else
|
else
|
||||||
local res=JSON.decode(message)
|
local res=JSON.decode(message)
|
||||||
|
if res then
|
||||||
if VERSION_CODE>=res.lowest then
|
if VERSION_CODE>=res.lowest then
|
||||||
NET.allow_online=true
|
NET.allow_online=true
|
||||||
end
|
end
|
||||||
@@ -1137,6 +1138,9 @@ do
|
|||||||
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky)
|
LOG.print(text.oldVersion:gsub("$1",res.newestName),180,COLOR.sky)
|
||||||
end
|
end
|
||||||
LOG.print(res.notice,300,COLOR.sky)
|
LOG.print(res.notice,300,COLOR.sky)
|
||||||
|
else
|
||||||
|
WS.alert("app")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif status=="dead"then
|
elseif status=="dead"then
|
||||||
@@ -1165,7 +1169,7 @@ do
|
|||||||
return
|
return
|
||||||
else
|
else
|
||||||
local res=JSON.decode(message)
|
local res=JSON.decode(message)
|
||||||
if not res then return end
|
if res then
|
||||||
if res.message=="Connected"then
|
if res.message=="Connected"then
|
||||||
NET.login=true
|
NET.login=true
|
||||||
if res.id then
|
if res.id then
|
||||||
@@ -1188,6 +1192,9 @@ do
|
|||||||
USER.avatar=res.avatar
|
USER.avatar=res.avatar
|
||||||
FILE.save(USER,"conf/user")
|
FILE.save(USER,"conf/user")
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
WS.alert("user")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1211,7 +1218,11 @@ do
|
|||||||
return
|
return
|
||||||
else
|
else
|
||||||
local res=JSON.decode(message)
|
local res=JSON.decode(message)
|
||||||
|
if res then
|
||||||
--TODO
|
--TODO
|
||||||
|
else
|
||||||
|
WS.alert("chat")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1235,9 +1246,13 @@ do
|
|||||||
return
|
return
|
||||||
else
|
else
|
||||||
local res=JSON.decode(message)
|
local res=JSON.decode(message)
|
||||||
|
if res then
|
||||||
if res.message=="Connected"then
|
if res.message=="Connected"then
|
||||||
SCN.go("net_menu")
|
SCN.go("net_menu")
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
WS.alert("play")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1260,7 +1275,6 @@ do
|
|||||||
end
|
end
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
local res=JSON.decode(message)
|
|
||||||
--TODO
|
--TODO
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user