适配新版玩家连接状态修改方式

This commit is contained in:
MrZ626
2021-05-18 01:45:28 +08:00
parent 5543f29e4f
commit b8597d1518
2 changed files with 6 additions and 8 deletions

View File

@@ -506,8 +506,9 @@ function NET.updateWS_stream()
NET.unlock('wsc_stream')
NET.roomInfo.connectingStream=false
NET.roomInfo.waitingStream=true
netPLY.setConnect(USER.uid)
netPLY.freshStreamConn(res.data.connected)
for _,uid in next,d.connected do
netPLY.setConnect(uid)
end
elseif res.action==0 then--Game start
NET.roomInfo.waitingStream=false
NET.roomInfo.start=true
@@ -515,7 +516,9 @@ function NET.updateWS_stream()
elseif res.action==1 then--Game finished
--?
elseif res.action==2 then--Player join
netPLY.setConnect(d.uid)
if not d.watch then
netPLY.setConnect(d.uid)
end
elseif res.action==3 then--Player leave
--?
elseif res.action==4 then--Player died

View File

@@ -133,11 +133,6 @@ function netPLY.setConnect(uid)
end
end
end
function netPLY.freshStreamConn(list)
for _,p in next,list do
getPLY(p.uid).connected=true
end
end
function netPLY.resetState()
for i=1,#PLY do
PLY[i].ready=false