联网推进(修改房间内用户信息相关代码)

This commit is contained in:
MrZ626
2021-04-06 14:47:29 +08:00
parent 677456456d
commit 24e97e10c8
4 changed files with 17 additions and 10 deletions

View File

@@ -295,6 +295,13 @@ function NET.updateWS_play()
if res.type=="Self"then
--Create room
TABLE.clear(PLY_NET)
ins(PLY_NET,{
uid=USER.id,
name=USER.name,
conf=dumpBasicConfig(),
sid=data.sid,
ready=data.ready,
})
if data.players then
for _,p in next,data.players do
ins(PLY_NET,{
@@ -321,7 +328,7 @@ function NET.updateWS_play()
end
elseif res.action==3 then--Player leave
for i=1,#PLY_NET do
if PLY_NET[i].id==data.uid then
if PLY_NET[i].uid==data.uid then
rem(PLY_NET,i)
break
end