玩家死亡消息以服务器为准,录像不同步不再影响结算

This commit is contained in:
MrZ626
2021-04-12 23:10:39 +08:00
parent 0645cec207
commit ca68a8ef87
2 changed files with 8 additions and 1 deletions

View File

@@ -493,7 +493,13 @@ function NET.updateWS_stream()
elseif res.action==3 then--Player leave
--?
elseif res.action==4 then--Player died
--?
local uid=res.data.uid
for _,P in next,PLY_ALIVE do
if P.uid==uid then
P:lose(true)
break
end
end
elseif res.action==5 then--Receive stream
SCN.socketRead("Stream",d)
end

View File

@@ -1724,6 +1724,7 @@ function Player:win(result)
end
function Player:lose(force)
if self.result then return end
if self.type=="remote"and not force then self.waiting=1e99 return end
if self.life>0 and not force then
self.waiting=62
local h=#self.field