10009 【后端】【BT0.1】【主干】【港台】单笔充值活动增加每日可领取次数,每个档位每日20次
| | |
| | | {
|
| | | DWORD _TemplateID; //模板ID
|
| | | float SingleRechargeValue; //单笔充值额度
|
| | | BYTE AwardIndex; //返利奖励索引0~31,同个模板中不重复
|
| | | BYTE AwardIndex; //同个模板中不重复
|
| | | WORD AwardCountMax; //最大领奖次数,最大999次
|
| | | dict AwardItem; //返利物品信息列表 {职业:[(物品ID,个数,是否绑定),...]}
|
| | | char NotifyKey; //全服广播key,默认两个参数(玩家名, 档位额度)
|
| | | };
|
| | |
| | |
|
| | |
|
| | | class tagMCActSingleRechargeAward(Structure):
|
| | | AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引 0~31
|
| | | AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引
|
| | | AwardCountMax = 0 #(WORD AwardCountMax)// 最大领奖次数
|
| | | SingleRechargeValue = 0 #(DWORD SingleRechargeValue)// 单笔所需充值额度
|
| | | AwardItemCount = 0 #(BYTE AwardItemCount)// 奖励物品数
|
| | | AwardItem = list() #(vector<tagMCActSingleRechargeAwardItem> AwardItem)// 奖励物品信息
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | self.AwardIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.AwardCountMax,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.SingleRechargeValue,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.AwardItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.AwardItemCount):
|
| | |
| | |
|
| | | def Clear(self):
|
| | | self.AwardIndex = 0
|
| | | self.AwardCountMax = 0
|
| | | self.SingleRechargeValue = 0
|
| | | self.AwardItemCount = 0
|
| | | self.AwardItem = list()
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 1
|
| | | length += 2
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.AwardItemCount):
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteBYTE(data, self.AwardIndex)
|
| | | data = CommFunc.WriteWORD(data, self.AwardCountMax)
|
| | | data = CommFunc.WriteDWORD(data, self.SingleRechargeValue)
|
| | | data = CommFunc.WriteBYTE(data, self.AwardItemCount)
|
| | | for i in range(self.AwardItemCount):
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | AwardIndex:%d,
|
| | | AwardCountMax:%d,
|
| | | SingleRechargeValue:%d,
|
| | | AwardItemCount:%d,
|
| | | AwardItem:%s
|
| | | '''\
|
| | | %(
|
| | | self.AwardIndex,
|
| | | self.AwardCountMax,
|
| | | self.SingleRechargeValue,
|
| | | self.AwardItemCount,
|
| | | "..."
|
| | |
| | | #------------------------------------------------------
|
| | | # AA 51 单笔累充活动玩家信息 #tagMCActSingleRechargePlayerInfo
|
| | |
|
| | | class tagMCActSingleRechargePlayerInfo(Structure):
|
| | | class tagMCActSingleRechargePlayerAward(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ActNum", c_ubyte), #活动编号从1开始,目前支持两个累充活动同时存在且相互独立 1或2
|
| | | ("CanAwardValue", c_int), #可否领奖记录,按奖励索引二进制位存储是否可领取
|
| | | ("AwardRecord", c_int), #奖励领奖记录,按奖励索引二进制位存储是否已领取
|
| | | ("AwardIndex", c_ubyte), # 奖励索引
|
| | | ("CanGetCount", c_ushort), # 可领奖次数
|
| | | ("GetCount", c_ushort), # 已领奖次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x51
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | |
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x51
|
| | | self.ActNum = 0
|
| | | self.CanAwardValue = 0
|
| | | self.AwardRecord = 0
|
| | | self.AwardIndex = 0
|
| | | self.CanGetCount = 0
|
| | | self.GetCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCActSingleRechargePlayerInfo)
|
| | | return sizeof(tagMCActSingleRechargePlayerAward)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 51 单笔累充活动玩家信息 //tagMCActSingleRechargePlayerInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ActNum:%d,
|
| | | CanAwardValue:%d,
|
| | | AwardRecord:%d
|
| | | AwardIndex:%d,
|
| | | CanGetCount:%d,
|
| | | GetCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.AwardIndex,
|
| | | self.CanGetCount,
|
| | | self.GetCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActSingleRechargePlayerInfo(Structure):
|
| | | Head = tagHead()
|
| | | ActNum = 0 #(BYTE ActNum)//活动编号从1开始,目前支持两个累充活动同时存在且相互独立 1或2
|
| | | RecordCount = 0 #(BYTE RecordCount)
|
| | | AwardRecordList = list() #(vector<tagMCActSingleRechargePlayerAward> AwardRecordList)// 领奖次数记录列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x51
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.RecordCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.RecordCount):
|
| | | temAwardRecordList = tagMCActSingleRechargePlayerAward()
|
| | | _pos = temAwardRecordList.ReadData(_lpData, _pos)
|
| | | self.AwardRecordList.append(temAwardRecordList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x51
|
| | | self.ActNum = 0
|
| | | self.RecordCount = 0
|
| | | self.AwardRecordList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.RecordCount):
|
| | | length += self.AwardRecordList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.ActNum)
|
| | | data = CommFunc.WriteBYTE(data, self.RecordCount)
|
| | | for i in range(self.RecordCount):
|
| | | data = CommFunc.WriteString(data, self.AwardRecordList[i].GetLength(), self.AwardRecordList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ActNum:%d,
|
| | | RecordCount:%d,
|
| | | AwardRecordList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ActNum,
|
| | | self.CanAwardValue,
|
| | | self.AwardRecord
|
| | | self.RecordCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActSingleRechargePlayerInfo=tagMCActSingleRechargePlayerInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActSingleRechargePlayerInfo.Cmd,m_NAtagMCActSingleRechargePlayerInfo.SubCmd))] = m_NAtagMCActSingleRechargePlayerInfo
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActSingleRechargePlayerInfo.Head.Cmd,m_NAtagMCActSingleRechargePlayerInfo.Head.SubCmd))] = m_NAtagMCActSingleRechargePlayerInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | Def_PDict_SingleRechargeID = "SingleRechargeID_%s" # 玩家身上的活动ID,唯一标识,取活动开始日期time值,参数:(活动编号)
|
| | | Def_PDict_SingleRechargeTemplateID = "SingleRechargeTempID_%s" # 玩家身上的活动模板ID,参数:(活动编号)
|
| | | Def_PDict_SingleRechargeWorldLV = "SingleRechargeWorldLV_%s" #玩家身上的活动世界等级,参数:(活动编号)
|
| | | Def_PDict_SingleRechargeValue = "SingleRechargeValue_%s" # 领奖奖励值,按奖励索引二进制位代表是否可领奖,参数:(活动编号)
|
| | | Def_PDict_SingleRechargeAward = "SingleRechargeAward_%s" # 领奖记录值,按奖励索引二进制位代表是否已领奖,参数:(活动编号)
|
| | | Def_PDict_SingleRechargeValue = "SingleRechargeValue_%s_%s" # 领奖值,已领奖次数*1000+可领奖次数,参数:(活动编号,档位索引)
|
| | |
|
| | | #转盘活动
|
| | | Def_PDict_TurntableID = "TurntableID_%s" # 玩家身上的活动ID,唯一标识,取活动开始日期time值,参数:(活动编号)
|
| | |
| | |
|
| | |
|
| | | class tagMCActSingleRechargeAward(Structure):
|
| | | AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引 0~31
|
| | | AwardIndex = 0 #(BYTE AwardIndex)// 奖励索引
|
| | | AwardCountMax = 0 #(WORD AwardCountMax)// 最大领奖次数
|
| | | SingleRechargeValue = 0 #(DWORD SingleRechargeValue)// 单笔所需充值额度
|
| | | AwardItemCount = 0 #(BYTE AwardItemCount)// 奖励物品数
|
| | | AwardItem = list() #(vector<tagMCActSingleRechargeAwardItem> AwardItem)// 奖励物品信息
|
| | |
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | self.AwardIndex,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.AwardCountMax,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.SingleRechargeValue,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.AwardItemCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.AwardItemCount):
|
| | |
| | |
|
| | | def Clear(self):
|
| | | self.AwardIndex = 0
|
| | | self.AwardCountMax = 0
|
| | | self.SingleRechargeValue = 0
|
| | | self.AwardItemCount = 0
|
| | | self.AwardItem = list()
|
| | |
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 1
|
| | | length += 2
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.AwardItemCount):
|
| | |
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteBYTE(data, self.AwardIndex)
|
| | | data = CommFunc.WriteWORD(data, self.AwardCountMax)
|
| | | data = CommFunc.WriteDWORD(data, self.SingleRechargeValue)
|
| | | data = CommFunc.WriteBYTE(data, self.AwardItemCount)
|
| | | for i in range(self.AwardItemCount):
|
| | |
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | AwardIndex:%d,
|
| | | AwardCountMax:%d,
|
| | | SingleRechargeValue:%d,
|
| | | AwardItemCount:%d,
|
| | | AwardItem:%s
|
| | | '''\
|
| | | %(
|
| | | self.AwardIndex,
|
| | | self.AwardCountMax,
|
| | | self.SingleRechargeValue,
|
| | | self.AwardItemCount,
|
| | | "..."
|
| | |
| | | #------------------------------------------------------
|
| | | # AA 51 单笔累充活动玩家信息 #tagMCActSingleRechargePlayerInfo
|
| | |
|
| | | class tagMCActSingleRechargePlayerInfo(Structure):
|
| | | class tagMCActSingleRechargePlayerAward(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("ActNum", c_ubyte), #活动编号从1开始,目前支持两个累充活动同时存在且相互独立 1或2
|
| | | ("CanAwardValue", c_int), #可否领奖记录,按奖励索引二进制位存储是否可领取
|
| | | ("AwardRecord", c_int), #奖励领奖记录,按奖励索引二进制位存储是否已领取
|
| | | ("AwardIndex", c_ubyte), # 奖励索引
|
| | | ("CanGetCount", c_ushort), # 可领奖次数
|
| | | ("GetCount", c_ushort), # 已领奖次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x51
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | |
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x51
|
| | | self.ActNum = 0
|
| | | self.CanAwardValue = 0
|
| | | self.AwardRecord = 0
|
| | | self.AwardIndex = 0
|
| | | self.CanGetCount = 0
|
| | | self.GetCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCActSingleRechargePlayerInfo)
|
| | | return sizeof(tagMCActSingleRechargePlayerAward)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 51 单笔累充活动玩家信息 //tagMCActSingleRechargePlayerInfo:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | ActNum:%d,
|
| | | CanAwardValue:%d,
|
| | | AwardRecord:%d
|
| | | AwardIndex:%d,
|
| | | CanGetCount:%d,
|
| | | GetCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.AwardIndex,
|
| | | self.CanGetCount,
|
| | | self.GetCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActSingleRechargePlayerInfo(Structure):
|
| | | Head = tagHead()
|
| | | ActNum = 0 #(BYTE ActNum)//活动编号从1开始,目前支持两个累充活动同时存在且相互独立 1或2
|
| | | RecordCount = 0 #(BYTE RecordCount)
|
| | | AwardRecordList = list() #(vector<tagMCActSingleRechargePlayerAward> AwardRecordList)// 领奖次数记录列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x51
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ActNum,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.RecordCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.RecordCount):
|
| | | temAwardRecordList = tagMCActSingleRechargePlayerAward()
|
| | | _pos = temAwardRecordList.ReadData(_lpData, _pos)
|
| | | self.AwardRecordList.append(temAwardRecordList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x51
|
| | | self.ActNum = 0
|
| | | self.RecordCount = 0
|
| | | self.AwardRecordList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | length += 1
|
| | | for i in range(self.RecordCount):
|
| | | length += self.AwardRecordList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.ActNum)
|
| | | data = CommFunc.WriteBYTE(data, self.RecordCount)
|
| | | for i in range(self.RecordCount):
|
| | | data = CommFunc.WriteString(data, self.AwardRecordList[i].GetLength(), self.AwardRecordList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ActNum:%d,
|
| | | RecordCount:%d,
|
| | | AwardRecordList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ActNum,
|
| | | self.CanAwardValue,
|
| | | self.AwardRecord
|
| | | self.RecordCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActSingleRechargePlayerInfo=tagMCActSingleRechargePlayerInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActSingleRechargePlayerInfo.Cmd,m_NAtagMCActSingleRechargePlayerInfo.SubCmd))] = m_NAtagMCActSingleRechargePlayerInfo
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActSingleRechargePlayerInfo.Head.Cmd,m_NAtagMCActSingleRechargePlayerInfo.Head.SubCmd))] = m_NAtagMCActSingleRechargePlayerInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | ("DWORD", "TemplateID", 1),
|
| | | ("float", "SingleRechargeValue", 0),
|
| | | ("BYTE", "AwardIndex", 0),
|
| | | ("WORD", "AwardCountMax", 0),
|
| | | ("dict", "AwardItem", 0),
|
| | | ("char", "NotifyKey", 0),
|
| | | ),
|
| | |
| | | self.TemplateID = 0
|
| | | self.SingleRechargeValue = 0.0
|
| | | self.AwardIndex = 0
|
| | | self.AwardCountMax = 0
|
| | | self.AwardItem = {}
|
| | | self.NotifyKey = "" |
| | | return |
| | | |
| | | def GetTemplateID(self): return self.TemplateID # 模板ID
|
| | | def GetSingleRechargeValue(self): return self.SingleRechargeValue # 单笔充值额度
|
| | | def GetAwardIndex(self): return self.AwardIndex # 返利奖励索引0~31,同个模板中不重复
|
| | | def GetAwardIndex(self): return self.AwardIndex # 同个模板中不重复
|
| | | def GetAwardCountMax(self): return self.AwardCountMax # 最大领奖次数,最大999次
|
| | | def GetAwardItem(self): return self.AwardItem # 返利物品信息列表 {职业:[(物品ID,个数,是否绑定),...]}
|
| | | def GetNotifyKey(self): return self.NotifyKey # 全服广播key,默认两个参数(玩家名, 档位额度) |
| | | |
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeID % actNum, actID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeTemplateID % actNum, templateID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeWorldLV % actNum, actWorldLV)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % actNum, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeAward % actNum, 0)
|
| | | |
| | | if actID and templateID:
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActSingleRechargeAward", templateID)
|
| | | if ipyDataList:
|
| | | for ipyData in ipyDataList:
|
| | | awardIndex = ipyData.GetAwardIndex()
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % (actNum, awardIndex), 0)
|
| | | |
| | | Sync_SingleRechargeActionInfo(curPlayer, actNum)
|
| | | Sync_SingleRechargePlayerInfo(curPlayer, actNum)
|
| | | return True
|
| | |
|
| | | def GetAwardCountInfo(curPlayer, actNum, awardIndex):
|
| | | valueInfo = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % (actNum, awardIndex))
|
| | | getCount = valueInfo / 1000
|
| | | canGetCount = valueInfo % 1000
|
| | | return getCount, canGetCount
|
| | | def SetAwardCountInfo(curPlayer, actNum, awardIndex, getCount, canGetCount):
|
| | | valueInfo = getCount * 1000 + canGetCount
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % (actNum, awardIndex), valueInfo)
|
| | | return valueInfo
|
| | |
|
| | | def __SendSingleRechargeMail(curPlayer, playerTemplateID, playerWorldLV, actNum):
|
| | | # 未领取的奖励邮件发放
|
| | |
|
| | | if not playerTemplateID:
|
| | | return
|
| | | |
| | | canAwardValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | if not canAwardValue:
|
| | | return
|
| | |
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActSingleRechargeAward", playerTemplateID)
|
| | |
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | batchPlayerIDList, batchAddItemList, batchParamList = [], [], []
|
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeAward % actNum)
|
| | |
|
| | | for ipyData in ipyDataList:
|
| | | awardIndex = ipyData.GetAwardIndex()
|
| | | if awardRecord & pow(2, awardIndex):
|
| | | #GameWorld.DebugLog("单笔累充已发放过奖励!awardIndex=%s" % awardIndex)
|
| | | getCount, canGetCount = GetAwardCountInfo(curPlayer, actNum, awardIndex)
|
| | | if getCount >= canGetCount:
|
| | | #GameWorld.DebugLog("单笔累充已经全部领奖!awardIndex=%s" % awardIndex)
|
| | | continue
|
| | | SetAwardCountInfo(curPlayer, actNum, awardIndex, canGetCount, canGetCount)
|
| | |
|
| | | unGetCount = canGetCount - getCount
|
| | | singleValue = ipyData.GetSingleRechargeValue()
|
| | | if not canAwardValue & pow(2, awardIndex):
|
| | | #GameWorld.DebugLog("单笔累充不能领奖!awardIndex=%s" % awardIndex)
|
| | | continue
|
| | | awardRecord |= pow(2, awardIndex) |
| | | |
| | | awardItemList = GameWorld.GetDictValueByRangeKey(ipyData.GetAwardItem(), playerWorldLV, [])
|
| | | batchPlayerIDList.append([playerID])
|
| | | batchAddItemList.append(awardItemList)
|
| | | batchParamList.append([singleValue])
|
| | | |
| | | for _ in range(unGetCount):
|
| | | batchPlayerIDList.append([playerID])
|
| | | batchAddItemList.append(awardItemList)
|
| | | batchParamList.append([singleValue])
|
| | | |
| | | if batchPlayerIDList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeAward % actNum, awardRecord)
|
| | | PlayerControl.SendMailBatch("SingleRechargeMail%s" % actNum, batchPlayerIDList, batchAddItemList, batchParamList)
|
| | |
|
| | | return
|
| | |
| | | if not awardIpyDataList:
|
| | | continue
|
| | |
|
| | | canAwardChange = False
|
| | | canAwardValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | awardIndexList = []
|
| | | awardRuleType = ipyData.GetAwardRuleType()
|
| | | GameWorld.DebugLog("单笔累充充值活动,actNum=%s,awardRuleType=%s,canAwardValue=%s,curRechargeValue=%s" |
| | | % (actNum, awardRuleType, canAwardValue, curRechargeValue))
|
| | | GameWorld.DebugLog("单笔累充充值活动,actNum=%s,awardRuleType=%s,curRechargeValue=%s" % (actNum, awardRuleType, curRechargeValue))
|
| | | # 向下兼容所有档次
|
| | | if awardRuleType == 0:
|
| | | for awardIpyData in awardIpyDataList:
|
| | | awardIndex = awardIpyData.GetAwardIndex()
|
| | | singleValue = CommFunc.RMBToCoin(awardIpyData.GetSingleRechargeValue())
|
| | | if canAwardValue & pow(2, awardIndex):
|
| | | #GameWorld.DebugLog(" 已经可领奖,不处理!awardRuleType=%s,awardIndex=%s" % (awardRuleType, awardIndex))
|
| | | continue
|
| | | if curRechargeValue < singleValue:
|
| | | #GameWorld.DebugLog(" 未达到档次额度,不处理!awardRuleType=%s,awardIndex=%s,singleValue=%s" |
| | | # % (awardRuleType, awardIndex, singleValue))
|
| | | continue
|
| | | |
| | | canAwardChange = True
|
| | | canAwardValue |= pow(2, awardIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % actNum, canAwardValue)
|
| | | GameWorld.DebugLog(" 设置档次可领取!awardRuleType=%s,awardIndex=%s,singleValue=%s,canAwardValue=%s" |
| | | % (awardRuleType, awardIndex, singleValue, canAwardValue))
|
| | | |
| | | pass
|
| | | # 匹配最高档次
|
| | | elif awardRuleType == 1:
|
| | | for awardIpyData in awardIpyDataList[::-1]:
|
| | | awardIndex = awardIpyData.GetAwardIndex()
|
| | | singleValue = CommFunc.RMBToCoin(awardIpyData.GetSingleRechargeValue())
|
| | | if canAwardValue & pow(2, awardIndex):
|
| | | #GameWorld.DebugLog(" 已经可领奖,不处理!awardRuleType=%s,awardIndex=%s" % (awardRuleType, awardIndex))
|
| | | continue
|
| | | if curRechargeValue < singleValue:
|
| | | #GameWorld.DebugLog(" 未达到档次额度,不处理!awardRuleType=%s,awardIndex=%s,singleValue=%s" |
| | | # % (awardRuleType, awardIndex, singleValue))
|
| | | continue
|
| | | |
| | | canAwardChange = True
|
| | | canAwardValue |= pow(2, awardIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % actNum, canAwardValue)
|
| | | GameWorld.DebugLog(" 设置最高档次可领取!awardRuleType=%s,awardIndex=%s,singleValue=%s,canAwardValue=%s" |
| | | % (awardRuleType, awardIndex, singleValue, canAwardValue))
|
| | | break
|
| | | |
| | | pass |
| | | # 精确匹配对应档次
|
| | | elif awardRuleType == 2:
|
| | | for awardIpyData in awardIpyDataList:
|
| | |
| | | #GameWorld.DebugLog(" 不等于档次额度,不处理!awardRuleType=%s,awardIndex=%s,singleValue=%s"
|
| | | # % (awardRuleType, awardIndex, singleValue))
|
| | | continue
|
| | | if canAwardValue & pow(2, awardIndex):
|
| | | #GameWorld.DebugLog(" 已经可领奖,不处理!awardRuleType=%s,awardIndex=%s" % (awardRuleType, awardIndex))
|
| | | awardCountMax = awardIpyData.GetAwardCountMax()
|
| | | getCount, canGetCount = GetAwardCountInfo(curPlayer, actNum, awardIndex)
|
| | | if canGetCount >= awardCountMax:
|
| | | GameWorld.DebugLog(" 已达最大可领奖次数,不处理!awardRuleType=%s,awardIndex=%s,awardCountMax=%s" % (awardRuleType, awardIndex, awardCountMax))
|
| | | break
|
| | |
|
| | | canAwardChange = True
|
| | | canAwardValue |= pow(2, awardIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeValue % actNum, canAwardValue)
|
| | | GameWorld.DebugLog(" 设置精确档次可领取!awardRuleType=%s,awardIndex=%s,singleValue=%s,canAwardValue=%s" |
| | | % (awardRuleType, awardIndex, singleValue, canAwardValue))
|
| | | awardIndexList.append(awardIndex)
|
| | | canGetCount += 1
|
| | | SetAwardCountInfo(curPlayer, actNum, awardIndex, getCount, canGetCount)
|
| | | GameWorld.DebugLog(" 设置精确档次可领取!awardRuleType=%s,awardIndex=%s,singleValue=%s,canGetCount=%s" |
| | | % (awardRuleType, awardIndex, singleValue, canGetCount))
|
| | | break
|
| | |
|
| | | else:
|
| | | continue
|
| | |
|
| | | if not canAwardChange:
|
| | | if not awardIndexList:
|
| | | continue
|
| | |
|
| | | Sync_SingleRechargePlayerInfo(curPlayer, actNum)
|
| | | Sync_SingleRechargePlayerInfo(curPlayer, actNum, awardIndexList)
|
| | |
|
| | | # 线下活动,检查发放奖励
|
| | | if ipyData.GetIsOfflineAct():
|
| | |
| | | GameWorld.DebugLog("该单笔累充活动非活动中,无法领奖!actNum=%s,state=%s,templateID=%s" % (actNum, state, templateID), playerID)
|
| | | return
|
| | |
|
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeAward % actNum)
|
| | | if awardRecord & pow(2, awardIndex):
|
| | | GameWorld.DebugLog("已经领取过该单笔累充活动奖励! actNum=%s,awardIndex=%s" % (actNum, awardIndex), playerID)
|
| | | return
|
| | | |
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActSingleRechargeAward", templateID)
|
| | | if not ipyDataList:
|
| | | return
|
| | |
| | | GameWorld.DebugLog("找不到该单笔累充活动档位索引奖励!actNum=%s,templateID=%s,awardIndex=%s" % (actNum, templateID, awardIndex), playerID)
|
| | | return
|
| | |
|
| | | singleValue = awardIpyData.GetSingleRechargeValue()
|
| | | canAwardValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | |
| | | if not canAwardValue & pow(2, awardIndex):
|
| | | GameWorld.DebugLog("该档次奖励无法领取! templateID=%s,awardIndex=%s,singleValue=%s,canAwardValue%s" |
| | | % (templateID, awardIndex, singleValue, canAwardValue), playerID)
|
| | | getCount, canGetCount = GetAwardCountInfo(curPlayer, actNum, awardIndex)
|
| | | if getCount >= canGetCount:
|
| | | GameWorld.DebugLog("该单笔累充活动奖励已达最大可领奖次数! actNum=%s,awardIndex=%s,getCount(%s) >= canGetCount(%s)" % (actNum, awardIndex, getCount, canGetCount), playerID)
|
| | | return
|
| | | |
| | | singleValue = awardIpyData.GetSingleRechargeValue()
|
| | |
|
| | | actWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeWorldLV % actNum)
|
| | | awardItemList = GameWorld.GetDictValueByRangeKey(ipyData.GetAwardItem(), actWorldLV, [])
|
| | |
| | | if not ItemControler.CheckPackSpaceEnough(curPlayer, awardItemList):
|
| | | return
|
| | |
|
| | | awardRecord |= pow(2, awardIndex)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SingleRechargeAward % actNum, awardRecord)
|
| | | Sync_SingleRechargePlayerInfo(curPlayer, actNum)
|
| | | getCount += 1
|
| | | SetAwardCountInfo(curPlayer, actNum, awardIndex, getCount, canGetCount)
|
| | | Sync_SingleRechargePlayerInfo(curPlayer, actNum, [awardIndex])
|
| | |
|
| | | GameWorld.DebugLog(" 领取成功! actNum=%s,templateID=%s,awardIndex=%s,singleValue=%s,awardRecord=%s" |
| | | % (actNum, templateID, awardIndex, singleValue, awardRecord))
|
| | | GameWorld.DebugLog(" 领取成功! actNum=%s,templateID=%s,awardIndex=%s,singleValue=%s,getCount=%s,canGetCount=%s" |
| | | % (actNum, templateID, awardIndex, singleValue, getCount, canGetCount))
|
| | |
|
| | | notifyKey = awardIpyData.GetNotifyKey()
|
| | | if notifyKey:
|
| | |
| | |
|
| | | return
|
| | |
|
| | | def Sync_SingleRechargePlayerInfo(curPlayer, actNum):
|
| | | def Sync_SingleRechargePlayerInfo(curPlayer, actNum, awardIndexList=None):
|
| | | ## 通知玩家数据信息
|
| | |
|
| | | actInfo = GameWorld.GetActInfo(ShareDefine.OperationActionName_SingleRecharge, actNum)
|
| | |
| | | #线下活动不下发
|
| | | return
|
| | |
|
| | | if awardIndexList == None:
|
| | | awardIndexList = []
|
| | | templateID = GetTemplateID(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | if not templateID:
|
| | | return
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList("ActSingleRechargeAward", templateID)
|
| | | if not ipyDataList:
|
| | | return
|
| | | for awardIpyData in ipyDataList:
|
| | | awardIndexList.append(awardIpyData.GetAwardIndex())
|
| | | |
| | | if not awardIndexList:
|
| | | return
|
| | | |
| | | playerActInfo = ChPyNetSendPack.tagMCActSingleRechargePlayerInfo()
|
| | | playerActInfo.ActNum = actNum
|
| | | playerActInfo.CanAwardValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeValue % actNum)
|
| | | playerActInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SingleRechargeAward % actNum)
|
| | | playerActInfo.AwardRecordList = []
|
| | | for awardIndex in awardIndexList:
|
| | | getCount, canGetCount = GetAwardCountInfo(curPlayer, actNum, awardIndex)
|
| | | awardRecord = ChPyNetSendPack.tagMCActSingleRechargePlayerAward()
|
| | | awardRecord.Clear()
|
| | | awardRecord.AwardIndex = awardIndex
|
| | | awardRecord.CanGetCount = canGetCount
|
| | | awardRecord.GetCount = getCount
|
| | | playerActInfo.AwardRecordList.append(awardRecord)
|
| | | playerActInfo.RecordCount = len(playerActInfo.AwardRecordList)
|
| | | NetPackCommon.SendFakePack(curPlayer, playerActInfo)
|
| | | return
|
| | |
|
| | |
| | | for awardIpyData in ipyDataList:
|
| | | awardInfo = ChPyNetSendPack.tagMCActSingleRechargeAward()
|
| | | awardInfo.AwardIndex = awardIpyData.GetAwardIndex()
|
| | | awardInfo.AwardCountMax = awardIpyData.GetAwardCountMax()
|
| | | awardInfo.SingleRechargeValue = CommFunc.RMBToCoin(awardIpyData.GetSingleRechargeValue())
|
| | | awardInfo.AwardItem = []
|
| | | awardItemList = GameWorld.GetDictValueByRangeKey(awardIpyData.GetAwardItem(), actWorldLV, [])
|