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