8710 【开发】【主干】【BT2】根据世界等级配置奖励(成长必买改为通知对应不同世界等级的物品信息);
| | |
| | | #------------------------------------------------------
|
| | | # AA 31 成长必买活动信息 #tagMCActGrowupBuyInfo
|
| | |
|
| | | class tagMCActGrowupBuyCTGItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), |
| | | ("ItemCount", c_ushort), |
| | | ("IsBind", c_ubyte), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | 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.ItemID = 0
|
| | | self.ItemCount = 0
|
| | | self.IsBind = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCActGrowupBuyCTGItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 31 成长必买活动信息 //tagMCActGrowupBuyInfo:
|
| | | ItemID:%d,
|
| | | ItemCount:%d,
|
| | | IsBind:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCount,
|
| | | self.IsBind
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActGrowupBuyCTGInfo(Structure):
|
| | | CTGID = 0 #(BYTE CTGID)// 充值表ID
|
| | | GainItemCount = 0 #(BYTE GainItemCount)// 获得物品数
|
| | | GainItemList = list() #(vector<tagMCActGrowupBuyCTGItem> GainItemList)// 获得物品列表,替换充值表中的 GainItemList 字段信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | self.CTGID,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.GainItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.GainItemCount):
|
| | | temGainItemList = tagMCActGrowupBuyCTGItem()
|
| | | _pos = temGainItemList.ReadData(_lpData, _pos)
|
| | | self.GainItemList.append(temGainItemList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.CTGID = 0
|
| | | self.GainItemCount = 0
|
| | | self.GainItemList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.GainItemCount):
|
| | | length += self.GainItemList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteBYTE(data, self.CTGID)
|
| | | data = CommFunc.WriteBYTE(data, self.GainItemCount)
|
| | | for i in range(self.GainItemCount):
|
| | | data = CommFunc.WriteString(data, self.GainItemList[i].GetLength(), self.GainItemList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | CTGID:%d,
|
| | | GainItemCount:%d,
|
| | | GainItemList:%s
|
| | | '''\
|
| | | %(
|
| | | self.CTGID,
|
| | | self.GainItemCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActGrowupBuyGroup(Structure):
|
| | | BuyCount = 0 #(BYTE BuyCount)// 循环购买礼包数
|
| | | BuyCTGIDList = list() #(vector<DWORD> BuyCTGIDList)// 循环购买礼包充值ID列表
|
| | | BuyCTGIDList = list() #(vector<tagMCActGrowupBuyCTGInfo> BuyCTGIDList)// 循环购买礼包充值ID信息列表
|
| | | PlayerBuyIndex = 0 #(BYTE PlayerBuyIndex)// 玩家当前可购买的礼包充值ID在列表中索引
|
| | | data = None
|
| | |
|
| | |
| | | self.Clear()
|
| | | self.BuyCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.BuyCount):
|
| | | value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
|
| | | self.BuyCTGIDList.append(value)
|
| | | temBuyCTGIDList = tagMCActGrowupBuyCTGInfo()
|
| | | _pos = temBuyCTGIDList.ReadData(_lpData, _pos)
|
| | | self.BuyCTGIDList.append(temBuyCTGIDList)
|
| | | self.PlayerBuyIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 1
|
| | | length += 4 * self.BuyCount
|
| | | for i in range(self.BuyCount):
|
| | | length += self.BuyCTGIDList[i].GetLength()
|
| | | length += 1
|
| | |
|
| | | return length
|
| | |
| | | data = ''
|
| | | data = CommFunc.WriteBYTE(data, self.BuyCount)
|
| | | for i in range(self.BuyCount):
|
| | | data = CommFunc.WriteDWORD(data, self.BuyCTGIDList[i])
|
| | | data = CommFunc.WriteString(data, self.BuyCTGIDList[i].GetLength(), self.BuyCTGIDList[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.PlayerBuyIndex)
|
| | | return data
|
| | |
|
| | |
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | GroupCount = 0 #(BYTE GroupCount)// 循环购买礼包组数
|
| | | GroupList = list() #(vector<tagMCActGrowupBuyGroup> GroupList)//循环购买礼包组列表
|
| | | ActWorldLV = 0 #(WORD ActWorldLV)// 活动世界等级
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | temGroupList = tagMCActGrowupBuyGroup()
|
| | | _pos = temGroupList.ReadData(_lpData, _pos)
|
| | | self.GroupList.append(temGroupList)
|
| | | self.ActWorldLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.EndtDate = ""
|
| | | self.GroupCount = 0
|
| | | self.GroupList = list()
|
| | | self.ActWorldLV = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 1
|
| | | for i in range(self.GroupCount):
|
| | | length += self.GroupList[i].GetLength()
|
| | | length += 2
|
| | |
|
| | | return length
|
| | |
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.GroupCount)
|
| | | for i in range(self.GroupCount):
|
| | | data = CommFunc.WriteString(data, self.GroupList[i].GetLength(), self.GroupList[i].GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.ActWorldLV)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | GroupCount:%d,
|
| | | GroupList:%s,
|
| | | ActWorldLV:%d
|
| | | GroupList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.GroupCount,
|
| | | "...",
|
| | | self.ActWorldLV
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | OperationActionName_CollectWords2 = "ActCollectWords2" # 集字活动2
|
| | | OperationActionName_LuckyTreasure = "ActLuckyTreasure" # 幸运鉴宝活动
|
| | | OperationActionName_RechargePrize = "ActRechargePrize" # 充值返利活动
|
| | | OperationActionName_RechargeRebateGold = "ActRechargeRebateGold" # 充值返利仙玉活动(活动结束邮件发放,节日活动)
|
| | | OperationActionName_GrowupBuy = "ActGrowupBuy" # 成长必买活动
|
| | | #节日活动类型列表 - 该类型无视开服天,日期到了就开启
|
| | | FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket]
|
| | | FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket,
|
| | | OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy]
|
| | | #所有的运营活动列表,含节日活动
|
| | | OperationActionNameList = [OperationActionName_ExpRate, OperationActionName_CostRebate,
|
| | | OperationActionName_BossReborn,OperationActionName_SpringSale,
|
| | |
| | | OperationActionName_WeekParty, OperationActionName_LoginAward,
|
| | | OperationActionName_NewFairyCeremony, OperationActionName_LuckyTreasure,
|
| | | OperationActionName_DailyGiftbag, OperationActionName_RechargePrize,
|
| | | OperationActionName_CollectWords, OperationActionName_CollectWords2,
|
| | | OperationActionName_GrowupBuy
|
| | | ] + FeastOperationActionNameList
|
| | | OperationActionName_CollectWords, OperationActionName_CollectWords2] \
|
| | | + FeastOperationActionNameList
|
| | | #需要记录开启活动时的世界等级的运营活动
|
| | | NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell,
|
| | | OperationActionName_NewFairyCeremony, OperationActionName_FlashSale,
|
| | |
| | | #------------------------------------------------------
|
| | | # AA 31 成长必买活动信息 #tagMCActGrowupBuyInfo
|
| | |
|
| | | class tagMCActGrowupBuyCTGItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), |
| | | ("ItemCount", c_ushort), |
| | | ("IsBind", c_ubyte), |
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | 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.ItemID = 0
|
| | | self.ItemCount = 0
|
| | | self.IsBind = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCActGrowupBuyCTGItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 31 成长必买活动信息 //tagMCActGrowupBuyInfo:
|
| | | ItemID:%d,
|
| | | ItemCount:%d,
|
| | | IsBind:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCount,
|
| | | self.IsBind
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActGrowupBuyCTGInfo(Structure):
|
| | | CTGID = 0 #(BYTE CTGID)// 充值表ID
|
| | | GainItemCount = 0 #(BYTE GainItemCount)// 获得物品数
|
| | | GainItemList = list() #(vector<tagMCActGrowupBuyCTGItem> GainItemList)// 获得物品列表,替换充值表中的 GainItemList 字段信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | self.CTGID,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.GainItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.GainItemCount):
|
| | | temGainItemList = tagMCActGrowupBuyCTGItem()
|
| | | _pos = temGainItemList.ReadData(_lpData, _pos)
|
| | | self.GainItemList.append(temGainItemList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.CTGID = 0
|
| | | self.GainItemCount = 0
|
| | | self.GainItemList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.GainItemCount):
|
| | | length += self.GainItemList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteBYTE(data, self.CTGID)
|
| | | data = CommFunc.WriteBYTE(data, self.GainItemCount)
|
| | | for i in range(self.GainItemCount):
|
| | | data = CommFunc.WriteString(data, self.GainItemList[i].GetLength(), self.GainItemList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | CTGID:%d,
|
| | | GainItemCount:%d,
|
| | | GainItemList:%s
|
| | | '''\
|
| | | %(
|
| | | self.CTGID,
|
| | | self.GainItemCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActGrowupBuyGroup(Structure):
|
| | | BuyCount = 0 #(BYTE BuyCount)// 循环购买礼包数
|
| | | BuyCTGIDList = list() #(vector<DWORD> BuyCTGIDList)// 循环购买礼包充值ID列表
|
| | | BuyCTGIDList = list() #(vector<tagMCActGrowupBuyCTGInfo> BuyCTGIDList)// 循环购买礼包充值ID信息列表
|
| | | PlayerBuyIndex = 0 #(BYTE PlayerBuyIndex)// 玩家当前可购买的礼包充值ID在列表中索引
|
| | | data = None
|
| | |
|
| | |
| | | self.Clear()
|
| | | self.BuyCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.BuyCount):
|
| | | value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
|
| | | self.BuyCTGIDList.append(value)
|
| | | temBuyCTGIDList = tagMCActGrowupBuyCTGInfo()
|
| | | _pos = temBuyCTGIDList.ReadData(_lpData, _pos)
|
| | | self.BuyCTGIDList.append(temBuyCTGIDList)
|
| | | self.PlayerBuyIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 1
|
| | | length += 4 * self.BuyCount
|
| | | for i in range(self.BuyCount):
|
| | | length += self.BuyCTGIDList[i].GetLength()
|
| | | length += 1
|
| | |
|
| | | return length
|
| | |
| | | data = ''
|
| | | data = CommFunc.WriteBYTE(data, self.BuyCount)
|
| | | for i in range(self.BuyCount):
|
| | | data = CommFunc.WriteDWORD(data, self.BuyCTGIDList[i])
|
| | | data = CommFunc.WriteString(data, self.BuyCTGIDList[i].GetLength(), self.BuyCTGIDList[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.PlayerBuyIndex)
|
| | | return data
|
| | |
|
| | |
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | GroupCount = 0 #(BYTE GroupCount)// 循环购买礼包组数
|
| | | GroupList = list() #(vector<tagMCActGrowupBuyGroup> GroupList)//循环购买礼包组列表
|
| | | ActWorldLV = 0 #(WORD ActWorldLV)// 活动世界等级
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | temGroupList = tagMCActGrowupBuyGroup()
|
| | | _pos = temGroupList.ReadData(_lpData, _pos)
|
| | | self.GroupList.append(temGroupList)
|
| | | self.ActWorldLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.EndtDate = ""
|
| | | self.GroupCount = 0
|
| | | self.GroupList = list()
|
| | | self.ActWorldLV = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 1
|
| | | for i in range(self.GroupCount):
|
| | | length += self.GroupList[i].GetLength()
|
| | | length += 2
|
| | |
|
| | | return length
|
| | |
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.GroupCount)
|
| | | for i in range(self.GroupCount):
|
| | | data = CommFunc.WriteString(data, self.GroupList[i].GetLength(), self.GroupList[i].GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.ActWorldLV)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | GroupCount:%d,
|
| | | GroupList:%s,
|
| | | ActWorldLV:%d
|
| | | GroupList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.GroupCount,
|
| | | "...",
|
| | | self.ActWorldLV
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | |
|
| | | buyIndex = GameWorld.GetDataByDigitPlace(buyState, i)
|
| | | updBuyIndex = 0
|
| | | # 最后一个礼包了,不管有没有买都重置
|
| | | if buyIndex >= len(ctgIDList) - 1:
|
| | | updBuyIndex = 0
|
| | | GameWorld.DebugLog(" 最后一个礼包,重置!")
|
| | | else:
|
| | | yestodayCtgID = ctgIDList[buyIndex]
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % yestodayCtgID):
|
| | | updBuyIndex = 0
|
| | | GameWorld.DebugLog(" 前置礼包没买,重置!yestodayCtgID=%s" % yestodayCtgID)
|
| | | GameWorld.DebugLog(" 昨日礼包没买,重置!yestodayCtgID=%s" % yestodayCtgID)
|
| | | else:
|
| | | if buyIndex >= len(ctgIDList) - 1:
|
| | | updBuyIndex = len(ctgIDList) - 1
|
| | | GameWorld.DebugLog(" 昨日礼包已买,最后一档礼包保持不变! yestodayCtgID=%s,updBuyIndex=%s" % (yestodayCtgID, updBuyIndex))
|
| | | else:
|
| | | updBuyIndex = buyIndex + 1
|
| | | GameWorld.DebugLog(" 前置礼包已买,更新后续礼包索引! yestodayCtgID=%s,updBuyIndex=%s" % (yestodayCtgID, updBuyIndex))
|
| | | GameWorld.DebugLog(" 昨日礼包已买,更新后续礼包索引! yestodayCtgID=%s,updBuyIndex=%s" % (yestodayCtgID, updBuyIndex))
|
| | |
|
| | | buyState = GameWorld.ChangeDataByDigitPlace(buyState, i, updBuyIndex)
|
| | | GameWorld.DebugLog(" updState=%s" % buyState)
|
| | |
| | | if not ctgIDGroupList:
|
| | | return
|
| | |
|
| | | import PlayerCoin
|
| | | buyState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GrowupBuyState)
|
| | |
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | |
| | | actPack.GroupList = []
|
| | | for i, ctgIDList in enumerate(ctgIDGroupList):
|
| | | groupInfo = ChPyNetSendPack.tagMCActGrowupBuyGroup()
|
| | | groupInfo.BuyCTGIDList = ctgIDList
|
| | | groupInfo.BuyCTGIDList = []
|
| | | for ctgID in ctgIDList:
|
| | | ctgIpyData = IpyGameDataPY.GetIpyGameData("CTG", ctgID)
|
| | | ctgGiveItemList = PlayerCoin.GetCTGGiveItemList(ctgIpyData)
|
| | | ctgInfo = ChPyNetSendPack.tagMCActGrowupBuyCTGInfo()
|
| | | ctgInfo.CTGID = ctgID
|
| | | ctgInfo.GainItemList = []
|
| | | for itemID, itemCount, isAuctionItem in ctgGiveItemList:
|
| | | ctgItem = ChPyNetSendPack.tagMCActGrowupBuyCTGItem()
|
| | | ctgItem.ItemID = itemID
|
| | | ctgItem.ItemCount = itemCount
|
| | | ctgItem.IsBind = isAuctionItem
|
| | | ctgInfo.GainItemList.append(ctgItem)
|
| | | ctgInfo.GainItemCount = len(ctgInfo.GainItemList)
|
| | | groupInfo.BuyCTGIDList.append(ctgInfo)
|
| | | groupInfo.BuyCount = len(groupInfo.BuyCTGIDList)
|
| | | groupInfo.PlayerBuyIndex = GameWorld.GetDataByDigitPlace(buyState, i)
|
| | | actPack.GroupList.append(groupInfo)
|
| | | actPack.GroupCount = len(actPack.GroupList)
|
| | | actPack.ActWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | NetPackCommon.SendFakePack(curPlayer, actPack)
|
| | | return
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, todayBuyCount + 1)
|
| | | addDRDict.update({"todayBuyCountUpd":(todayBuyCount + 1)})
|
| | |
|
| | | gainItemList = ipyData.GetGainItemList()
|
| | | actWorldLVGainItemInfo = ipyData.GetActWorldLVGainItemInfo()
|
| | | giveItemList = []
|
| | | # 活动世界等级对应物品信息,如果有对应活动支持 且 该配置有配,则默认走该配置,否则使用常规的默认物品配置
|
| | | payTypeActNameDict = {PayType_GrowupBuy:ShareDefine.OperationActionName_GrowupBuy,
|
| | | |
| | | # ... 有新增的活动需要支持,则在此新增配置上即可,后面取物品的逻辑都是一样的
|
| | | }
|
| | | if actWorldLVGainItemInfo and ipyData.GetPayType() in payTypeActNameDict:
|
| | | actName = payTypeActNameDict[ipyData.GetPayType()]
|
| | | actInfo = PyGameData.g_operationActionDict.get(actName, {})
|
| | | if not actInfo or not actInfo.get(ShareDefine.ActKey_State):
|
| | | DataRecordPack.DR_CTGError(curPlayer, "Can not find act info actName=%s" % actName, addDRDict)
|
| | | return
|
| | | actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | actWorldLVList = [int(strWorldLV) for strWorldLV in actWorldLVGainItemInfo.keys()]
|
| | | actWorldLVList.sort() # 使用 int 的值排,否则可能引起排序错误
|
| | | for worldLV in actWorldLVList:
|
| | | if actWorldLV <= worldLV:
|
| | | giveItemList = actWorldLVGainItemInfo[str(worldLV)]
|
| | | break
|
| | | if not giveItemList:
|
| | | giveItemList = actWorldLVGainItemInfo[str(actWorldLVList[-1])] # 没有匹配到的话默认取最后一个等级配置
|
| | | else:
|
| | | giveItemList = gainItemList
|
| | | |
| | | giveItemList = GetCTGGiveItemList(ipyData)
|
| | | addGold = ipyData.GetGainGold() # 获得仙玉数
|
| | | gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送仙玉数,首次充值赠送仙玉时,此仙玉不给
|
| | | firstGoldPrize = ipyData.GetFirstGoldPrize() # 首次充值赠送的仙玉
|
| | |
| | | Sync_CoinToGoldCountInfo(curPlayer, [recordID])
|
| | | return addGold, prizeGold, giveItemList, ipyData
|
| | |
|
| | | def GetCTGGiveItemList(ipyData):
|
| | | ## 获取充值ID对应给物品列表
|
| | | if not ipyData:
|
| | | return []
|
| | | |
| | | gainItemList = ipyData.GetGainItemList()
|
| | | actWorldLVGainItemInfo = ipyData.GetActWorldLVGainItemInfo()
|
| | | giveItemList = []
|
| | | # 活动世界等级对应物品信息,如果有对应活动支持 且 该配置有配,则默认走该配置,否则使用常规的默认物品配置
|
| | | payTypeActNameDict = {PayType_GrowupBuy:ShareDefine.OperationActionName_GrowupBuy,
|
| | | |
| | | # ... 有新增的活动需要支持,则在此新增配置上即可,后面取物品的逻辑都是一样的
|
| | | }
|
| | | if actWorldLVGainItemInfo and ipyData.GetPayType() in payTypeActNameDict:
|
| | | actName = payTypeActNameDict[ipyData.GetPayType()]
|
| | | actInfo = PyGameData.g_operationActionDict.get(actName, {}) # 注:相关状态在前置逻辑已经判断过,这里不再判断
|
| | | actWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | actWorldLVList = [int(strWorldLV) for strWorldLV in actWorldLVGainItemInfo.keys()]
|
| | | actWorldLVList.sort() # 使用 int 的值排,否则可能引起排序错误
|
| | | for worldLV in actWorldLVList:
|
| | | if actWorldLV <= worldLV:
|
| | | giveItemList = actWorldLVGainItemInfo[str(worldLV)]
|
| | | break
|
| | | if not giveItemList:
|
| | | giveItemList = actWorldLVGainItemInfo[str(actWorldLVList[-1])] # 没有匹配到的话默认取最后一个等级配置
|
| | | else:
|
| | | giveItemList = gainItemList
|
| | | return giveItemList
|
| | |
|
| | | def DoCTGLogic(curPlayer, coinType, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, ctgIpyData=None, coinExp=0):
|
| | | notifyMark = ctgIpyData.GetNotifyMark() if ctgIpyData else ""
|
| | | goldBefore = curPlayer.GetGold()
|
| | |
| | | OperationActionName_CollectWords2 = "ActCollectWords2" # 集字活动2
|
| | | OperationActionName_LuckyTreasure = "ActLuckyTreasure" # 幸运鉴宝活动
|
| | | OperationActionName_RechargePrize = "ActRechargePrize" # 充值返利活动
|
| | | OperationActionName_RechargeRebateGold = "ActRechargeRebateGold" # 充值返利仙玉活动(活动结束邮件发放,节日活动)
|
| | | OperationActionName_GrowupBuy = "ActGrowupBuy" # 成长必买活动
|
| | | #节日活动类型列表 - 该类型无视开服天,日期到了就开启
|
| | | FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket]
|
| | | FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket,
|
| | | OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy]
|
| | | #所有的运营活动列表,含节日活动
|
| | | OperationActionNameList = [OperationActionName_ExpRate, OperationActionName_CostRebate,
|
| | | OperationActionName_BossReborn,OperationActionName_SpringSale,
|
| | |
| | | OperationActionName_WeekParty, OperationActionName_LoginAward,
|
| | | OperationActionName_NewFairyCeremony, OperationActionName_LuckyTreasure,
|
| | | OperationActionName_DailyGiftbag, OperationActionName_RechargePrize,
|
| | | OperationActionName_CollectWords, OperationActionName_CollectWords2,
|
| | | OperationActionName_GrowupBuy
|
| | | ] + FeastOperationActionNameList
|
| | | OperationActionName_CollectWords, OperationActionName_CollectWords2] \
|
| | | + FeastOperationActionNameList
|
| | | #需要记录开启活动时的世界等级的运营活动
|
| | | NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell,
|
| | | OperationActionName_NewFairyCeremony, OperationActionName_FlashSale,
|