From b813aa21bc48546c8e5adead95ba4cb4e8e02148 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 14 十一月 2018 14:11:10 +0800
Subject: [PATCH] 4730 【后端】【1.3】神兵系统修改(激活方式修改、升级支持自动锤炼)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 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 c7d0e94..6a6a226 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -45,6 +45,7 @@
 import PlayerFlashGiftbag
 import PlayerFairyCeremony
 import PlayerGoldGift
+import PlayerActTotalRecharge
 import ItemCommon
 
 #---------------------------------------------------------------------
@@ -55,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
 
@@ -124,7 +146,7 @@
     isAddBourseMoney = chargeInfo.GetIsAddBourseMoney()
     appID = chargeInfo.GetAppID()
     if not appID:
-        appID = GameWorld.GetPlayerPlatform(curPlayer.GetAccID())
+        appID = GameWorld.GetPlayerPlatform(curPlayer)
     addDRDict = {"orderCoin":orderCoin, "orderInfo":orderInfo, "orderID":orderID, 
                  "isAddBourseMoney":isAddBourseMoney, "eventName":eventName, "appID":appID}
     
@@ -239,6 +261,7 @@
     #仙界盛典-充值大礼
     PlayerFairyCeremony.OnFCRecharge(curPlayer)
     PlayerGoldGift.DayChargeRedPackAward(curPlayer)
+    PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, addGold)
     GameWorld.Log("Billing: eventName=%s, %s" % (eventName, addDRDict), curPlayer.GetPlayerID())
     return
 

--
Gitblit v1.8.0