From 4a6eb7cd7e2ce7c978b468b59fc0b7ccf17189d4 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 10 十一月 2018 14:38:39 +0800
Subject: [PATCH] 4695 【后端】【1.2】新增首充赠送仙玉(老号上线重置已重置次数); 4399 【后端】【1.2.0】聊天新增支持气泡框选择功能(已购买对应VIP礼包的玩家上线默认激活对应气泡框)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 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..6a6a226 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
 

--
Gitblit v1.8.0