From 6e68408870278c607c7f33df5a5df58c8b7cef78 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 27 十一月 2025 16:10:18 +0800
Subject: [PATCH] 252 【付费内容】每日特惠-服务端

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py       |   27 +----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py   |  104 --------------------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py   |    3 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py |  147 +++++++++--------------------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py          |    4 
 5 files changed, 51 insertions(+), 234 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 96d6246..c380d6b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3286,8 +3286,6 @@
 Def_PDict_MonthCTGCount = "MonthCTGCount_%s"  # 本月充值次数,参数(CTG对应的商品记录ID)
 Def_PDict_CTGGoodsBuyCount = "CTGGoodsBuyCount_%s"  # 对应充值商品已购买次数,参数(CTG对应的商品记录ID)
 Def_PDict_CTGSelectItemValue = "CTGSelectItemValue_%s"  # 充值自选选择记录,参数(CTG对应的商品记录ID) 每两位存储每个自选索引对应选择的物品索引+1,存储位值为0代表未选择,最多支持选择4种物品
-Def_PDict_OnlineRechargeTHAward = "OnlineRechargeTHAward"  # 在线特惠充值额外奖励 - 是否已领取奖励
-Def_PDict_DayFreeGoldGiftState = "DayFreeGoldGiftState"  # 每日免费直购礼包领取记录
 Def_PDict_FirstChargeRecord = "FirstChargeRecord_%s"  # 首充领取记录,按位记录首充第x天是否已领取,参数(首充ID)
 Def_PDict_FirstChargeTime = "FirstChargeTime_%s"  # 首充充值时间戳,参数(首充ID)
 Def_PDict_IsReBorn = "Def_PDict_IsReBorn"  # 是否回城复活
@@ -4822,7 +4820,7 @@
 Def_RewardType_ManyDayRecharge, #多日连充41
 Def_RewardType_InfiniteMoney, #无限货币42
 Def_RewardType_SingleRecharge, #单笔累充 43
-Def_RewardType_OnlineRechargeTH, #创角在线特惠充值额外奖励 44
+Def_RewardType_44, #创角在线特惠充值额外奖励 44
 Def_RewardType_SWC, #送万充奖励 45
 Def_RewardType_FairyCardSponsor, #仙卡赞助奖励 46
 Def_RewardType_CritGodBoxCTG, #暴击神兵奖励 47
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index 6986c21..b8f7b67 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -25067,58 +25067,6 @@
 
 
 #------------------------------------------------------
-# AA 24 每日免费直购礼包信息 #tagMCDayFreeGoldGiftState
-
-class  tagMCDayFreeGoldGiftState(Structure):
-    _pack_ = 1
-    _fields_ = [
-                  ("Cmd", c_ubyte),
-                  ("SubCmd", c_ubyte),
-                  ("DayFreeGoldGiftState", c_ubyte),    #每日免费直购礼包是否已领奖 0-未领 1-已领
-                  ]
-
-    def __init__(self):
-        self.Clear()
-        self.Cmd = 0xAA
-        self.SubCmd = 0x24
-        return
-
-    def ReadData(self, stringData, _pos=0, _len=0):
-        self.Clear()
-        memmove(addressof(self), stringData[_pos:], self.GetLength())
-        return _pos + self.GetLength()
-
-    def Clear(self):
-        self.Cmd = 0xAA
-        self.SubCmd = 0x24
-        self.DayFreeGoldGiftState = 0
-        return
-
-    def GetLength(self):
-        return sizeof(tagMCDayFreeGoldGiftState)
-
-    def GetBuffer(self):
-        return string_at(addressof(self), self.GetLength())
-
-    def OutputString(self):
-        DumpString = '''// AA 24 每日免费直购礼包信息 //tagMCDayFreeGoldGiftState:
-                                Cmd:%s,
-                                SubCmd:%s,
-                                DayFreeGoldGiftState:%d
-                                '''\
-                                %(
-                                self.Cmd,
-                                self.SubCmd,
-                                self.DayFreeGoldGiftState
-                                )
-        return DumpString
-
-
-m_NAtagMCDayFreeGoldGiftState=tagMCDayFreeGoldGiftState()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCDayFreeGoldGiftState.Cmd,m_NAtagMCDayFreeGoldGiftState.SubCmd))] = m_NAtagMCDayFreeGoldGiftState
-
-
-#------------------------------------------------------
 # AA 42 节日登录奖励活动信息 #tagMCFeastLoginInfo
 
 class  tagMCFeastLoginDayAwardItem(Structure):
@@ -27697,58 +27645,6 @@
 
 m_NAtagMCNewXJSDRecharge=tagMCNewXJSDRecharge()
 ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCNewXJSDRecharge.Cmd,m_NAtagMCNewXJSDRecharge.SubCmd))] = m_NAtagMCNewXJSDRecharge
-
-
-#------------------------------------------------------
-# AA 04 创角在线充值特惠信息 #tagMCOnlineRechargeTH
-
-class  tagMCOnlineRechargeTH(Structure):
-    _pack_ = 1
-    _fields_ = [
-                  ("Cmd", c_ubyte),
-                  ("SubCmd", c_ubyte),
-                  ("AwardState", c_ubyte),    #是否已领取奖励
-                  ]
-
-    def __init__(self):
-        self.Clear()
-        self.Cmd = 0xAA
-        self.SubCmd = 0x04
-        return
-
-    def ReadData(self, stringData, _pos=0, _len=0):
-        self.Clear()
-        memmove(addressof(self), stringData[_pos:], self.GetLength())
-        return _pos + self.GetLength()
-
-    def Clear(self):
-        self.Cmd = 0xAA
-        self.SubCmd = 0x04
-        self.AwardState = 0
-        return
-
-    def GetLength(self):
-        return sizeof(tagMCOnlineRechargeTH)
-
-    def GetBuffer(self):
-        return string_at(addressof(self), self.GetLength())
-
-    def OutputString(self):
-        DumpString = '''// AA 04 创角在线充值特惠信息 //tagMCOnlineRechargeTH:
-                                Cmd:%s,
-                                SubCmd:%s,
-                                AwardState:%d
-                                '''\
-                                %(
-                                self.Cmd,
-                                self.SubCmd,
-                                self.AwardState
-                                )
-        return DumpString
-
-
-m_NAtagMCOnlineRechargeTH=tagMCOnlineRechargeTH()
-ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCOnlineRechargeTH.Cmd,m_NAtagMCOnlineRechargeTH.SubCmd))] = m_NAtagMCOnlineRechargeTH
 
 
 #------------------------------------------------------
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index 1107e1b..64d44b9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -3278,9 +3278,6 @@
     #历史累计充值领取
     elif rewardType == ChConfig.Def_RewardType_HistoryChargeAward:
         PlayerGoldGift.OnGetHistoryRechargeAward(curPlayer, dataEx)
-    #在线特惠充值额外奖励
-    elif rewardType == ChConfig.Def_RewardType_OnlineRechargeTH:
-        PlayerCoin.OnGetOnlineRechargeTH(curPlayer)
     #创角奖励
     elif rewardType == ChConfig.Def_RewardType_CreateRole:
         OnGetCreateRoleAward(curPlayer)
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 394c127..b44dfb8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -95,10 +95,6 @@
 def OnLogin(curPlayer):
     if not DoResetCTGCountByTime(curPlayer):
         Sync_CoinToGoldCountInfo(curPlayer)
-    if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DayFreeGoldGiftState):
-        Sync_DayFreeGoldGiftState(curPlayer)
-    if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnlineRechargeTHAward):
-        SyncOnlineRechargeTH(curPlayer)
     return
 
 def DoResetCTGCountByTime(curPlayer):
@@ -205,9 +201,6 @@
     if syncRecordIDList:
         Sync_CoinToGoldCountInfo(curPlayer, syncRecordIDList)
         
-    if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DayFreeGoldGiftState):
-        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DayFreeGoldGiftState, 0)
-        Sync_DayFreeGoldGiftState(curPlayer)
     return
 
 def OnWeek(curPlayer):
@@ -576,21 +569,8 @@
             return
         addDRDict.update({"selectItemList":selectItemList})
         
-    totalBuyCountUpd = min(totalBuyCount + 1, ChConfig.Def_UpperLimit_DWord)
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, totalBuyCountUpd)
-    addDRDict.update({"totalBuyCountUpd":totalBuyCountUpd})
-    
-    todayBuyCountUpd = min(todayBuyCount + 1, ChConfig.Def_UpperLimit_DWord)
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, todayBuyCountUpd)
-    addDRDict.update({"todayBuyCountUpd":todayBuyCountUpd})
-    
-    weekBuyCountUpd = min(weekBuyCount + 1, ChConfig.Def_UpperLimit_DWord)
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekCTGCount % recordID, weekBuyCountUpd)
-    addDRDict.update({"weekBuyCountUpd":weekBuyCountUpd})
-    
-    monthBuyCountUpd = min(monthBuyCount + 1, ChConfig.Def_UpperLimit_DWord)
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MonthCTGCount % recordID, monthBuyCountUpd)
-    addDRDict.update({"monthBuyCountUpd":monthBuyCountUpd})
+    totalBuyCountUpd, todayBuyCountUpd, weekBuyCountUpd, monthBuyCountUpd = __addCTGIDBuyCnt(curPlayer, recordID)
+    addDRDict.update({"totalBuyCountUpd":totalBuyCountUpd, "todayBuyCountUpd":todayBuyCountUpd, "weekBuyCountUpd":weekBuyCountUpd, "monthBuyCountUpd":monthBuyCountUpd})
     
     giveItemList = []
     giveItemList += GetCTGGiveItemList(ipyData)
@@ -610,8 +590,50 @@
             prizeGold += actPrizeGold
             addDRDict.update({"actRechargePrize":1})
             
-    Sync_CoinToGoldCountInfo(curPlayer, [recordID])
+    syncRecordIDList = [recordID]
+    # 打包购买 - 目前用于每日特惠,有需要可扩展为通用
+    if recordID == IpyGameDataPY.GetFuncCfg("DailyTehui", 2):
+        packItemDict = {}
+        packCTGIDDict = {}
+        dailyTehuiCTGIDList = IpyGameDataPY.GetFuncEvalCfg("DailyTehui", 1)
+        for ctgID in dailyTehuiCTGIDList:
+            ctgIpyData = IpyGameDataPY.GetIpyGameData("CTG", ctgID)
+            if not ctgIpyData:
+                continue
+            if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % ctgID):
+                continue
+            syncRecordIDList.append(ctgID)
+            ctgItemList = GetCTGGiveItemList(ctgIpyData)
+            packCTGIDDict[ctgID] = ctgItemList
+            for itemID, itemCount, _ in ctgItemList:
+                packItemDict[itemID] = packItemDict.get(itemID, 0) + itemCount
+            __addCTGIDBuyCnt(curPlayer, ctgID)
+        if packCTGIDDict:
+            GameWorld.Log("打包购买: recordID=%s,packCTGIDDict=%s" % (recordID, packCTGIDDict), curPlayer.GetPlayerID())
+            addDRDict.update({"packCTGIDDict":packCTGIDDict})
+        for itemID, itemCount in packItemDict.items():
+            giveItemList.append([itemID, itemCount, 0])
+            
+    Sync_CoinToGoldCountInfo(curPlayer, syncRecordIDList)
     return moneyType, addGold, prizeGold, giveItemList, ipyData
+
+def __addCTGIDBuyCnt(curPlayer, recordID):
+    totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
+    totalBuyCountUpd = min(totalBuyCount + 1, ChConfig.Def_UpperLimit_DWord)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, totalBuyCountUpd)
+    
+    todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID)
+    todayBuyCountUpd = min(todayBuyCount + 1, ChConfig.Def_UpperLimit_DWord)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, todayBuyCountUpd)
+    
+    weekBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekCTGCount % recordID)
+    weekBuyCountUpd = min(weekBuyCount + 1, ChConfig.Def_UpperLimit_DWord)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekCTGCount % recordID, weekBuyCountUpd)
+    
+    monthBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MonthCTGCount % recordID)
+    monthBuyCountUpd = min(monthBuyCount + 1, ChConfig.Def_UpperLimit_DWord)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MonthCTGCount % recordID, monthBuyCountUpd)
+    return totalBuyCountUpd, todayBuyCountUpd, weekBuyCountUpd, monthBuyCountUpd
 
 def GetSelectItemListInfo(selectItemInfo, selectItemValue):
     errorInfo = ""
@@ -909,82 +931,3 @@
     countInfoPack.RecordCount = len(countInfoPack.CTGCountInfoList)
     NetPackCommon.SendFakePack(curPlayer, countInfoPack)
     return
-
-## ---------- 每日免费直购礼包 ----------------
-
-def OnGetDayFreeGoldGift(curPlayer):
-    ''' 领取每日免费直购礼包
-    '''
-    
-    isGet = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DayFreeGoldGiftState)
-    if isGet:
-        #GameWorld.DebugLog("已经领取过每日免费直购礼包!")
-        return
-    
-    rewardItemList = IpyGameDataPY.GetFuncEvalCfg("DayFreeGoldGift", 1)
-    if not rewardItemList:
-        return
-    
-    needSpace = len(rewardItemList)
-    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
-    if needSpace > packSpace:
-        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
-        return
-    
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DayFreeGoldGiftState, 1)
-    
-    # 给物品
-    isAuctionItem = False
-    for itemID, itemCount in rewardItemList:        
-        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem])
-        
-    # 通知客户端
-    Sync_DayFreeGoldGiftState(curPlayer)
-    return
-
-def Sync_DayFreeGoldGiftState(curPlayer):
-    clientPack = ChPyNetSendPack.tagMCDayFreeGoldGiftState()
-    clientPack.DayFreeGoldGiftState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_DayFreeGoldGiftState)
-    NetPackCommon.SendFakePack(curPlayer, clientPack)
-    return
-
-## ------------------------------------------
-## ---------- 创角在线充值特惠 ---------------
-
-def OnGetOnlineRechargeTH(curPlayer):
-    ## 领取创角在线充值特惠
-    awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnlineRechargeTHAward)
-    if awardState:
-        #GameWorld.DebugLog("已领取该奖励!")
-        return
-    
-    # 后端只验证是否有充值其中一个即可,不验证充值时间(充值同步到游戏服务器有时间差)
-    canGet = False
-    needCtgIDList = IpyGameDataPY.GetFuncEvalCfg("OnlineRechargeTH", 2)
-    for ctgID in needCtgIDList:
-        if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % ctgID):
-            canGet = True
-            break
-        
-    if not canGet:
-        return
-    
-    awardItemList = IpyGameDataPY.GetFuncEvalCfg("OnlineRechargeTH", 3)
-    if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList):
-        return
-    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OnlineRechargeTHAward, 1)
-    
-    for itemID, itemCount, isAuctionItem in awardItemList:
-        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem], 
-                                     event=["OnlineRechargeTH", False, {}])
-        
-    SyncOnlineRechargeTH(curPlayer)
-    return
-
-def SyncOnlineRechargeTH(curPlayer):
-    clientPack = ChPyNetSendPack.tagMCOnlineRechargeTH()
-    clientPack.AwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OnlineRechargeTHAward)
-    NetPackCommon.SendFakePack(curPlayer, clientPack)
-    return
-
-## ------------------------------------------
\ No newline at end of file
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index 3ec5a8f..fa5c6c0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -690,7 +690,8 @@
 CDBPlayerRefresh_DOTPerDef, # 持续减伤 284
 CDBPlayerRefresh_GoldRushEnergy, # 淘金令 285
 CDBPlayerRefresh_ArenaTicket, # 挑战券 286
-) = range(146, 287)
+CDBPlayerRefresh_TehuiPoint, # 特惠印绶 287
+) = range(146, 288)
 
 TYPE_Price_Gold_Paper_Money = 5    # 金钱类型,(先用礼券,再用金子)
 TYPE_Price_FamilyExp = 6 # 战盟经验
@@ -732,12 +733,13 @@
 TYPE_Price_HeroScore = 51    # 招募积分
 TYPE_Price_GoldRushEnergy = 52    # 淘金令体力
 TYPE_Price_ArenaTicket = 53    # 演武场挑战券
+TYPE_Price_TehuiPoint = 54    # 特惠印绶
 TYPE_Price_PayCoinDay = 98    # 代币时效,每日过天重置
 TYPE_Price_PayCoin = 99    # 代币
 
 #key可用于遍历所有货币,value仅GM相关会用到
 MoneyNameDict = {
-                 1:"金币", 15:"公会贡献币", 41:"战锤", 42:"将星玉髓", 43:"将魂", 51:"招募积分", 52:"淘金令", 53:"挑战券",
+                 1:"金币", 15:"公会贡献币", 41:"战锤", 42:"将星玉髓", 43:"将魂", 51:"招募积分", 52:"淘金令", 53:"挑战券", 54:"特惠印绶",
                  98:"代币时效", 99:"代币"
                  }
 #MoneyNameDict = {
@@ -761,6 +763,7 @@
                            TYPE_Price_HeroScore:CDBPlayerRefresh_HeroScore,
                            TYPE_Price_GoldRushEnergy:CDBPlayerRefresh_GoldRushEnergy,
                            TYPE_Price_ArenaTicket:CDBPlayerRefresh_ArenaTicket,
+                           TYPE_Price_TehuiPoint:CDBPlayerRefresh_TehuiPoint,
                            TYPE_Price_PayCoinDay:CDBPlayerRefresh_PayCoinDay,
                            #TYPE_Price_Rune:CDBPlayerRefresh_Rune,
                            #TYPE_Price_RuneSplinters:CDBPlayerRefresh_RuneSplinters,
@@ -792,13 +795,6 @@
                          2:CDBPlayerRefresh_MoneyMinusGoldPaper,
                          }
 
-# 高效战斗状态
-Def_Battle_Status = (
-    Def_Battle_Start,    # 激活
-    Def_Battle_Stop,     # 停止
-    Def_Battle_Query     # 查询
-) = range(1, 4)
-
 # 游戏功能ID定义,需确保唯一,与PyGameFuncControl.txt中FuncId一致
 GameFuncID_Official = 10        # 官爵,境界
 GameFuncID_Family = 11          # 战盟,仙盟
@@ -809,19 +805,6 @@
 
 # 以下为暂时无用的
 GameFuncID_Pet = -1             # 宠物,灵宠 6
-GameFuncID_OSSail = -1          # 开服特惠 132
-GameFuncID_AddPoint = -1        # 加点功能/灵根功能 145
-
-#家族悬赏任务完成状态记录位标识
-Def_ArrestOverState_BitDic = {
-    5000:0,
-    5001:1,
-    5002:2,
-    5003:3,
-    5004:4,
-    5005:5,
-    5006:6,
-    }
 
 #背包类型
 (

--
Gitblit v1.8.0