8125 子 【主干】新功能:累计充值 / 【后端】【主干】累计充值
| | |
| | | BYTE SkinIndex; //外观
|
| | | };
|
| | |
|
| | | //骑宠幻化表
|
| | | //装备升星概率表
|
| | |
|
| | | struct tagEquipStarUpRate
|
| | | {
|
| | |
| | | DWORD _EquipPlace; //部位
|
| | | DWORD _IsSuite; //是否套装
|
| | | DWORD Rate; //概率
|
| | | };
|
| | |
|
| | | //累计充值奖励表
|
| | |
|
| | | struct tagHistoryRechargeAward
|
| | | {
|
| | | BYTE _ID; //id
|
| | | DWORD Recharge; //所需充值元
|
| | | dict Reward; //职业对应的奖励内容,每个职业4组数据,物品ID和物品数量(1.枪豪2.道师3.剑修)
|
| | | }; |
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 28 历史累积充值奖励领取记录 #tagMCHistoryReChargeAwardRecord
|
| | |
|
| | | class tagMCHistoryReChargeAwardRecord(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("AwardGetRecord", c_int), # 按二进制位标示领取记录 配置奖励ID代表第几位
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x28
|
| | | 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 = 0xA3
|
| | | self.SubCmd = 0x28
|
| | | self.AwardGetRecord = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCHistoryReChargeAwardRecord)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 28 历史累积充值奖励领取记录 //tagMCHistoryReChargeAwardRecord:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | AwardGetRecord:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.AwardGetRecord
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCHistoryReChargeAwardRecord=tagMCHistoryReChargeAwardRecord()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCHistoryReChargeAwardRecord.Cmd,m_NAtagMCHistoryReChargeAwardRecord.SubCmd))] = m_NAtagMCHistoryReChargeAwardRecord
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 12 通知骑宠觉醒信息 #tagMCHorsePetSkinData
|
| | |
|
| | | class tagMCHorsePetSkinInfo(Structure):
|
| | |
| | | Def_PDict_OnlineStartTick = "OnlineStartTime" # 在线计算时间
|
| | | Def_PDict_LVAwardGetRecord = "LVAwardGetRecord" # 等级奖励领取信息记录,按二进制位标示
|
| | | Def_PDict_LVAwardVIPGetRecord = "LVAwardVIPGetRecord" # 等级奖励vip领取信息记录,按二进制位标示
|
| | | Def_PDict_HistoryChargeAwardGetRecord = "HTotalGoldAwardRecord" # 历史累计充值奖励领取信息记录,按二进制位标示
|
| | | Def_PDict_CTGCountResetTime = "CTGCountResetTime" # CTG次数重置时间time值
|
| | | Def_PDict_TodayCTGCount = "TodayCTGCount_%s" # 当日充值次数,参数(CTG对应的商品记录ID)
|
| | | Def_PDict_CTGGoodsBuyCount = "CTGGoodsBuyCount_%s" # 对应充值商品已购买次数,参数(CTG对应的商品记录ID)
|
| | |
| | | Def_RewardType_FeastWeekPartyAct, # 领取节日巡礼活动奖励25
|
| | | Def_RewardType_FeastWeekPartyPoint, # 领取节日巡礼积分奖励26
|
| | | Def_RewardType_FairyAdventuresAward, #缥缈奇遇领取27
|
| | | )= range(28)
|
| | | Def_RewardType_HistoryChargeAward, #历史累计充值领取28
|
| | | )= range(29)
|
| | |
|
| | |
|
| | | #boss复活相关活动定义
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 28 历史累积充值奖励领取记录 #tagMCHistoryReChargeAwardRecord
|
| | |
|
| | | class tagMCHistoryReChargeAwardRecord(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("AwardGetRecord", c_int), # 按二进制位标示领取记录 配置奖励ID代表第几位
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA3
|
| | | self.SubCmd = 0x28
|
| | | 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 = 0xA3
|
| | | self.SubCmd = 0x28
|
| | | self.AwardGetRecord = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCHistoryReChargeAwardRecord)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 28 历史累积充值奖励领取记录 //tagMCHistoryReChargeAwardRecord:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | AwardGetRecord:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.AwardGetRecord
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCHistoryReChargeAwardRecord=tagMCHistoryReChargeAwardRecord()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCHistoryReChargeAwardRecord.Cmd,m_NAtagMCHistoryReChargeAwardRecord.SubCmd))] = m_NAtagMCHistoryReChargeAwardRecord
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 12 通知骑宠觉醒信息 #tagMCHorsePetSkinData
|
| | |
|
| | | class tagMCHorsePetSkinInfo(Structure):
|
| | |
| | | ("DWORD", "IsSuite", 1),
|
| | | ("DWORD", "Rate", 0),
|
| | | ),
|
| | |
|
| | | "HistoryRechargeAward":(
|
| | | ("BYTE", "ID", 1),
|
| | | ("DWORD", "Recharge", 0),
|
| | | ("dict", "Reward", 0),
|
| | | ),
|
| | | }
|
| | |
|
| | | |
| | |
| | | def GetAttrInfo(self): return self.AttrInfo # 属性
|
| | | def GetSkinIndex(self): return self.SkinIndex # 外观 |
| | | |
| | | # 骑宠幻化表 |
| | | # 装备升星概率表 |
| | | class IPY_EquipStarUpRate(): |
| | | |
| | | def __init__(self): |
| | |
| | | def GetEquipPlace(self): return self.EquipPlace # 部位
|
| | | def GetIsSuite(self): return self.IsSuite # 是否套装
|
| | | def GetRate(self): return self.Rate # 概率 |
| | | |
| | | # 累计充值奖励表 |
| | | class IPY_HistoryRechargeAward(): |
| | | |
| | | def __init__(self): |
| | | self.ID = 0
|
| | | self.Recharge = 0
|
| | | self.Reward = {} |
| | | return |
| | | |
| | | def GetID(self): return self.ID # id
|
| | | def GetRecharge(self): return self.Recharge # 所需充值元
|
| | | def GetReward(self): return self.Reward # 职业对应的奖励内容,每个职业4组数据,物品ID和物品数量(1.枪豪2.道师3.剑修) |
| | |
|
| | |
|
| | | def Log(msg, playerID=0, par=0):
|
| | |
| | | self.ipyHorsePetSkinLen = len(self.ipyHorsePetSkinCache)
|
| | | self.ipyEquipStarUpRateCache = self.__LoadFileData("EquipStarUpRate", IPY_EquipStarUpRate)
|
| | | self.ipyEquipStarUpRateLen = len(self.ipyEquipStarUpRateCache)
|
| | | self.ipyHistoryRechargeAwardCache = self.__LoadFileData("HistoryRechargeAward", IPY_HistoryRechargeAward)
|
| | | self.ipyHistoryRechargeAwardLen = len(self.ipyHistoryRechargeAwardCache)
|
| | | Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
|
| | | Log("IPY_DataMgr InitOK!")
|
| | | return
|
| | |
| | | def GetHorsePetSkinByIndex(self, index): return self.ipyHorsePetSkinCache[index]
|
| | | def GetEquipStarUpRateCount(self): return self.ipyEquipStarUpRateLen
|
| | | def GetEquipStarUpRateByIndex(self, index): return self.ipyEquipStarUpRateCache[index]
|
| | | def GetHistoryRechargeAwardCount(self): return self.ipyHistoryRechargeAwardLen
|
| | | def GetHistoryRechargeAwardByIndex(self, index): return self.ipyHistoryRechargeAwardCache[index]
|
| | |
|
| | | IPYData = IPY_DataMgr()
|
| | | def IPY_Data(): return IPYData
|
| | |
| | | #缥缈奇遇领取
|
| | | elif rewardType == ChConfig.Def_RewardType_FairyAdventuresAward:
|
| | | PlayerFairyDomain.GetFairyAdventuresAward(curPlayer, dataEx, dataExStr)
|
| | | |
| | | #历史累计充值领取
|
| | | elif rewardType == ChConfig.Def_RewardType_HistoryChargeAward:
|
| | | PlayerGoldGift.OnGetHistoryRechargeAward(curPlayer, dataEx)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | Sync_FirstGoldInfo(curPlayer)
|
| | |
|
| | | Sync_FirstGoldTime(curPlayer)
|
| | | Sync_HistoryChargeAwardGetRecordInfo(curPlayer)
|
| | | #更新首充提示开始计时时间
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FirstGoldRemainTime):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FirstGoldTipStartTime, int(time.time()))
|
| | |
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_DailyChargeState, 1)
|
| | | PlayerFamilyRedPacket.CreatRedPacketByID(curPlayer, 2)
|
| | | return
|
| | |
|
| | |
|
| | | def OnGetHistoryRechargeAward(curPlayer, awardID):
|
| | | # 领取历史充值奖励
|
| | | |
| | | ipyData = IpyGameDataPY.GetIpyGameData('HistoryRechargeAward', awardID)
|
| | | if not ipyData:
|
| | | return
|
| | | |
| | | getRecharge = ipyData.GetRecharge()
|
| | | # 检查可否领取
|
| | | |
| | | # 玩家充值小于领取充值
|
| | | if curPlayer.GetChangeCoinPointTotal()/100 < getRecharge:
|
| | | GameWorld.ErrLog("OnGetHistoryRechargeAward error:getRecharge=%s greater than ChangeCoinPointTotal=%s" % (getRecharge, curPlayer.GetChangeCoinPointTotal()))
|
| | | return
|
| | | awardInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HistoryChargeAwardGetRecord, 0)
|
| | | awardMark = pow(2, awardID)
|
| | | if awardInfo & awardMark:
|
| | | #已领取
|
| | | GameWorld.DebugLog("已领取历史充值奖励!awardID=%s,getRecharge=%s" % (awardID, getRecharge))
|
| | | return
|
| | |
|
| | | job = curPlayer.GetJob()
|
| | | awardDict = ipyData.GetReward()
|
| | | if str(job) not in awardDict:
|
| | | return
|
| | | itemList = awardDict[str(job)]
|
| | | |
| | | if not itemList:
|
| | | return
|
| | | # 检查背包
|
| | | needSpace = len(itemList)
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
|
| | | if needSpace > packSpace:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
| | | return
|
| | | |
| | | # 给物品
|
| | | for itemID, itemCount in itemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem])
|
| | | |
| | | # 更新已领取成功标记
|
| | | awardMark = pow(2, awardID)
|
| | |
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HistoryChargeAwardGetRecord, awardInfo | awardMark)
|
| | | # 通知客户端
|
| | | Sync_HistoryChargeAwardGetRecordInfo(curPlayer)
|
| | | |
| | | # 记录领取事件
|
| | | DataRecordPack.SendEventPack("HistoryRechargeAward", {'awardID':awardID, 'getRecharge':getRecharge}, curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | ## 通知等级奖励领取记录信息
|
| | | # @param None
|
| | | # @return None
|
| | | def Sync_HistoryChargeAwardGetRecordInfo(curPlayer):
|
| | | sendPack = ChPyNetSendPack.tagMCHistoryReChargeAwardRecord()
|
| | | sendPack.Clear()
|
| | | sendPack.AwardGetRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HistoryChargeAwardGetRecord, 0)
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | return |