From 60738f90008d8bea155d34a842c87c9e6cf0c66f Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 30 五月 2019 20:44:28 +0800
Subject: [PATCH] 7027 【2.0】【后端】成长基金新增投资限制

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldProcess.py |   43 +++++++++++++++++++++++++++++++++++--------
 1 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldProcess.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldProcess.py
index 9143a93..747aea3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldProcess.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/GameWorldProcess.py
@@ -44,6 +44,7 @@
 import EventShell
 import FBLogic
 import FBCommon
+import ShareDefine
 import EventReport
 import ItemCommon
 import PyGameData
@@ -76,9 +77,7 @@
     #调用副本开启触发器
     FBLogic.OnOpenFB(tick)
     
-    if gameWorld.GetMapID() in ChConfig.Def_CrossDynamicLineMap:
-        msgInfo = str([gameWorld.GetRealMapID(), gameWorld.GetCopyMapID()])
-        GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "DynamicLineMapOpen", msgInfo, len(msgInfo))
+    GameServer_DynamicLineMapStateChange(gameWorld, IPY_GameWorld.fbosOpen)
     return
 
 ## 副本关闭
@@ -97,8 +96,9 @@
     gameFBMgr = gameWorld.GetGameFB() 
     gameFBMgr.SetPlayerLogoffTick(0)
     gameFBMgr.SetIsSafeClose(0)
-
+    
     lineID = gameWorld.GetLineID()
+    copyMapID = gameWorld.GetCopyMapID()
     GameWorld.Log("FB Close! lineID = %s, openState = %s"%(lineID, gameWorld.GetOpenState()))
     
     gameWorld.SetOpenState(IPY_GameWorld.fbosClosed)
@@ -155,9 +155,15 @@
         
     #发送未拾取的物品给玩家
     if mapID in ChConfig.Def_SendUnPickItemMailMapIDList and unPickItemDict:
+        isCrossServer = GameWorld.IsCrossServer()
+        playerServerGroupIDDict = PyGameData.g_crossPlayerServerGroupIDInfo.get(copyMapID, {})
         for ownerID, mailItemList in unPickItemDict.items():
             GameWorld.Log("发送未拾取的物品给玩家: %s" % mailItemList, ownerID)
-            PlayerControl.SendMailByKey("ItemNoPickUp", [ownerID], mailItemList, [gameWorld.GetMapID()])
+            if isCrossServer:
+                serverGroupID = playerServerGroupIDDict.get(ownerID, 0)
+                PlayerControl.SendCrossMail(serverGroupID, "ItemNoPickUp", [ownerID], mailItemList, [gameWorld.GetMapID()])
+            else:
+                PlayerControl.SendMailByKey("ItemNoPickUp", [ownerID], mailItemList, [gameWorld.GetMapID()])
         
     playerManager = gameWorld.GetMapCopyPlayerManager()
     
@@ -171,9 +177,26 @@
     #根据是否收缩型FB处理
     FreeOrClearFBByAutoSize(gameWorld)
     
-    if gameWorld.GetMapID() in ChConfig.Def_CrossDynamicLineMap:
-        msgInfo = str([gameWorld.GetRealMapID(), gameWorld.GetCopyMapID()])
-        GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "DynamicLineMapClose", msgInfo, len(msgInfo))
+    GameServer_DynamicLineMapStateChange(gameWorld, IPY_GameWorld.fbosClosed)
+        
+    gameWorld.SetPropertyID(0)
+    PyGameData.g_crossPlayerServerGroupIDInfo.pop(copyMapID, None)
+    return
+
+def GameServer_DynamicLineMapStateChange(gameWorld, state):
+    if gameWorld.GetMapID() not in ChConfig.Def_CrossDynamicLineMap:
+        return
+    
+    realMapID, copyMapID = gameWorld.GetRealMapID(), gameWorld.GetCopyMapID()
+    if state == IPY_GameWorld.fbosWaitForClose:
+        crossFuncLineDataCache = FBLogic.OnGetCrossFuncLineDataCache()
+        msgInfo = [realMapID, copyMapID, state, crossFuncLineDataCache]
+    else:
+        msgInfo = [realMapID, copyMapID, state]
+        
+    msgInfo = str(msgInfo)
+    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "DynamicLineMapStateChange", msgInfo, len(msgInfo))
+    GameWorld.Log("DynamicLineMapStateChange realMapID=%s, copyMapID=%s, PropertyID=%s, state=%s" % (realMapID, copyMapID, gameWorld.GetPropertyID(), state))
     return
 
 ##根据表中的收缩类型释放或者清空副本状态
@@ -255,6 +278,7 @@
     
     ##踢人
     __KickAllPlayerAndCloseFB(gameWorld, tick)
+    GameServer_DynamicLineMapStateChange(gameWorld, IPY_GameWorld.fbosClosed)
     return
 
 ## 副本踢出玩家逻辑
@@ -609,6 +633,9 @@
 #  @remarks 函数详细说明.
 def CloseFB(tick):
     GameWorld.GetGameWorld().SetCloseFBTick(tick)
+    
+    gameWorld = GameWorld.GetGameWorld()
+    GameServer_DynamicLineMapStateChange(gameWorld, IPY_GameWorld.fbosWaitForClose)
     return
 
 ## 玩家离开地图时,尝试关闭副本

--
Gitblit v1.8.0