hxp
2025-09-30 cdef1c9f32913b3568ab48dbc64133632dc122ba
219 【付费内容】首充-服务端(优化AA02通知)
2个文件已修改
30 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -30581,6 +30581,7 @@
class  tagSCFirstCharge(Structure):
    _pack_ = 1
    _fields_ = [
                  ("FirstID", c_ubyte),    #首充ID
                  ("ChargeTime", c_int),    #充值该首充的时间戳
                  ("AwardRecord", c_ushort),    #首充奖励领奖记录,按二进制位记录首充第X天是否已领取
                  ]
@@ -30595,6 +30596,7 @@
        return _pos + self.GetLength()
    def Clear(self):
        self.FirstID = 0
        self.ChargeTime = 0
        self.AwardRecord = 0
        return
@@ -30607,10 +30609,12 @@
    def OutputString(self):
        DumpString = '''// AA 02 首充信息 //tagSCFirstChargeInfo:
                                FirstID:%d,
                                ChargeTime:%d,
                                AwardRecord:%d
                                '''\
                                %(
                                self.FirstID,
                                self.ChargeTime,
                                self.AwardRecord
                                )
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldGift.py
@@ -82,7 +82,7 @@
    
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstChargeTime % firstID, int(time.time()))
    GameWorld.DebugLog("记录首充档位充值时间戳: ctgID=%s" % ctgID)
    Sync_FirstChargeInfo(curPlayer)
    Sync_FirstChargeInfo(curPlayer, firstID)
    return
def GetPlayerFirstCharge(curPlayer, giftDay, firstIDStr):
@@ -123,7 +123,7 @@
    updGetRecord = getRecord | pow(2, giftDay)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstChargeRecord % firstID, updGetRecord)
    GameWorld.DebugLog("领取首充奖励: firstID=%s,giftDay=%s,getRecord=%s,updGetRecord=%s, %s" % (firstID, giftDay, getRecord, updGetRecord, awardList))
    Sync_FirstChargeInfo(curPlayer)
    Sync_FirstChargeInfo(curPlayer, firstID)
    
    isAuctionItem = 0
    notifyAwardList = []
@@ -135,18 +135,30 @@
    ItemControler.NotifyGiveAwardInfo(curPlayer, notifyAwardList, "FirstCharge")
    return
def Sync_FirstChargeInfo(curPlayer):
def Sync_FirstChargeInfo(curPlayer, firstID=0):
    ## 通知首充信息
    clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFirstChargeInfo)
    clientPack.FirstChargeList = []
    if firstID:
        syncIDList = [firstID]
    else:
        syncIDList = []
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for index in range(ipyDataMgr.GetFirstChargeCount()):
        ipyData = ipyDataMgr.GetFirstChargeByIndex(index)
        firstID = ipyData.GetFirstID()
            syncIDList.append(ipyData.GetFirstID())
    firstChargeList = []
    for firstID in syncIDList:
        firstCharge = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFirstCharge)
        firstCharge.FirstID = firstID
        firstCharge.ChargeTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstChargeTime % firstID)
        firstCharge.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstChargeRecord % firstID)
        clientPack.FirstChargeList.append(firstCharge)
        firstChargeList.append(firstCharge)
    if not firstChargeList:
        return
    clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFirstChargeInfo)
    clientPack.FirstChargeList = firstChargeList
    clientPack.Count = len(clientPack.FirstChargeList)
    NetPackCommon.SendFakePack(curPlayer, clientPack)
    return