From 267e2dc5445417b43730a71a63b6238b7fd985f5 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Sat, 5 Nov 2022 22:59:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B6=E4=BB=96=E7=8E=A9?= =?UTF-8?q?=E5=AE=B6=E8=BF=9B=E6=88=BFcheck=E6=98=AF=E5=90=A6=E5=B7=B2?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E6=97=B6=E5=80=99=E5=9B=A0=E4=B8=BA?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E7=8E=A9?= =?UTF-8?q?=E5=AE=B6=E8=80=8C=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/net.lua | 2 +- parts/netPlayer.lua | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/parts/net.lua b/parts/net.lua index b8b48801..a1e048f6 100644 --- a/parts/net.lua +++ b/parts/net.lua @@ -650,7 +650,7 @@ function NET.wsCallBack.room_enter(body) end else 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{ uid=p.playerId, group=p.group, diff --git a/parts/netPlayer.lua b/parts/netPlayer.lua index d6b663ab..2973077e 100644 --- a/parts/netPlayer.lua +++ b/parts/netPlayer.lua @@ -138,6 +138,9 @@ function NETPLY.remove(uid) 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.setStat(uid,S)