From bfa9319169cab043c6cb96a92da91fa3248b220d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 22 八月 2019 18:48:52 +0800
Subject: [PATCH] 8240 【主干】【后端】优化仙界盛典

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py |   30 ++++++----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py                  |   16 ++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py                |    9 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyCeremony.py       |   95 +++++++++++++++++++++++--------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py             |    3 -
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py                                       |   16 ++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                         |    5 +
 7 files changed, 127 insertions(+), 47 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index e2d1905..cf75829 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -26996,6 +26996,9 @@
                   ("Cmd", c_ubyte),
                   ("SubCmd", c_ubyte),
                   ("State", c_ubyte),    #0-不可领 1-可领 2-已领取
+                  ("CTGTotal", c_int),    #本次活动已累计充值,单位元
+                  ("FireworksBuyCount", c_ushort),    #已购买高级烟花数
+                  ("FirewordsScore", c_int),    #当前累计所有烟花总积分
                   ]
 
     def __init__(self):
@@ -27013,6 +27016,9 @@
         self.Cmd = 0xAA
         self.SubCmd = 0x14
         self.State = 0
+        self.CTGTotal = 0
+        self.FireworksBuyCount = 0
+        self.FirewordsScore = 0
         return
 
     def GetLength(self):
@@ -27025,12 +27031,18 @@
         DumpString = '''// AA 14 仙界盛典充值大礼 //tagMCXJSDRecharge:
                                 Cmd:%s,
                                 SubCmd:%s,
-                                State:%d
+                                State:%d,
+                                CTGTotal:%d,
+                                FireworksBuyCount:%d,
+                                FirewordsScore:%d
                                 '''\
                                 %(
                                 self.Cmd,
                                 self.SubCmd,
-                                self.State
+                                self.State,
+                                self.CTGTotal,
+                                self.FireworksBuyCount,
+                                self.FirewordsScore
                                 )
         return DumpString
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index c5e4c78..c9ab7c1 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3457,6 +3457,7 @@
 Def_PDict_LVAwardVIPGetRecord = "LVAwardVIPGetRecord"  # 等级奖励vip领取信息记录,按二进制位标示
 Def_PDict_HistoryChargeAwardGetRecord = "HTotalGoldAwardRecord"  # 历史累计充值奖励领取信息记录,按二进制位标示
 Def_PDict_CTGCountResetTime = "CTGCountResetTime"  # CTG次数重置时间time值
+Def_PDict_TodayCTGCoinTotal = "TodayCTGCoinTotal"  # 当日充值Coin数
 Def_PDict_TodayCTGCount = "TodayCTGCount_%s"  # 当日充值次数,参数(CTG对应的商品记录ID)
 Def_PDict_CTGGoodsBuyCount = "CTGGoodsBuyCount_%s"  # 对应充值商品已购买次数,参数(CTG对应的商品记录ID)
 Def_PDict_GoldGiftFirstRecord = "GoldGiftFirstRecord"  # 首充领取记录,0-未领取;1-已领取
@@ -3665,7 +3666,9 @@
 Def_PDict_FCPartyCurCnt = "FCPartyCurCnt_%s" #全民来嗨活动当前完成次数 参数活动ID
 Def_PDict_FCPartyCurPoint = "FCPartyCurPoint" #全民来嗨活动当前总点数
 Def_PDict_FCPartyAwardRecord = "FCPartyAwardRecord" #全民来嗨活动领奖记录
-Def_PDict_FCCostGold = "FCCostGold"  # 绝版降临总累计消费仙玉
+Def_PDict_FCCTGRMBTotal = "FCCTGRMBTotal"  # 绝版降临总累计充值元
+Def_PDict_FCFireworksBuyCount = "FCFireworksBuyCount"  # 高级烟花已购买次数
+Def_PDict_FCFireworksScore = "FCFireworksScore"  # 总烟花积分,含普通烟花
 
 #新仙界盛典
 Def_PDict_NewFairyCeremonyID = "NewFairyCeremonyID"  # 玩家身上的仙界盛典活动ID,唯一标识,取活动开始日期time值
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index e2d1905..cf75829 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -26996,6 +26996,9 @@
                   ("Cmd", c_ubyte),
                   ("SubCmd", c_ubyte),
                   ("State", c_ubyte),    #0-不可领 1-可领 2-已领取
+                  ("CTGTotal", c_int),    #本次活动已累计充值,单位元
+                  ("FireworksBuyCount", c_ushort),    #已购买高级烟花数
+                  ("FirewordsScore", c_int),    #当前累计所有烟花总积分
                   ]
 
     def __init__(self):
@@ -27013,6 +27016,9 @@
         self.Cmd = 0xAA
         self.SubCmd = 0x14
         self.State = 0
+        self.CTGTotal = 0
+        self.FireworksBuyCount = 0
+        self.FirewordsScore = 0
         return
 
     def GetLength(self):
@@ -27025,12 +27031,18 @@
         DumpString = '''// AA 14 仙界盛典充值大礼 //tagMCXJSDRecharge:
                                 Cmd:%s,
                                 SubCmd:%s,
-                                State:%d
+                                State:%d,
+                                CTGTotal:%d,
+                                FireworksBuyCount:%d,
+                                FirewordsScore:%d
                                 '''\
                                 %(
                                 self.Cmd,
                                 self.SubCmd,
-                                self.State
+                                self.State,
+                                self.CTGTotal,
+                                self.FireworksBuyCount,
+                                self.FirewordsScore
                                 )
         return DumpString
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
index 24147cb..aaf744a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
@@ -72,6 +72,9 @@
 import math
 import time
 
+# 商店类型定义
+ShopType_FairyCeremony = 19 # 仙界盛典烟花
+
 g_mysticalShopDict = {} #神秘商店{等级范围:[等级段,{金钱类型:库}]}
 #---------------------------------------------------------------------
 ##开始交易
@@ -677,7 +680,7 @@
     sendMailKey = mailKey if isLackPack and mailKey else '' #背包不足且配置了mailKey的才发邮件
         
     # 购买限制条件扩展
-    if CheckBuyItemLimitEx(curPlayer, shopType, itemIndex, mainItemID, ipyData.GetLimitValue()):
+    if CheckBuyItemLimitEx(curPlayer, shopType, itemIndex, mainItemID, ipyData.GetLimitValue(), clientBuyCount):
         GameWorld.Log("Store shop item buy limit! shopType=%s,itemIndex=%s,limitValue=%s" 
                       % (shopType, itemIndex, ipyData.GetLimitValue()), curPlayer.GetPlayerID())
         return
@@ -750,11 +753,11 @@
     EventShell.EventRespons_ShopBuy(curPlayer, shopType)
     #curPlayer.ShopResult(itemIndex, IPY_GameWorld.tsrShopOK)
     SyncShoppingResult(curPlayer, itemIndex, clientBuyCount)
-    if itemIndex in IpyGameDataPY.GetFuncEvalCfg('CeremonyFireParty', 1, {}).values():
-        PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_Fireworks, clientBuyCount)
-    if itemIndex in IpyGameDataPY.GetFuncEvalCfg('NewCeremonyFireParty', 1, {}).values():
-        PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_Fireworks, clientBuyCount)
     
+    if shopType == ShopType_FairyCeremony:
+        PlayerFairyCeremony.OnBuyFireworks(curPlayer, itemIndex, clientBuyCount)
+#    if itemIndex in IpyGameDataPY.GetFuncEvalCfg('NewCeremonyFireParty', 1, {}).values():
+#        PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_Fireworks, clientBuyCount)
     return
 
 def GetShopJobItem(job, itemID, jobItemList):
@@ -781,7 +784,7 @@
 ## 商店购买物品限制条件扩展
 #  @param curPlayer 玩家实例
 #  @return 
-def CheckBuyItemLimitEx(curPlayer, shopNPCID, itemIndex, curItemID, limitValue):
+def CheckBuyItemLimitEx(curPlayer, shopNPCID, itemIndex, curItemID, limitValue, clientBuyCount):
     if shopNPCID == 7: #符印商店
         return not PlayerRune.GetIsOpenByRuneID(curPlayer, curItemID)
     if shopNPCID in [8, 9, 10]: #仙盟商店
@@ -796,12 +799,15 @@
         #playerCreateRoleDays = GameWorld.GetCreateRoleDays(curPlayer)
         openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay)+1
         return openServerDay != limitValue
-    #烟花狂欢
-    if itemIndex in IpyGameDataPY.GetFuncEvalCfg('CeremonyFireParty', 1, {}).values():
-        return not PlayerFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
-    if itemIndex in IpyGameDataPY.GetFuncEvalCfg('NewCeremonyFireParty', 1, {}).values():
-        return not PlayerNewFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
-
+    
+    #仙界盛典 - 烟花狂欢
+    if shopNPCID == ShopType_FairyCeremony:
+        return not PlayerFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex, clientBuyCount)
+    
+    #另一个仙界盛典可用其他商店NPCID,这里先注释,之后再改
+#    if itemIndex in IpyGameDataPY.GetFuncEvalCfg('NewCeremonyFireParty', 1, {}).values():
+#        return not PlayerNewFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
+    
     if shopNPCID == 16:#神秘限购
         startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopItemStartTime % itemIndex)
         curTime = int(time.time())
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
index f6e8aba..f9e530f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -115,6 +115,8 @@
 
 
 def OnDay(curPlayer):
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCoinTotal, 0)
+    
     syncRecordIDList = []
     ipyDataMgr = IpyGameDataPY.IPY_Data()
     for i in xrange(ipyDataMgr.GetCTGCount()):
@@ -301,10 +303,13 @@
     curPlayer.SetChangeCoinPointTotal(changeCoinPointBefore + orderCoin, 0)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstGoldTry, 0)
     
+    todayCTGCoinTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCoinTotal) + orderCoin
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCoinTotal, todayCTGCoinTotal)
+    
     goldAfter = curPlayer.GetGold()
     changeCoinPointAfter = curPlayer.GetChangeCoinPointTotal()
     bourseMoneyAfter = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
-    addDRDict.update({"gold":[goldBefore, goldAfter], "changeCoinPoint":[changeCoinPointBefore, changeCoinPointAfter], 
+    addDRDict.update({"gold":[goldBefore, goldAfter], "changeCoinPoint":[changeCoinPointBefore, changeCoinPointAfter], "todayCTGCoinTotal":todayCTGCoinTotal,
                       "bourseMoney":[bourseMoneyBefore, bourseMoneyAfter], "addGold":addGold, "prizeGold":prizeGold, "giveItemList":giveItemList})
     
     DataRecordPack.DR_CTGOK(curPlayer, addDRDict)
@@ -316,7 +321,7 @@
     PlayerGoldGift.DayChargeRedPackAward(curPlayer)
     #累积充值X元
     PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin/100)
-    PlayerFairyCeremony.AddFCCostGold(curPlayer, orderCoin/100)
+    PlayerFairyCeremony.AddFCCTGRMB(curPlayer, orderCoin/100)
     PlayerNewFairyCeremony.AddFCCostGold(curPlayer, orderCoin/100)
     #开服活动
     #OpenServerCampaign.AddOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Recharge, orderCoin)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index f6e28e0..1383abe 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -3039,9 +3039,6 @@
     
     # 消费返利
     PlayerCostRebate.AddCostRebateGold(curPlayer, costType, price, infoDict)
-    # 绝版降临
-#    PlayerFairyCeremony.AddFCCostGold(curPlayer, costType, price)
-#    PlayerNewFairyCeremony.AddFCCostGold(curPlayer, costType, price)
     
     # 事件汇报
     #===========================================================================
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyCeremony.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyCeremony.py
index 6f2f9de..8739747 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyCeremony.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyCeremony.py
@@ -72,10 +72,11 @@
     if FairyCeremonyID == playerFairyCeremonyID:
         #GameWorld.DebugLog("仙界盛典活动ID不变,不处理!", curPlayer.GetPlayerID())
         return
+    ctgRMBTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCoinTotal) / 100
     actWorldLV = actFairyCeremonyInfo.get(ShareDefine.ActKey_WorldLV, 0)
     playerFCWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCActionWorldLV)
-    GameWorld.DebugLog("仙界盛典重置! FairyCeremonyID=%s,playerCostRebateID=%s,state=%s,ActWorldLV=%s,playerFCWorldLV=%s" 
-                       % (FairyCeremonyID, playerFairyCeremonyID, state, actWorldLV, playerFCWorldLV), playerID)
+    GameWorld.DebugLog("仙界盛典重置! FairyCeremonyID=%s,playerCostRebateID=%s,state=%s,ActWorldLV=%s,playerFCWorldLV=%s,ctgRMBTotal=%s" 
+                       % (FairyCeremonyID, playerFairyCeremonyID, state, actWorldLV, playerFCWorldLV, ctgRMBTotal), playerID)
     
     # 未领取的奖励邮件发放
     __SendFairyCeremonyMail(curPlayer, playerFCWorldLV)
@@ -85,15 +86,17 @@
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCActionWorldLV, actWorldLV)
     #重置充值大礼记录
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCRechargeState, 0)
-    SyncFCRechargeInfo(curPlayer)
     #重置全民来嗨
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCPartyCurPoint, 0)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCPartyAwardRecord, 0)
     for actid in ChConfig.PeoplePartyActIDList:
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCPartyCurCnt % actid, 0)
     SyncFCPartyInfo(curPlayer)
-    #重置消费
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCCostGold, 0)
+    #重置已充值RMB及烟花相关
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCCTGRMBTotal, ctgRMBTotal)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCFireworksBuyCount, 0)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCFireworksScore, 0)
+    SyncFCRechargeInfo(curPlayer)
     return True
 
 def __SendFairyCeremonyMail(curPlayer, playerFCWorldLV):
@@ -201,6 +204,9 @@
     ## 通知充值大礼活动状态
     packData = ChPyNetSendPack.tagMCXJSDRecharge()
     packData.State = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCRechargeState)
+    packData.CTGTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCCTGRMBTotal)
+    packData.FireworksBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCFireworksBuyCount)
+    packData.FirewordsScore = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCFireworksScore)
     NetPackCommon.SendFakePack(curPlayer, packData)
     return
 
@@ -284,39 +290,78 @@
     return
 
 #################绝版降临##############################
-def AddFCCostGold(curPlayer, costGold):
-    ##充值X元
-    if costGold <= 0:
+
+def AddFCCTGRMB(curPlayer, ctgRMB):
+    ## 充值X元
+    if ctgRMB <= 0:
         return
-#    if costType in ChConfig.CostRebate_DisableType:
-#        #GameWorld.DebugLog("不计入绝版降临消费的消费类型!costType=%s" % costType, curPlayer.GetPlayerID())
-#        return
     if not __IsAtFCAction():
         return
-    curCostGold = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCCostGold)
-    updCostGold = curCostGold + costGold
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCCostGold, updCostGold)
-    
-    if updCostGold < IpyGameDataPY.GetFuncCfg('CeremonyRankLimit'):
+    curRMBTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCCTGRMBTotal)
+    updRMBTotal = curRMBTotal + ctgRMB
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCCTGRMBTotal, updRMBTotal)
+    GameWorld.Log("更新仙界盛典充值RMB值: curRMBTotal=%s,ctgRMB=%s,updRMBTotal=%s" 
+                  % (curRMBTotal, ctgRMB, updRMBTotal), curPlayer.GetPlayerID())
+    SyncFCRechargeInfo(curPlayer)
+    return
+
+def OnBuyFireworks(curPlayer, itemIndex, clientBuyCount):
+    ## 购买烟花
+    if not __IsAtFCAction():
         return
     
-    #更新排行榜
-    PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_FCCostGold, updCostGold)
+    fireworksDict = IpyGameDataPY.GetFuncEvalCfg('CeremonyFireParty', 1, {})
+    worldLvNum = __GetFCWorldLVIndex(curPlayer, Def_FC_Fireworks)
+    canBuyIDList = fireworksDict.get(str(worldLvNum), []) #[普通烟花, 高级烟花]
+    if itemIndex not in canBuyIDList:
+        return
+    fireworksIndex = canBuyIDList.index(itemIndex)
+    AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_Fireworks, clientBuyCount)
+    if fireworksIndex == 1:
+        fireworksBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCFireworksBuyCount) + clientBuyCount
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCFireworksBuyCount, fireworksBuyCount)
+        GameWorld.DebugLog("更新玩家高级烟花已购买次数: clientBuyCount=%s,fireworksBuyCount=%s" 
+                           % (clientBuyCount, fireworksBuyCount), curPlayer.GetPlayerID())
+        
+    fireworksScoreList = IpyGameDataPY.GetFuncEvalCfg('CeremonyFireParty', 2) # [普通烟花积分, 高级烟花积分]
+    addScore = fireworksScoreList[fireworksIndex] * clientBuyCount
+    curFireworksScore = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCFireworksScore)
+    updFireworksScore = curFireworksScore + addScore
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FCFireworksScore, updFireworksScore)
     
-    GameWorld.DebugLog("玩家绝版降临消费活动: curCostGold=%s,costGold=%s,updCostGold=%s" 
-                       % (curCostGold, costGold, updCostGold), curPlayer.GetPlayerID())
+    billboardNeedScore = IpyGameDataPY.GetFuncCfg('CeremonyFireParty', 4)
+    if updFireworksScore >= billboardNeedScore:
+        #更新排行榜
+        GameWorld.DebugLog("玩家绝版降临积分排行更新: itemIndex=%s,clientBuyCount=%s,curFireworksScore=%s,addScore=%s,updFireworksScore=%s" 
+                           % (itemIndex, clientBuyCount, curFireworksScore, addScore, updFireworksScore), curPlayer.GetPlayerID())
+        PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_FCCostGold, updFireworksScore)
+    else:
+        GameWorld.DebugLog("玩家绝版降临烟花积分不足,无法上榜! updFireworksScore=%s < billboardNeedScore=%s" 
+                           % (updFireworksScore, billboardNeedScore), curPlayer.GetPlayerID())
+        
+    SyncFCRechargeInfo(curPlayer) 
     return
 
 #################烟花狂欢##############################
-def IsCanBuyFireworks(curPlayer, itemIndex):
+def IsCanBuyFireworks(curPlayer, itemIndex, clientBuyCount):
     ##当前是否可以买烟花
     if not __IsAtFCAction():
         GameWorld.Log('    烟花狂欢买烟花 活动未开启, 无法购买')
         return False
     fireworksDict = IpyGameDataPY.GetFuncEvalCfg('CeremonyFireParty', 1, {})
     worldLvNum = __GetFCWorldLVIndex(curPlayer, Def_FC_Fireworks)
-    canBuyID = fireworksDict.get(str(worldLvNum), 0)
-    if canBuyID != itemIndex:
-        GameWorld.Log('    烟花狂欢买烟花 当前可以买烟花为 %s, 无法购买 %s,worldLvNum=%s'%(canBuyID, itemIndex,worldLvNum), curPlayer.GetID())
+    canBuyIDList = fireworksDict.get(str(worldLvNum), []) #[普通烟花, 高级烟花]
+    if itemIndex not in canBuyIDList:
+        GameWorld.Log('    烟花狂欢买烟花 当前可以买烟花为 %s, 无法购买 %s,worldLvNum=%s'%(canBuyIDList, itemIndex,worldLvNum), curPlayer.GetID())
         return False
-    return True
\ No newline at end of file
+    #高级烟花需要判断充值的总额
+    if itemIndex == canBuyIDList[-1]:
+        curRMBTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCCTGRMBTotal)
+        fireworksBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FCFireworksBuyCount)
+        buyOneNeedRMB = IpyGameDataPY.GetFuncCfg('CeremonyFireParty', 3) # 购买一个高级烟花所需充值RMB值,单位X元
+        totalCanBuyCount = curRMBTotal / buyOneNeedRMB
+        if (fireworksBuyCount + clientBuyCount) > totalCanBuyCount:
+            GameWorld.Log('    烟花狂欢买烟花  高级烟花所需重置RMB不足, 无法购买! curRMBTotal=%s,totalCanBuyCount=%s < fireworksBuyCount=%s + clientBuyCount=%s' 
+                          % (curRMBTotal, totalCanBuyCount, fireworksBuyCount, clientBuyCount), curPlayer.GetID())
+            return False
+    return True

--
Gitblit v1.8.0