From 27bc9586f194150f48f914b937c5a98f73a6650e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 09 一月 2019 19:32:20 +0800
Subject: [PATCH] 5722 【后端】【1.5】跨服BOSS开发(支持拾取物品、货币、好物品记录)

---
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
index a9dd91e..36086f0 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
@@ -41,6 +41,7 @@
 import PyGameDataStruct
 import PyDataManager
 import PlayerControl
+import CrossRealmMsg
 import CommFunc
 import PyGameData
 import PlayerGeTui
@@ -529,16 +530,33 @@
 
 ##--------------------------------------------------------------------------------------------------
 
+def CrossServerMsg_DropGoodItem(msgList, tick):
+    ## 收到跨服服务器同步的掉落好物品信息
+    playerID = msgList[0]
+    curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(playerID)
+    if curPlayer:
+        msgList[1] = curPlayer.GetName() # 本服玩家在线,修改为本服玩家的名字展示
+    OnKillBossDropGoodItem(msgList, tick)
+    return
+
 def OnKillBossDropGoodItem(msgList, tick):
     # playerName, mapID, npcID, itemID, userData
-    if len(msgList) != 7:
+    if len(msgList) != 8:
         return
-    playerID, killerName, mapID, npcID, itemID, userData, weightValue = msgList
-    GameWorld.DebugLog("击杀Boss掉落好物品: mapID=%s,npcID=%s,killerName=%s,itemID=%s, userData=%s, weightValue=%s" 
-                       % (mapID, npcID, killerName, itemID, userData, weightValue))
+    playerID, killerName, mapID, npcID, itemID, userData, weightValue, serverGroupID = msgList
+    GameWorld.DebugLog("击杀Boss掉落好物品: mapID=%s,npcID=%s,killerName=%s,itemID=%s, userData=%s, weightValue=%s, serverGroupID=%s" 
+                       % (mapID, npcID, killerName, itemID, userData, weightValue, serverGroupID))
     maxRecordCnt = IpyGameDataPY.GetFuncCfg('DropRecordNum')
     if not maxRecordCnt:
         return
+    
+    if GameWorld.IsCrossServer():
+        # 同步到玩家对应子服
+        if not serverGroupID:
+            return
+        CrossRealmMsg.SendMsgToClientServer(ShareDefine.CrossServerMsg_DropGoodItem, msgList, [serverGroupID])
+        return
+    
     recType = ShareDefine.Def_UniversalGameRecType_BossDropGoodItemInfo
     universalRecMgr = GameWorld.GetUniversalRecMgr()
     recordList = universalRecMgr.GetTypeList(recType)
@@ -568,6 +586,9 @@
         
     PlayerUniversalGameRec.MapServer_UniversalGameRec(None, recType, [mapID, npcID, itemID, playerID, weightValue],
                                                       [killerName, "", userData])
+    
+    msgList = [killerName, playerID, mapID, npcID, itemID, userData]
+    PlayerControl.WorldNotify(0, 'DropRecord' , msgList)
     return
 
 

--
Gitblit v1.8.0