尝试修复幽灵玩家问题
This commit is contained in:
@@ -5,11 +5,14 @@ return{
|
||||
},
|
||||
load=function(playerData)
|
||||
PLY.newPlayer(1)
|
||||
if playerData[1]then
|
||||
PLAYERS[1].subID=playerData[1].sid
|
||||
end
|
||||
for i=2,#playerData do
|
||||
PLY.newRemotePlayer(i,false,playerData[i])
|
||||
local N=2
|
||||
for i=1,#playerData do
|
||||
if playerData[i].id==tostring(USER.id)then
|
||||
PLAYERS[1].subID=playerData[1].sid
|
||||
else
|
||||
PLY.newRemotePlayer(N,false,playerData[i])
|
||||
N=N+1
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
@@ -165,12 +165,7 @@ function scene.socketRead(mes)
|
||||
end
|
||||
for i=1,#args do
|
||||
local L=splitStr(args[i],",")
|
||||
L={name=L[1],id=L[2],sid=L[3],conf=L[4],ready=L[5]=="1"}
|
||||
if tostring(USER.id)~=L.id then
|
||||
ins(playerData,L)
|
||||
else
|
||||
ins(playerData,1,L)
|
||||
end
|
||||
ins(playerData,{name=L[1],id=L[2],sid=L[3],conf=L[4],ready=L[5]=="1"})
|
||||
end
|
||||
playerInitialized=true
|
||||
SFX.play("click")
|
||||
|
||||
Reference in New Issue
Block a user