From 7b48b6e603e2eeeacdb737210d74212ed77f7943 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 16 三月 2019 17:38:03 +0800
Subject: [PATCH] 6332 【后端】【2.0】主要是拍品相关规则调整及背包优化(使用拍品数据同步优化)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossRealmPK.py |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossRealmPK.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossRealmPK.py
index 037a68c..faba8bf 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossRealmPK.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossRealmPK.py
@@ -296,14 +296,21 @@
         playerInfoList = []
         for playerID in [playerIDA, playerIDB]:
             player = copyMapPlayerManager.FindPlayerByID(playerID)
+            # 还是离线时间的,走掉线逻辑,越晚掉线的赢;需要加这个逻辑主要是因为当玩家没有触发完整登录流程导致玩家在线但是没有触发DoEnter
+            playerLeaveTick = gameFB.GetGameFBDictByKey(GameFBDict_PlayerLeaveTick % playerID)
+            if playerLeaveTick:
+                pvpDamage, sortTick, curHP, curMaxHP = 0, 0, 0, 0
+                playerInfoList.append([pvpDamage, sortTick, curHP, curMaxHP, playerLeaveTick, playerID, player])
+                GameWorld.Log("PK超时: playerLeaveTick=%s" % (playerLeaveTick), playerID)
+                continue
             pvpDamage = gameFB.GetPlayerGameFBDictByKey(playerID, FBPDict_PVPDamage)
             pvpDamTick = gameFB.GetPlayerGameFBDictByKey(playerID, FBPDict_PVPDamUpdTick)
             sortTick = tick - pvpDamTick
             curHP = 0 if not player else player.GetHP()
             curMaxHP = 0 if not player else player.GetMaxHP()
-            playerInfoList.append([pvpDamage, sortTick, curHP, curMaxHP, playerID, player])
-            GameWorld.Log("PK超时: pvpDamge=%s,pvpDamTick=%s,tick=%s,sortTick=%s,HP=%s/%s" 
-                          % (pvpDamage, pvpDamTick, tick, sortTick, curHP, curMaxHP), playerID)
+            playerInfoList.append([pvpDamage, sortTick, curHP, curMaxHP, playerLeaveTick, playerID, player])
+            GameWorld.Log("PK超时: pvpDamge=%s,pvpDamTick=%s,tick=%s,sortTick=%s,HP=%s/%s,playerLeaveTick=%s" 
+                          % (pvpDamage, pvpDamTick, tick, sortTick, curHP, curMaxHP, playerLeaveTick), playerID)
             
         playerInfoList.sort(reverse=True)
         GameWorld.Log("PK超时, 进入结算!playerInfoList=%s" % str(playerInfoList))
@@ -387,6 +394,9 @@
     prepareTime = fbTimeList[Def_Time_MapPrepare] * 1000
     helpDict["prepareTime"] = prepareTime
     
+    roundNum = gameFB.GetGameFBDictByKey(FB_RoundNum)
+    winnerID = gameFB.GetGameFBDictByKey(FB_RoundWinPlayerID % roundNum)
+    
     nextRoundNum = gameFB.GetGameFBDictByKey(FB_RoundNum) + 1
     gameFB.SetGameFBDict(FB_RoundNum, nextRoundNum)
     
@@ -403,6 +413,9 @@
             GameWorld.DebugLog("复活玩家...", player.GetPlayerID())
             ChPlayer.PlayerRebornByType(player, ChConfig.rebornType_System, tick, isAddSuperBuff=False)
             __ResetPlayerState(gameFB, player, playerID)
+        elif winnerID and playerID != winnerID:
+            GameWorld.DebugLog("平局,输的玩家回满血!", playerID)
+            __ResetPlayerState(gameFB, player, playerID)         
         else:
             __ResetPlayerState(gameFB, player, playerID, False)
                 

--
Gitblit v1.8.0