From 2af64e0aa0a6d8c4aea5fed79986adfa364a1ace Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 25 十二月 2018 19:38:10 +0800
Subject: [PATCH] 5424 【后端】【1.4】跨服竞技场开发(Add: C1 03 跨服PK玩家历史赛季信息 #tagMCCrossRealmPKPlayerHisSeasonInfo)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py |   33 ++++++++++++++++++++++++++-------
 1 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py
index c2a74b8..17c5a8e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py
@@ -48,6 +48,18 @@
 
 g_npcHurtDict = {}
 
+
+def OnFBPlayerOnLogin(curPlayer):
+    if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_FMTDouble):
+        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_FMTDouble, 1)
+        needViplv = IpyGameDataPY.GetFuncCfg('DemonJarSpecial')
+        if curPlayer.GetVIPLv() >= needViplv:
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FMTOldDouble, 1)
+            GameWorld.DebugLog('1.3版本前可以双倍挑战')
+    NotifyFMTDouble(curPlayer)
+    return
+
+
 ## 是否能够通过活动查询进入
 #  @param curPlayer 玩家实例
 #  @param mapID 地图ID
@@ -185,6 +197,8 @@
 def DoExitFB(curPlayer, tick):
     global g_npcHurtDict
     gameWorld = GameWorld.GetGameWorld()
+    # 清除鼓舞buff
+    FBCommon.ClearEncourageBuff(curPlayer, tick)
     #最后一人
     if gameWorld.GetMapCopyPlayerManager().GetPlayerCount() == 1:
         mapID = GameWorld.GetMap().GetMapID()
@@ -195,11 +209,10 @@
             gameWorld.SetGameWorldDict(FBDict_StartTick % lineID, 0)
             GameWorld.GetGameFB().ClearGameFBDict()
             GameWorldProcess.CloseFB(tick)
-            
+            return
         
     UpdateHPReduceSpeed(tick, True)
-    # 清除鼓舞buff
-    FBCommon.ClearEncourageBuff(curPlayer, tick)
+    
     return
 
 ##玩家主动离开副本.
@@ -263,8 +276,9 @@
     curSpeed = GameWorld.GetGameWorld().GetGameWorldDictByKey(FBDict_Speed % lineID) 
     remainHP = GetBossRemainHP(lineID, tick)
     totalHP = __GetBossTotalHP()
-    
-    fbHelpDict = {FBCommon.Help_lineID:lineID, "hurtInfo":hurtInfo, 'hpReduceSpeed':curSpeed * 10000 / totalHP, 'remainHPPer':min(100, remainHP * 100 / totalHP)}
+    hpReduceSpeed = curSpeed * 10000 / totalHP if totalHP else 0
+    remainHPPer = min(100, remainHP * 100 / totalHP) if totalHP else 0
+    fbHelpDict = {FBCommon.Help_lineID:lineID, "hurtInfo":hurtInfo, 'hpReduceSpeed':hpReduceSpeed, 'remainHPPer':remainHPPer}
     GameWorld.DebugLog("DoFBHelp: %s" % fbHelpDict, curPlayer.GetPlayerID())
     FBCommon.Notify_FBHelp(curPlayer, fbHelpDict)
     return
@@ -449,6 +463,8 @@
                 curPlayer.Sync_TimeTick(ChConfig.tttPickupItem, 0, ChConfig.Def_FBPickupItemTime, True)
         else:
             leaveTick = PlayerControl.GetPlayerLeaveServerTick(playerID)
+            if not leaveTick:
+                continue
             if tick - leaveTick > ChConfig.Def_PlayerOfflineProtectTime:
                 #离线超过3分钟的不给奖励
                 continue
@@ -616,9 +632,11 @@
         return
     playerCnt = GameWorld.GetGameWorld().GetMapCopyPlayerManager().GetPlayerCount()
     playerCnt = playerCnt - 1 if isExit else playerCnt
-    if not playerCnt:
+    if playerCnt <=0:
         return
     lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
+    if lineID < 0:
+        return
     gameWorld = GameWorld.GetGameWorld()
     startTick = gameWorld.GetGameWorldDictByKey(FBDict_StartTick % lineID)
     lastSpeed = gameWorld.GetGameWorldDictByKey(FBDict_Speed % lineID)
@@ -696,7 +714,7 @@
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
     if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_SealDemon:
         return
-    if not PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_FMTDouble):
+    if not curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTOldDouble) and not PlayerVip.GetPrivilegeValue(curPlayer, ChConfig.VIPPrivilege_FMTDouble):
         return
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FMTDouble, clientData.IsDouble)
     NotifyFMTDouble(curPlayer)
@@ -705,6 +723,7 @@
 def NotifyFMTDouble(curPlayer):
     packData = ChPyNetSendPack.tagMCFMTDoubleState()
     packData.IsDouble = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTDouble)
+    packData.OldDouble = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTOldDouble)
     NetPackCommon.SendFakePack(curPlayer, packData)
     return
 

--
Gitblit v1.8.0