From f05e181ee1f27a3a60c449477acfc6e83d83f5e9 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 15 十二月 2025 19:27:13 +0800
Subject: [PATCH] 121 【武将】武将系统-服务端(优化广播支持按产出格子配置不同的广播;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py         |    4 ++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py |    9 +++++----
 PySysDB/PySysDBPY.h                                                                          |    2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 718fda7..2d956fa 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -1555,7 +1555,7 @@
 	BYTE		LuckyGridNum;	//幸运格子编号
 	dict		GridNumMaxLimitInfo;	//格子最大产出次数限制,{"格子":最大可产出次数, ...}
 	list		NotifyGridNumList;	//需要额外广播的格子
-	char		NotifyKey;	//广播key
+	dict		NotifyKeyDict;	//广播key
 	BYTE		AwardMoneyType;	//额外奖励货币类型
 	WORD		AwardMoneyValue;	//单次奖励货币数
 	BYTE		WishOutput;	//心愿产出规则
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index b2a4aff..a0fed3a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -1264,7 +1264,7 @@
                         ("BYTE", "LuckyGridNum", 0),
                         ("dict", "GridNumMaxLimitInfo", 0),
                         ("list", "NotifyGridNumList", 0),
-                        ("char", "NotifyKey", 0),
+                        ("dict", "NotifyKeyDict", 0),
                         ("BYTE", "AwardMoneyType", 0),
                         ("WORD", "AwardMoneyValue", 0),
                         ("BYTE", "WishOutput", 0),
@@ -4016,7 +4016,7 @@
     def GetLuckyGridNum(self): return self.attrTuple[15] # 幸运格子编号 BYTE
     def GetGridNumMaxLimitInfo(self): return self.attrTuple[16] # 格子最大产出次数限制,{"格子":最大可产出次数, ...} dict
     def GetNotifyGridNumList(self): return self.attrTuple[17] # 需要额外广播的格子 list
-    def GetNotifyKey(self): return self.attrTuple[18] # 广播key char
+    def GetNotifyKeyDict(self): return self.attrTuple[18] # 广播key dict
     def GetAwardMoneyType(self): return self.attrTuple[19] # 额外奖励货币类型 BYTE
     def GetAwardMoneyValue(self): return self.attrTuple[20] # 单次奖励货币数 WORD
     def GetWishOutput(self): return self.attrTuple[21] # 心愿产出规则 BYTE
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
index ebc0dea..05afc6a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
@@ -361,7 +361,7 @@
     GameWorld.DebugLog("beSureCountDict=%s" % beSureCountDict, playerID)
     GameWorld.DebugLog("ensureCount=%s, %s" % (ensureCount, ensureRateList), playerID)
     notifyGridNumList = setIpyData.GetNotifyGridNumList() # 额外需要广播的格子,幸运必出、次数必出可不配置
-    notifyKey = setIpyData.GetNotifyKey()
+    notifyKeyDict = setIpyData.GetNotifyKeyDict()
     gridNumMaxLimitInfo = setIpyData.GetGridNumMaxLimitInfo() # {"格子":最大可产出次数, ...}
     gridNumCountInfo = {} # 有限制产出次数的格子已经产出数
     for gridNumStr in gridNumMaxLimitInfo.keys():
@@ -647,17 +647,18 @@
         itemObj = ItemControler.GetOutPutItemObj(itemID, itemCount, isBind, curPlayer=curPlayer)
         mailItemDict = ItemCommon.GetMailItemDict(itemObj)
         
-        if int(gridNum) in notifyGridNumList and notifyKey:
+        if int(gridNum) in notifyGridNumList and notifyKeyDict:
+            notifyKey = notifyKeyDict.get(int(gridNum), notifyKeyDict.get(0, ""))
             if treasureType in TreasureType_HeroCallList:
                 if PlayerHero.GetHeroActivite(curPlayer, itemID):
                     notifyKey = ""
                     GameWorld.DebugLog("招募武将非首次获得的不广播了! itemID=%s" % itemID, playerID)
-                else:
+                elif notifyKey:
                     heroIpyData = IpyGameDataPY.GetIpyGameData("Hero", itemID)
                     if heroIpyData:
                         heroQuality = heroIpyData.GetQuality()
                         PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), heroQuality, itemID])
-            else:
+            elif notifyKey:
                 PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), itemID, itemObj.GetUserData(), itemCount])
             
         if mailItemList or not itemControl.PutInItem(packType, itemObj, event=[ChConfig.ItemGive_Treasure, False, {}]):

--
Gitblit v1.8.0