From 54b3ca452de08e8cf5723a0715cc0c3853c2df3a Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 01 十二月 2018 16:35:48 +0800
Subject: [PATCH] 2549 【BUG】【1.3】玩家登录时过天处理离线期间所获得的助战仙缘币异常

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py |   35 ++++++++++++++++++++++++++++++-----
 1 files changed, 30 insertions(+), 5 deletions(-)

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 d193fba..709c322 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -56,6 +56,27 @@
 def GetCoinRate(): return IpyGameDataPY.GetFuncCfg("PayRMB")
 
 def OnLogin(curPlayer):
+    
+    # 重置充值次数
+    if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_CTGDoublePrize):
+        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_CTGDoublePrize, 1)
+        ipyDataMgr = IpyGameDataPY.IPY_Data()
+        for i in xrange(ipyDataMgr.GetCTGCount()):
+            ipyData = ipyDataMgr.GetCTGByIndex(i)
+            recordID = ipyData.GetRecordID()
+            totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
+            todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID)
+            if not totalBuyCount and not todayBuyCount:
+                continue
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, 0)
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, 0)
+            drDict = {"PlayerID":curPlayer.GetPlayerID(),"AccID":curPlayer.GetAccID(), "totalBuyCount":totalBuyCount, "todayBuyCount":todayBuyCount, "recordID":recordID}
+            DataRecordPack.SendEventPack("ResetCTGCount", drDict, curPlayer)
+            GameWorld.Log("重置充值次数: recordID=%s,totalBuyCount=%s,todayBuyCount=%s" 
+                          % (recordID, totalBuyCount, todayBuyCount), curPlayer.GetPlayerID())
+    else:
+        GameWorld.DebugLog("已经重置过充值次数!")
+            
     Sync_CoinToGoldCountInfo(curPlayer)
     return
 
@@ -143,13 +164,13 @@
         DataRecordPack.DR_CTGError(curPlayer, "The orderCoin is not equal to the ipyData's RMB(%s)!" % payRMBNum, addDRDict)
         return
     
-    addGold, prizeGold, giveItemList = 0, 0, []
+    addGold, prizeGold, giveItemList, notifyMark = 0, 0, [], ''
     
     if ipyData.GetCTGID():
         ctgResultInfo = __GetCTGInfoByID(curPlayer, chargeInfo, ipyData.GetCTGID(), eventName, addDRDict, isAddBourseMoney)
         if not ctgResultInfo:
             return
-        addGold, prizeGold, giveItemList = ctgResultInfo
+        addGold, prizeGold, giveItemList, notifyMark = ctgResultInfo
         
     elif ipyData.GetGiftbagID():
         if not PlayerFlashGiftbag.OnPlayerOrderGiftbag(curPlayer, [ipyData.GetGiftbagID()], addDRDict):
@@ -159,7 +180,7 @@
         DataRecordPack.DR_CTGError(curPlayer, "The orderInfo is useless!", addDRDict)
         return
     
-    DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict)
+    DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark)
     
     #充值成功主动查询一次,无充值数量就不会继续查询
     if orderID:
@@ -192,6 +213,7 @@
     addGold = ipyData.GetGainGold() # 获得仙玉数
     gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送仙玉数,首次充值赠送仙玉时,此仙玉不给
     firstGoldPrize = ipyData.GetFirstGoldPrize() # 首次充值赠送的仙玉
+    notifyMark = ipyData.GetNotifyMark()
     totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, totalBuyCount + 1)
     prizeGold = firstGoldPrize if (not totalBuyCount and firstGoldPrize) else gainGoldPrize
@@ -199,9 +221,9 @@
     addDRDict.update({"totalBuyCount":(totalBuyCount + 1)})
     
     Sync_CoinToGoldCountInfo(curPlayer, [recordID])
-    return addGold, prizeGold, giveItemList
+    return addGold, prizeGold, giveItemList, notifyMark
 
-def DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict):
+def DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark=''):
     goldBefore = curPlayer.GetGold()
     bourseMoneyBefore = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
     
@@ -220,6 +242,9 @@
             for itemID, itemCount, isBind in giveItemList:
                 ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem], 
                                              event=[ChConfig.ItemGive_CTG, True, addDRDict])
+        if notifyMark:
+            mainItemID = giveItemList[0][0]
+            PlayerControl.WorldNotify(0, notifyMark, [curPlayer.GetName(), mainItemID, ''])
                 
     addVIPExp = int(orderCoin / 100 * GetCoinRate())
     PlayerVip.AddVIPExp(curPlayer, addVIPExp)

--
Gitblit v1.8.0