From ac4f3139e69d4671a46a299df51159f018a5da13 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 26 十一月 2019 11:35:00 +0800
Subject: [PATCH] 8346 【恺英】【后端】协助系统(封包、表)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py |  118 ++++++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 100 insertions(+), 18 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
index 1689677..a8a08f3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
@@ -18,9 +18,11 @@
 import IPY_GameWorld
 import PlayerControl
 import GameWorldProcess
+import CrossRealmPlayer
 import PlayerSuccess
 import ReadChConfig
 import ShareDefine
+import PyGameData
 import FBCommon
 import GameMap
 import GameObj
@@ -270,6 +272,12 @@
 #  @return None
 #  @remarks 函数详细说明.
 def DoFB_Player_KillNPC(curPlayer , curNPC , tick):
+    mapID = PlayerControl.GetCustomMapID(curPlayer)
+    lineID = PlayerControl.GetCustomLineID(curPlayer)
+    if mapID:
+        DoCustomScene_Player_KillNPC(curPlayer, curNPC, mapID, lineID)
+        return
+    
     do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
     
     callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "DoFB_Player_KillNPC"))
@@ -484,6 +492,29 @@
 def DoEnterFBLogic(curPlayer, tick):
     curPlayerID = curPlayer.GetID()
     
+    if GameWorld.IsCrossServer():
+        mapID = GameWorld.GetMap().GetMapID()
+        mapID = FBCommon.GetRecordMapID(mapID)
+        if mapID in ChConfig.Def_CrossDynamicLineMap:
+            fbZoneID = FBCommon.GetCrossDynamicLineMapZoneID()
+            fbFuncLineID = FBCommon.GetCrossDynamicLineMapFuncLineID()
+            playerZoneID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBZoneID)
+            playerFuncLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBFuncLine)
+            if fbZoneID != playerZoneID or fbFuncLineID != playerFuncLineID:
+                GameWorld.ErrLog("DoEnterFB 玩家与当前副本线路所属分区或功能分线不同,踢出玩家!fbZoneID=%s,playerZoneID=%s,fbFuncLineID=%s,playerFuncLineID=%s" 
+                                 % (fbZoneID, playerZoneID, fbFuncLineID, playerFuncLineID), curPlayerID)
+                CrossRealmPlayer.PlayerExitCrossServer(curPlayer)
+                return
+            GameWorld.Log("玩家进入跨服副本动态分配的线路: fbZoneID=%s,playerZoneID=%s,fbFuncLineID=%s,playerFuncLineID=%s" 
+                          % (fbZoneID, playerZoneID, fbFuncLineID, playerFuncLineID), curPlayerID)
+            
+        gameWorld = GameWorld.GetGameWorld()
+        copyMapID = gameWorld.GetCopyMapID()
+        if copyMapID not in PyGameData.g_crossPlayerServerGroupIDInfo:
+            PyGameData.g_crossPlayerServerGroupIDInfo[copyMapID] = {}
+        playerServerGroupIDDict = PyGameData.g_crossPlayerServerGroupIDInfo[copyMapID]
+        playerServerGroupIDDict[curPlayerID] = PlayerControl.GetPlayerServerGroupID(curPlayer)
+        
     # 自伸缩副本根据玩家进入开启,主动调用一次,避免间隔调用时机未触发导致逻辑错乱
     GameWorldProcess.EnterOpenFB(tick)
     
@@ -494,9 +525,8 @@
     gameMap = GameWorld.GetMap()
     gameMapID = gameMap.GetMapID()
     
-    #如果已经设置过副本功能线路属性,则进入时同步玩家,一般下线重登或者非第一个进入该副本的玩家(如队友)会收到该包
-    if FBCommon.GetHadSetFBPropertyMark() and gameMap.GetMapFBType() != IPY_GameWorld.fbtSingle:
-        PlayerControl.SetFBFuncLineID(curPlayer, FBCommon.GetFBPropertyMark())
+    reqFuncLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
+    PlayerControl.SetFBFuncLineID(curPlayer, reqFuncLineID)
         
     #成长NPC所需数据初始化
     InitFBNPCStrengthenData(curPlayer, gameMap)
@@ -508,6 +538,10 @@
     if gameMap.GetMapFBType() == IPY_GameWorld.fbtNull:
         return
     
+    #进入副本默认回满血
+    if curPlayer.GetHP() < curPlayer.GetMaxHP():
+        curPlayer.SetHP(curPlayer.GetMaxHP())
+        
     #副本管理器
     gameFBMgr = GameWorld.GetGameFB()
     
@@ -536,6 +570,9 @@
     if callFunc != None:
         GameWorld.Log("DoEnterFBLogic...", curPlayer.GetPlayerID())
         callFunc(curPlayer, tick)
+    #扣费一般都是在进入副本逻辑里处理,免费只有一次性的,所以放在后面进行重置,防止一直免费
+    if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFBFree):
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_EnterFBFree, 0)
     return
 
 def OnCallHelpBattleOK(curPlayer, tick):
@@ -763,6 +800,18 @@
     
     #执行副本逻辑
     return callFunc(curPlayer, mapID, lineID)
+
+## 是否可以获得副本地图区域经验
+def OnCanGetAreaExp(curPlayer, mapID):
+    do_FBLogic_ID = __GetFBLogic_MapID(mapID)
+    
+    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCanGetAreaExp"))
+    
+    if callFunc == None:
+        return True
+    
+    #执行副本逻辑
+    return callFunc(curPlayer)
 
 ## 是否可以开始收集
 #  @param curPlayer 当前玩家
@@ -1539,7 +1588,7 @@
     callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnEnterFBEvent"))
     
     if callFunc == None:
-        return False
+        return True
     
     return callFunc(curPlayer, mapID, lineID, tick)
 
@@ -1555,9 +1604,10 @@
     callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnGetFBEnterPos"))
     
     if callFunc == None:
-        return
-    
-    posInfo = callFunc(curPlayer, mapID, lineId, ipyEnterPosInfo, tick)
+        posInfo = ipyEnterPosInfo
+    else:
+        posInfo = callFunc(curPlayer, mapID, lineId, ipyEnterPosInfo, tick)
+        
     if not posInfo:
         return
     enterX, enterY = posInfo[:2]
@@ -2154,29 +2204,50 @@
     
     return callFunc(curPlayer, mapID, lineID)
 
-## 客户端发送刷新自定义副本奖励
-def OnRefreshCustomFBPrize(curPlayer, mapID, lineID):
+## 判断可否召唤木桩怪
+def OnCanSummonPriWoodPile(curPlayer, mapID, lineID, npcID, count):
     do_FBLogic_ID = __GetFBLogic_MapID(mapID)
     
-    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnRefreshCustomFBPrize"))
+    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCanSummonPriWoodPile"))
     
     if callFunc == None:
-        return []
+        return True
     
-    return callFunc(curPlayer, mapID, lineID)
+    return callFunc(curPlayer, mapID, lineID, npcID, count)
 
-## 给自定义副本奖励后续处理
-## @return: 返回结算副本over信息字典,不含jsonItem信息
-def OnGiveCustomFBPrizeOK(curPlayer, mapID, lineID):
+## 自定义场景副本击杀NPC
+def DoCustomScene_Player_KillNPC(curPlayer, curNPC, mapID, lineID):
     do_FBLogic_ID = __GetFBLogic_MapID(mapID)
     
-    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnGiveCustomFBPrizeOK"))
+    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "DoCustomScene_Player_KillNPC"))
+    
+    if callFunc:
+        callFunc(curPlayer, curNPC, mapID, lineID)
+        
+    return
+
+## 自定义场景采集OK,需自带是否允许采集的判断
+def OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
+    do_FBLogic_ID = __GetFBLogic_MapID(mapID)
+    
+    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCustomSceneCollectOK"))
+    
+    if callFunc:
+        return callFunc(curPlayer, mapID, lineID, npcID)
+        
+    return
+
+## 进入跨服副本注册数据前逻辑
+## @return: 是否可以注册前往跨服副本,次函数中可以写一些扣除消耗逻辑等
+def OnRegEnterCrossFB(curPlayer, mapID, lineID):
+    do_FBLogic_ID = __GetFBLogic_MapID(mapID)
+    
+    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnRegEnterCrossFB"))
     
     if callFunc == None:
-        return {}
+        return True
     
     return callFunc(curPlayer, mapID, lineID)
-
 
 ## 结束跨服副本
 def OnEndCrossFB(curPlayer, mapID, lineID, exData):
@@ -2197,6 +2268,17 @@
         return
     return callFunc()
 
+## 是否需要做进入副本通用检查条件逻辑,默认需要检查
+def OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID):
+    do_FBLogic_ID = __GetFBLogic_MapID(mapID)
+    
+    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnNeedCheckCanEnterFBComm"))
+    
+    if callFunc == None:
+        return True
+    
+    return callFunc(curPlayer, mapID, lineID)
+
 def OnPlayerLVUp(curPlayer):
     ## 玩家升级
     do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())

--
Gitblit v1.8.0