修复错解析服务器发送的玩家信息
This commit is contained in:
@@ -292,18 +292,19 @@ function NET.updateWS_play()
|
|||||||
_unlock("fetchRoom")
|
_unlock("fetchRoom")
|
||||||
elseif res.action==1 then--Create room (not used)
|
elseif res.action==1 then--Create room (not used)
|
||||||
elseif res.action==2 then--Player join
|
elseif res.action==2 then--Player join
|
||||||
|
local d=res.data
|
||||||
if res.type=="Self"then
|
if res.type=="Self"then
|
||||||
--Create room
|
--Create room
|
||||||
TABLE.clear(PLY_NET)
|
TABLE.clear(PLY_NET)
|
||||||
ins(PLY_NET,{
|
ins(PLY_NET,{
|
||||||
uid=USER.uid,
|
uid=USER.uid,
|
||||||
username=USER.username,
|
username=USER.username,
|
||||||
sid=data.sid,
|
sid=d.sid,
|
||||||
ready=data.ready,
|
ready=d.ready,
|
||||||
conf=dumpBasicConfig(),
|
conf=dumpBasicConfig(),
|
||||||
})
|
})
|
||||||
if data.players then
|
if d.players then
|
||||||
for _,p in next,data.players do
|
for _,p in next,d.players do
|
||||||
ins(PLY_NET,{
|
ins(PLY_NET,{
|
||||||
uid=p.uid,
|
uid=p.uid,
|
||||||
username=p.username,
|
username=p.username,
|
||||||
@@ -318,11 +319,11 @@ function NET.updateWS_play()
|
|||||||
else
|
else
|
||||||
--Load other players
|
--Load other players
|
||||||
ins(PLY_NET,{
|
ins(PLY_NET,{
|
||||||
uid=data.uid,
|
uid=d.uid,
|
||||||
username=data.username,
|
username=d.username,
|
||||||
sid=data.sid,
|
sid=d.sid,
|
||||||
ready=data.ready,
|
ready=d.ready,
|
||||||
conf=data.config,
|
conf=d.config,
|
||||||
})
|
})
|
||||||
SCN.socketRead("Join",res.data)
|
SCN.socketRead("Join",res.data)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user