修复其他玩家进房check是否已存在的时候因为访问不存在的玩家而报错
This commit is contained in:
@@ -650,7 +650,7 @@ function NET.wsCallBack.room_enter(body)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
local p=body.data
|
local p=body.data
|
||||||
if NETPLY.map[p.playerId] then _playerLeaveRoom(p.playerId) end
|
if NETPLY.exist(p.playerId) then _playerLeaveRoom(p.playerId) end
|
||||||
NETPLY.add{
|
NETPLY.add{
|
||||||
uid=p.playerId,
|
uid=p.playerId,
|
||||||
group=p.group,
|
group=p.group,
|
||||||
|
|||||||
@@ -138,6 +138,9 @@ function NETPLY.remove(uid)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
function NETPLY.exist(uid)
|
||||||
|
return rawget(PLYmap,uid) and true or false
|
||||||
|
end
|
||||||
|
|
||||||
function NETPLY.setPlace(uid,place) PLYmap[uid].place=place end
|
function NETPLY.setPlace(uid,place) PLYmap[uid].place=place end
|
||||||
function NETPLY.setStat(uid,S)
|
function NETPLY.setStat(uid,S)
|
||||||
|
|||||||
Reference in New Issue
Block a user