From 98628e52c80ea22ed6c0ea5a2890d88bd5c14ffc Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 17 六月 2019 14:54:09 +0800
Subject: [PATCH] 7193 【2.0】仙盟联赛修改(无人参赛时所有成员获得拍品收益,不含中途转盟过来的;修复仙盟拍品无人收益时报错bug)

---
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldFamilyWar.py |   14 ++++++++++++++
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/AuctionHouse.py       |   31 +++++++++++++++++--------------
 2 files changed, 31 insertions(+), 14 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/AuctionHouse.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/AuctionHouse.py
index 9ff90b3..302720e 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/AuctionHouse.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/AuctionHouse.py
@@ -464,20 +464,23 @@
             # 拍卖成功收益,都以玩家收益向上取整
             if familyID and auctionItem.FamilyPlayerIDInfo:
                 familyPlayerIDList = json.loads(auctionItem.FamilyPlayerIDInfo)
-                taxRate = IpyGameDataPY.GetFuncCfg("AuctionTaxrate", 2) # 仙盟拍品税率百分比
-                personMaxRate = IpyGameDataPY.GetFuncCfg("AuctionTaxrate", 3) # 仙盟拍品个人最大收益百分比
-                taxGold = max(1, int(bidderPrice * taxRate / 100.0)) # 最少收税1
-                giveTotalGold = max(0, bidderPrice - taxGold)
-                giveMaxGold = int(math.ceil(giveTotalGold * personMaxRate / 100.0))
-                memCount = len(familyPlayerIDList)
-                giveGoldAverage = min(giveMaxGold, int(math.ceil(giveTotalGold * 1.0 / memCount))) # 有收益的人平分
-                
-                # 仙盟拍品收益邮件
-                detail = {"ItemGUID":itemGUID, "ItemID":itemID, "Count":itemCount, "BidderPrice":bidderPrice, "FamilyPlayerIDList":familyPlayerIDList}
-                paramList = [itemID, itemID, auctionItem.BidderName, bidderPrice, taxRate, giveGoldAverage, personMaxRate]
-                PlayerCompensation.SendMailByKey("PaimaiMail6", familyPlayerIDList, [], paramList, gold=giveGoldAverage, 
-                                                 detail=detail, moneySource=ChConfig.Def_GiveMoney_AuctionGain)
-                
+                if familyPlayerIDList:
+                    taxRate = IpyGameDataPY.GetFuncCfg("AuctionTaxrate", 2) # 仙盟拍品税率百分比
+                    personMaxRate = IpyGameDataPY.GetFuncCfg("AuctionTaxrate", 3) # 仙盟拍品个人最大收益百分比
+                    taxGold = max(1, int(bidderPrice * taxRate / 100.0)) # 最少收税1
+                    giveTotalGold = max(0, bidderPrice - taxGold)
+                    giveMaxGold = int(math.ceil(giveTotalGold * personMaxRate / 100.0))
+                    memCount = len(familyPlayerIDList)
+                    giveGoldAverage = min(giveMaxGold, int(math.ceil(giveTotalGold * 1.0 / memCount))) # 有收益的人平分
+                    
+                    # 仙盟拍品收益邮件
+                    detail = {"ItemGUID":itemGUID, "ItemID":itemID, "Count":itemCount, "BidderPrice":bidderPrice, "FamilyPlayerIDList":familyPlayerIDList}
+                    paramList = [itemID, itemID, auctionItem.BidderName, bidderPrice, taxRate, giveGoldAverage, personMaxRate]
+                    PlayerCompensation.SendMailByKey("PaimaiMail6", familyPlayerIDList, [], paramList, gold=giveGoldAverage, 
+                                                     detail=detail, moneySource=ChConfig.Def_GiveMoney_AuctionGain)
+                else:
+                    GameWorld.ErrLog("仙盟拍品没有人获得收益!familyID=%s,itemID=%s,itemGUID=%s" % (familyID, itemID, itemGUID))
+                    
             elif playerID:
                 taxRate = IpyGameDataPY.GetFuncCfg("AuctionTaxrate", 1) # 全服拍品税率百分比
                 taxGold = max(1, int(bidderPrice * taxRate / 100.0)) # 最少收税1
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldFamilyWar.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldFamilyWar.py
index b48ee91..3d1480f 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldFamilyWar.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldFamilyWar.py
@@ -1032,16 +1032,23 @@
     if not family:
         return
     
+    familyAllPlayerIDList = []
     familyPlayerIDList = []
     for i in xrange(family.GetCount()):
         member = family.GetAt(i)
         memPlayerID = member.GetPlayerID()
         if memPlayerID not in PyGameData.g_familyWarMemDict:
             continue
+        familyAllPlayerIDList.append(memPlayerID)
         recData = PyGameData.g_familyWarMemDict[memPlayerID]
+        if GetFWMemFamilyID(recData) != familyID:
+            continue
         if not GetFWMemIsJoin(recData):
             continue
         familyPlayerIDList.append(memPlayerID)
+    if not familyPlayerIDList:
+        familyPlayerIDList = familyAllPlayerIDList
+        GameWorld.Log("连胜没有人参赛,收益算仙盟所有人的!familyID=%s,familyAllPlayerIDList=%s" % (familyID, familyAllPlayerIDList))
         
     familyAuctionItemDict = {} # {仙盟ID:[[享受收益的成员ID, ...], [[拍品ID,个数], [拍品ID,个数,是否拍品], ...]], ...}
     familyAuctionItemDict[familyID] = [familyPlayerIDList, familyAuctionItemList]
@@ -1082,16 +1089,23 @@
             GameWorld.Log("    rank=%s,familyID=%s,仙盟不存在!" % (rank, familyID))
             continue
         
+        familyAllPlayerIDList = []
         familyPlayerIDList = []
         for i in xrange(family.GetCount()):
             member = family.GetAt(i)
             memPlayerID = member.GetPlayerID()
             if memPlayerID not in PyGameData.g_familyWarMemDict:
                 continue
+            familyAllPlayerIDList.append(memPlayerID)
             recData = PyGameData.g_familyWarMemDict[memPlayerID]
+            if GetFWMemFamilyID(recData) != familyID:
+                continue
             if not GetFWMemIsJoin(recData):
                 continue
             familyPlayerIDList.append(memPlayerID)
+        if not familyPlayerIDList:
+            familyPlayerIDList = familyAllPlayerIDList
+            GameWorld.Log("    排名没有人参赛,收益算仙盟所有人的!familyID=%s,familyAllPlayerIDList=%s" % (familyID, familyAllPlayerIDList))
             
         familyAuctionItemList = cfgRankAuctionItemDict[rank]
         familyAuctionItemDict[familyID] = [familyPlayerIDList, familyAuctionItemList]

--
Gitblit v1.8.0