添加反联网玩家使用非法块皮肤

检测到联网玩家攻击数量不同步后会直接主动放弃游戏 close #720
This commit is contained in:
MrZ_26
2022-10-26 11:47:52 +08:00
parent 5e9ef8d3ab
commit 8c603fadee
2 changed files with 8 additions and 0 deletions

View File

@@ -410,6 +410,7 @@ function PLY.newRemotePlayer(id,mini,p)
P.uid=p.uid
P.sid=NET.uid_sid[p.uid]
P.group=p.group
P.netAtk=0
if not (P.group%1==0 and P.group>=1 and P.group<=6) then P.group=0 end
_loadRemoteEnv(P,p.config)

View File

@@ -2605,6 +2605,13 @@ local function update_streaming(P)
local line=int(event/0x100000000)%0x10000
for _,p in next,PLY_ALIVE do
if p.sid==sid then
P.netAtk=P.netAtk+amount
if P.netAtk~=P.stat.atk then
MES.new('warn',"#"..P.uid..' desynchronized')
NET.player_finish({foo=""})
P:lose(true)
return
end
P:attack(p,amount,time,line,true)
P:createBeam(p,amount)
break