From 8c99cfdef4ee827c08641defb6e0ac1f3c2899e0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 07 十月 2023 00:45:11 +0800
Subject: [PATCH] 9905 【BT0.1】【主干】新增每周、每月限购

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearFirstGold.py |    6 +++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py            |   12 ++++++++++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py  |    4 +++-
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py                                 |   12 ++++++++++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                   |    2 ++
 5 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
index 9c95ee6..46c327c 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetSendPack.py
@@ -16143,6 +16143,8 @@
                   ("RecordID", c_ubyte),    
                   ("TodayPayCount", c_ushort),    # 今日已购买次数
                   ("TotalPayCount", c_int),    # 累计总购买次数
+                  ("WeekPayCount", c_ushort),    # 周总购买次数
+                  ("MonthPayCount", c_ushort),    # 月总购买次数
                   ]
 
     def __init__(self):
@@ -16158,6 +16160,8 @@
         self.RecordID = 0
         self.TodayPayCount = 0
         self.TotalPayCount = 0
+        self.WeekPayCount = 0
+        self.MonthPayCount = 0
         return
 
     def GetLength(self):
@@ -16170,12 +16174,16 @@
         DumpString = '''// A1 10 充值购买次数信息 //tagMCCoinToGoldCountInfo:
                                 RecordID:%d,
                                 TodayPayCount:%d,
-                                TotalPayCount:%d
+                                TotalPayCount:%d,
+                                WeekPayCount:%d,
+                                MonthPayCount:%d
                                 '''\
                                 %(
                                 self.RecordID,
                                 self.TodayPayCount,
-                                self.TotalPayCount
+                                self.TotalPayCount,
+                                self.WeekPayCount,
+                                self.MonthPayCount
                                 )
         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 3c97a7c..06e446a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3602,6 +3602,8 @@
 Def_PDict_CTGRealFirstTime = "CTGRealFirstTime"  # 首次真实货币充值时间戳
 Def_PDict_TodayCTGCoinTotal = "TodayCTGCoinTotal"  # 当日充值Coin数
 Def_PDict_TodayCTGCount = "TodayCTGCount_%s"  # 当日充值次数,参数(CTG对应的商品记录ID)
+Def_PDict_WeekCTGCount = "WeekCTGCount_%s"  # 本周充值次数,参数(CTG对应的商品记录ID)
+Def_PDict_MonthCTGCount = "MonthCTGCount_%s"  # 本月充值次数,参数(CTG对应的商品记录ID)
 Def_PDict_CTGGoodsBuyCount = "CTGGoodsBuyCount_%s"  # 对应充值商品已购买次数,参数(CTG对应的商品记录ID)
 Def_PDict_OnlineRechargeTHAward = "OnlineRechargeTHAward"  # 在线特惠充值额外奖励 - 是否已领取奖励
 Def_PDict_DayFreeGoldGiftState = "DayFreeGoldGiftState"  # 每日免费直购礼包领取记录
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 9c95ee6..46c327c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -16143,6 +16143,8 @@
                   ("RecordID", c_ubyte),    
                   ("TodayPayCount", c_ushort),    # 今日已购买次数
                   ("TotalPayCount", c_int),    # 累计总购买次数
+                  ("WeekPayCount", c_ushort),    # 周总购买次数
+                  ("MonthPayCount", c_ushort),    # 月总购买次数
                   ]
 
     def __init__(self):
@@ -16158,6 +16160,8 @@
         self.RecordID = 0
         self.TodayPayCount = 0
         self.TotalPayCount = 0
+        self.WeekPayCount = 0
+        self.MonthPayCount = 0
         return
 
     def GetLength(self):
@@ -16170,12 +16174,16 @@
         DumpString = '''// A1 10 充值购买次数信息 //tagMCCoinToGoldCountInfo:
                                 RecordID:%d,
                                 TodayPayCount:%d,
-                                TotalPayCount:%d
+                                TotalPayCount:%d,
+                                WeekPayCount:%d,
+                                MonthPayCount:%d
                                 '''\
                                 %(
                                 self.RecordID,
                                 self.TodayPayCount,
-                                self.TotalPayCount
+                                self.TotalPayCount,
+                                self.WeekPayCount,
+                                self.MonthPayCount
                                 )
         return DumpString
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearFirstGold.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearFirstGold.py
index f71c888..08a11f2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearFirstGold.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearFirstGold.py
@@ -46,11 +46,15 @@
         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:
+        weekBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekCTGCount % recordID)
+        monthBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MonthCTGCount % recordID)
+        if not totalBuyCount and not todayBuyCount and not weekBuyCount and not monthBuyCount:
             continue
         syncRecordIDList.append(recordID)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, 0)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, 0)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekCTGCount % recordID, 0)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MonthCTGCount % recordID, 0)
     if syncRecordIDList:
         PlayerCoin.Sync_CoinToGoldCountInfo(curPlayer, syncRecordIDList)
         
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
index baab6fa..dffb4e2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -711,6 +711,8 @@
         #需要在一周到来的时候重置玩家数据的操作都可以放到函数里面
         ResetPlayerWeekData(curPlayer)
         
+        PlayerCoin.OnWeek(curPlayer)
+        
         #计算这一周的在线时间
         CalcWeekOnlineTime(curPlayer)
         
@@ -787,7 +789,7 @@
         return
     
     if onEventType == ShareDefine.Def_OnEventType:
-        pass
+        PlayerCoin.OnMonth(curPlayer)
         #签到
         #PlayerSignDay.SignDayOnMonth(curPlayer)
         

--
Gitblit v1.8.0