| | |
| | | BYTE RefreshType; //刷新类型 0-不重置,1-onWeek0点,2-onWeek5点,3-OnDay0点,4-OnDay5点
|
| | | DWORD ServerLimitCnt; //全服限制数量
|
| | | }; |
| | |
|
| | | //许愿池活动时间表
|
| | |
|
| | | struct tagActWishingWell
|
| | | {
|
| | | DWORD _CfgID; //配置ID
|
| | | char ActMark; //活动组标记
|
| | | list ServerIDList; //服务器ID列表
|
| | | char StartDate; //开启日期
|
| | | char EndDate; //结束日期
|
| | | BYTE IsDayReset; //是否每天重置
|
| | | BYTE ResetType; //重置类型,0-0点重置;1-5点重置
|
| | | dict NotifyInfoStart; //全服提示信息 - 相对开始时间
|
| | | dict NotifyInfoEnd; //全服提示信息 - 相对结束时间
|
| | | list NotifyInfoLoop; //全服提示信息 - 循环广播[间隔分钟, 广播key]
|
| | | WORD LVLimit; //限制等级
|
| | | }; |
| | |
| | | char MailKey; //活动更新时发送邮件key
|
| | | list MailItemPrize; //活动更新时发送邮件奖励物品
|
| | | }; |
| | |
|
| | | //许愿池活动时间表
|
| | |
|
| | | struct tagActWishingWell
|
| | | {
|
| | | DWORD _CfgID; //配置ID
|
| | | char StartDate; //开启日期
|
| | | char EndDate; //结束日期
|
| | | BYTE IsDayReset; //是否每天重置
|
| | | BYTE ResetType; //重置类型,0-0点重置;1-5点重置
|
| | | WORD LVLimit; //限制等级
|
| | | BYTE TemplateID; //模板编号
|
| | | };
|
| | |
|
| | | //许愿池库模板表
|
| | |
|
| | | struct tagWishingWell
|
| | | {
|
| | | BYTE _TemplateID; //模板ID
|
| | | BYTE IsFree; //是否免费库
|
| | | list WorldLVLimit; //世界等级范围
|
| | | DWORD ItemID; //物品ID
|
| | | WORD ItemCnt; //物品数量
|
| | | BYTE IsBind; //是否绑定
|
| | | DWORD Weight; //权重
|
| | | DWORD Mark; //排序用标识
|
| | | }; |
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 07 许愿池活动刷新奖池 #tagCMActWishingRefresh
|
| | |
|
| | | class tagCMActWishingRefresh(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("IsFree", c_ubyte), # 是否免费刷新
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x07
|
| | | 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 = 0x07
|
| | | self.IsFree = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMActWishingRefresh)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 07 许愿池活动刷新奖池 //tagCMActWishingRefresh:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | IsFree:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.IsFree
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMActWishingRefresh=tagCMActWishingRefresh()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMActWishingRefresh.Cmd,m_NAtagCMActWishingRefresh.SubCmd))] = m_NAtagCMActWishingRefresh
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 06 许愿池活动许愿 #tagCMActWishing
|
| | |
|
| | | class tagCMActWishing(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("SrcWellType", c_ubyte), # 来源库 0-可选库 1-结果库
|
| | | ("SrcIndex", c_ubyte), # 来源索引
|
| | | ("DesWellType", c_ubyte), # 目标库 0-可选库 1-结果库
|
| | | ("DesIndex", c_ubyte), # 目标索引
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x06
|
| | | 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 = 0x06
|
| | | self.SrcWellType = 0
|
| | | self.SrcIndex = 0
|
| | | self.DesWellType = 0
|
| | | self.DesIndex = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMActWishing)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 06 许愿池活动许愿 //tagCMActWishing:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | SrcWellType:%d,
|
| | | SrcIndex:%d,
|
| | | DesWellType:%d,
|
| | | DesIndex:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.SrcWellType,
|
| | | self.SrcIndex,
|
| | | self.DesWellType,
|
| | | self.DesIndex
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMActWishing=tagCMActWishing()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMActWishing.Cmd,m_NAtagCMActWishing.SubCmd))] = m_NAtagCMActWishing
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 05 限时抢购预约 #tagCMFlashSaleAppointment
|
| | |
|
| | | class tagCMFlashSaleAppointment(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 1B 许愿池拖动结果 #tagMCActWishingDragResult
|
| | |
|
| | | class tagMCPlayerWishingDragInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("WellType", c_ubyte), # 库 0-可选库 1-结果库
|
| | | ("Index", c_ubyte), # 索引
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("ItemCnt", c_ushort), # 物品数量
|
| | | ("IsBind", c_ubyte), # 是否绑定
|
| | | ("IsSpecial", 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.WellType = 0
|
| | | self.Index = 0
|
| | | self.ItemID = 0
|
| | | self.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | self.IsSpecial = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCPlayerWishingDragInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 1B 许愿池拖动结果 //tagMCActWishingDragResult:
|
| | | WellType:%d,
|
| | | Index:%d,
|
| | | ItemID:%d,
|
| | | ItemCnt:%d,
|
| | | IsBind:%d,
|
| | | IsSpecial:%d
|
| | | '''\
|
| | | %(
|
| | | self.WellType,
|
| | | self.Index,
|
| | | self.ItemID,
|
| | | self.ItemCnt,
|
| | | self.IsBind,
|
| | | self.IsSpecial
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActWishingDragResult(Structure):
|
| | | Head = tagHead()
|
| | | Cnt = 0 #(BYTE Cnt)
|
| | | InfoList = list() #(vector<tagMCPlayerWishingDragInfo> InfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1B
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Cnt):
|
| | | temInfoList = tagMCPlayerWishingDragInfo()
|
| | | _pos = temInfoList.ReadData(_lpData, _pos)
|
| | | self.InfoList.append(temInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1B
|
| | | self.Cnt = 0
|
| | | self.InfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Cnt):
|
| | | length += self.InfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Cnt)
|
| | | for i in range(self.Cnt):
|
| | | data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Cnt:%d,
|
| | | InfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Cnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActWishingDragResult=tagMCActWishingDragResult()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActWishingDragResult.Head.Cmd,m_NAtagMCActWishingDragResult.Head.SubCmd))] = m_NAtagMCActWishingDragResult
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 19 许愿池活动信息 #tagMCActWishingWellInfo
|
| | |
|
| | | class tagMCWishingWellItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("ItemCnt", c_ushort), # 物品数量
|
| | | ("IsBind", c_ubyte), # 是否绑定
|
| | | ("Mark", c_int), # 排序标识
|
| | | ]
|
| | |
|
| | | 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.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | self.Mark = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCWishingWellItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 19 许愿池活动信息 //tagMCActWishingWellInfo:
|
| | | ItemID:%d,
|
| | | ItemCnt:%d,
|
| | | IsBind:%d,
|
| | | Mark:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCnt,
|
| | | self.IsBind,
|
| | | self.Mark
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActWishingWellInfo(Structure):
|
| | | Head = tagHead()
|
| | | StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置
|
| | | ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置
|
| | | LimitLV = 0 #(WORD LimitLV)// 限制等级
|
| | | Count = 0 #(WORD Count)// 物品数
|
| | | WellItemInfo = list() #(vector<tagMCWishingWellItem> WellItemInfo)// 随机库物品信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x19
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.IsDayReset,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.ResetType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temWellItemInfo = tagMCWishingWellItem()
|
| | | _pos = temWellItemInfo.ReadData(_lpData, _pos)
|
| | | self.WellItemInfo.append(temWellItemInfo)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x19
|
| | | self.StartDate = ""
|
| | | self.EndtDate = ""
|
| | | self.IsDayReset = 0
|
| | | self.ResetType = 0
|
| | | self.LimitLV = 0
|
| | | self.Count = 0
|
| | | self.WellItemInfo = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 10
|
| | | length += 10
|
| | | length += 1
|
| | | length += 1
|
| | | length += 2
|
| | | length += 2
|
| | | for i in range(self.Count):
|
| | | length += self.WellItemInfo[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteString(data, 10, self.StartDate)
|
| | | data = CommFunc.WriteString(data, 10, self.EndtDate)
|
| | | data = CommFunc.WriteBYTE(data, self.IsDayReset)
|
| | | data = CommFunc.WriteBYTE(data, self.ResetType)
|
| | | data = CommFunc.WriteWORD(data, self.LimitLV)
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.WellItemInfo[i].GetLength(), self.WellItemInfo[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | IsDayReset:%d,
|
| | | ResetType:%d,
|
| | | LimitLV:%d,
|
| | | Count:%d,
|
| | | WellItemInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.IsDayReset,
|
| | | self.ResetType,
|
| | | self.LimitLV,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActWishingWellInfo=tagMCActWishingWellInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActWishingWellInfo.Head.Cmd,m_NAtagMCActWishingWellInfo.Head.SubCmd))] = m_NAtagMCActWishingWellInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 1A 许愿池活动玩家信息 #tagMCActWishingWellPlayerInfo
|
| | |
|
| | | class tagMCPlayerWishingWellItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("ItemCnt", c_ushort), # 物品数量
|
| | | ("IsBind", c_ubyte), # 是否绑定
|
| | | ("IsSpecial", 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.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | self.IsSpecial = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCPlayerWishingWellItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 1A 许愿池活动玩家信息 //tagMCActWishingWellPlayerInfo:
|
| | | ItemID:%d,
|
| | | ItemCnt:%d,
|
| | | IsBind:%d,
|
| | | IsSpecial:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCnt,
|
| | | self.IsBind,
|
| | | self.IsSpecial
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActWishingWellPlayerInfo(Structure):
|
| | | Head = tagHead()
|
| | | FreeStartTime = 0 #(DWORD FreeStartTime)// 免费开始倒计时时间
|
| | | WishCnt = 0 #(DWORD WishCnt)// 许愿付费刷新次数
|
| | | WellItemCnt = 0 #(BYTE WellItemCnt)//许愿池物品数量
|
| | | WellItemInfo = list() #(vector<tagMCPlayerWishingWellItem> WellItemInfo)// 随机库物品信息
|
| | | CurAwardCnt = 0 #(BYTE CurAwardCnt)// 当前奖励物品数量
|
| | | CurAwardItemInfo = list() #(vector<tagMCPlayerWishingWellItem> CurAwardItemInfo)// 当前奖励物品
|
| | | LastAwardCnt = 0 #(BYTE LastAwardCnt)// 可领取奖励物品数量
|
| | | LastAwardItemInfo = list() #(vector<tagMCPlayerWishingWellItem> LastAwardItemInfo)// 可领取奖励物品
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1A
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.FreeStartTime,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.WishCnt,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.WellItemCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.WellItemCnt):
|
| | | temWellItemInfo = tagMCPlayerWishingWellItem()
|
| | | _pos = temWellItemInfo.ReadData(_lpData, _pos)
|
| | | self.WellItemInfo.append(temWellItemInfo)
|
| | | self.CurAwardCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.CurAwardCnt):
|
| | | temCurAwardItemInfo = tagMCPlayerWishingWellItem()
|
| | | _pos = temCurAwardItemInfo.ReadData(_lpData, _pos)
|
| | | self.CurAwardItemInfo.append(temCurAwardItemInfo)
|
| | | self.LastAwardCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.LastAwardCnt):
|
| | | temLastAwardItemInfo = tagMCPlayerWishingWellItem()
|
| | | _pos = temLastAwardItemInfo.ReadData(_lpData, _pos)
|
| | | self.LastAwardItemInfo.append(temLastAwardItemInfo)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1A
|
| | | self.FreeStartTime = 0
|
| | | self.WishCnt = 0
|
| | | self.WellItemCnt = 0
|
| | | self.WellItemInfo = list()
|
| | | self.CurAwardCnt = 0
|
| | | self.CurAwardItemInfo = list()
|
| | | self.LastAwardCnt = 0
|
| | | self.LastAwardItemInfo = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.WellItemCnt):
|
| | | length += self.WellItemInfo[i].GetLength()
|
| | | length += 1
|
| | | for i in range(self.CurAwardCnt):
|
| | | length += self.CurAwardItemInfo[i].GetLength()
|
| | | length += 1
|
| | | for i in range(self.LastAwardCnt):
|
| | | length += self.LastAwardItemInfo[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.FreeStartTime)
|
| | | data = CommFunc.WriteDWORD(data, self.WishCnt)
|
| | | data = CommFunc.WriteBYTE(data, self.WellItemCnt)
|
| | | for i in range(self.WellItemCnt):
|
| | | data = CommFunc.WriteString(data, self.WellItemInfo[i].GetLength(), self.WellItemInfo[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.CurAwardCnt)
|
| | | for i in range(self.CurAwardCnt):
|
| | | data = CommFunc.WriteString(data, self.CurAwardItemInfo[i].GetLength(), self.CurAwardItemInfo[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.LastAwardCnt)
|
| | | for i in range(self.LastAwardCnt):
|
| | | data = CommFunc.WriteString(data, self.LastAwardItemInfo[i].GetLength(), self.LastAwardItemInfo[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | FreeStartTime:%d,
|
| | | WishCnt:%d,
|
| | | WellItemCnt:%d,
|
| | | WellItemInfo:%s,
|
| | | CurAwardCnt:%d,
|
| | | CurAwardItemInfo:%s,
|
| | | LastAwardCnt:%d,
|
| | | LastAwardItemInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.FreeStartTime,
|
| | | self.WishCnt,
|
| | | self.WellItemCnt,
|
| | | "...",
|
| | | self.CurAwardCnt,
|
| | | "...",
|
| | | self.LastAwardCnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActWishingWellPlayerInfo=tagMCActWishingWellPlayerInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActWishingWellPlayerInfo.Head.Cmd,m_NAtagMCActWishingWellPlayerInfo.Head.SubCmd))] = m_NAtagMCActWishingWellPlayerInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 15 仙界盛典全民来嗨玩家信息 #tagMCAllPeoplePartyInfo
|
| | |
|
| | | class tagMCAllPeoplePartyCount(Structure):
|
| | |
| | |
|
| | |
|
| | |
|
| | | if state == 1 and actName in ShareDefine.NeedWorldLVOperationActNameList:
|
| | | if state >= 1 and actName in ShareDefine.NeedWorldLVOperationActNameList:
|
| | | actWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % actName)
|
| | | sendMapServerMsgDict[ShareDefine.ActKey_WorldLV] = actWorldLV
|
| | |
|
| | |
| | | ("BYTE", "RefreshType", 0),
|
| | | ("DWORD", "ServerLimitCnt", 0),
|
| | | ),
|
| | |
|
| | | "ActWishingWell":(
|
| | | ("DWORD", "CfgID", 1),
|
| | | ("char", "ActMark", 0),
|
| | | ("list", "ServerIDList", 0),
|
| | | ("char", "StartDate", 0),
|
| | | ("char", "EndDate", 0),
|
| | | ("BYTE", "IsDayReset", 0),
|
| | | ("BYTE", "ResetType", 0),
|
| | | ("dict", "NotifyInfoStart", 0),
|
| | | ("dict", "NotifyInfoEnd", 0),
|
| | | ("list", "NotifyInfoLoop", 0),
|
| | | ("WORD", "LVLimit", 0),
|
| | | ),
|
| | | }
|
| | |
|
| | | |
| | |
| | | def GetRefreshType(self): return self.RefreshType # 刷新类型 0-不重置,1-onWeek0点,2-onWeek5点,3-OnDay0点,4-OnDay5点
|
| | | def GetServerLimitCnt(self): return self.ServerLimitCnt # 全服限制数量 |
| | |
|
| | | # 许愿池活动时间表 |
| | | class IPY_ActWishingWell(): |
| | | |
| | | def __init__(self): |
| | | self.CfgID = 0
|
| | | self.ActMark = ""
|
| | | self.ServerIDList = []
|
| | | self.StartDate = ""
|
| | | self.EndDate = ""
|
| | | self.IsDayReset = 0
|
| | | self.ResetType = 0
|
| | | self.NotifyInfoStart = {}
|
| | | self.NotifyInfoEnd = {}
|
| | | self.NotifyInfoLoop = []
|
| | | self.LVLimit = 0 |
| | | return |
| | | |
| | | def GetCfgID(self): return self.CfgID # 配置ID
|
| | | def GetActMark(self): return self.ActMark # 活动组标记
|
| | | def GetServerIDList(self): return self.ServerIDList # 服务器ID列表
|
| | | def GetStartDate(self): return self.StartDate # 开启日期
|
| | | def GetEndDate(self): return self.EndDate # 结束日期
|
| | | def GetIsDayReset(self): return self.IsDayReset # 是否每天重置
|
| | | def GetResetType(self): return self.ResetType # 重置类型,0-0点重置;1-5点重置
|
| | | def GetNotifyInfoStart(self): return self.NotifyInfoStart # 全服提示信息 - 相对开始时间
|
| | | def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # 全服提示信息 - 相对结束时间
|
| | | def GetNotifyInfoLoop(self): return self.NotifyInfoLoop # 全服提示信息 - 循环广播[间隔分钟, 广播key]
|
| | | def GetLVLimit(self): return self.LVLimit # 限制等级 |
| | |
|
| | |
|
| | | def Log(msg, playerID=0, par=0):
|
| | | LogUI.Msg("%s\t%s\t%s" % (par, playerID, msg))
|
| | |
| | | self.ipyActFlashSaleLen = len(self.ipyActFlashSaleCache)
|
| | | self.ipyStoreCache = self.__LoadFileData("Store", IPY_Store)
|
| | | self.ipyStoreLen = len(self.ipyStoreCache)
|
| | | self.ipyActWishingWellCache = self.__LoadFileData("ActWishingWell", IPY_ActWishingWell)
|
| | | self.ipyActWishingWellLen = len(self.ipyActWishingWellCache)
|
| | | Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
|
| | | Log("IPY_DataMgr InitOK!")
|
| | | return
|
| | |
| | | def GetActFlashSaleByIndex(self, index): return self.ipyActFlashSaleCache[index]
|
| | | def GetStoreCount(self): return self.ipyStoreLen
|
| | | def GetStoreByIndex(self, index): return self.ipyStoreCache[index]
|
| | | def GetActWishingWellCount(self): return self.ipyActWishingWellLen
|
| | | def GetActWishingWellByIndex(self, index): return self.ipyActWishingWellCache[index]
|
| | |
|
| | | IPYData = IPY_DataMgr()
|
| | | def IPY_Data(): return IPYData
|
| | |
| | | OperationActionName_FairyCeremony = "ActFairyCeremony" # 仙界盛典活动
|
| | | OperationActionName_RealmPoint = "ActRealmPoint" # 多倍修行点活动
|
| | | OperationActionName_FlashSale = "ActFlashSale" # 限时抢购活动
|
| | | OperationActionName_WishingWell = "ActWishingWell" # 许愿池活动
|
| | | OperationActionNameList = [OperationActionName_ExpRate, OperationActionName_CostRebate,
|
| | | OperationActionName_BossReborn,OperationActionName_SpringSale,
|
| | | OperationActionName_FlashGiftbag, OperationActionName_FairyCeremony,
|
| | | OperationActionName_RealmPoint, OperationActionName_FlashSale]
|
| | | OperationActionName_RealmPoint, OperationActionName_FlashSale,
|
| | | OperationActionName_WishingWell]
|
| | | #需要记录开启活动时的世界等级的运营活动
|
| | | NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony]
|
| | | NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell]
|
| | |
|
| | | #活动信息字典key定义
|
| | | ActKey_ID = "ID" # 活动ID,唯一标识的ID,一般是活动开启的time值
|
| | |
| | | PacketCMD_1=0xAA
|
| | | PacketSubCMD_1=0x05
|
| | | PacketCallFunc_1=OnFlashSaleAppointment |
| | |
|
| | | ;许愿池
|
| | | [PlayerWishingWell]
|
| | | ScriptName = Player\PlayerWishingWell.py
|
| | | Writer = xdh
|
| | | Releaser = xdh
|
| | | RegType = 0
|
| | | RegisterPackCount = 2
|
| | |
|
| | | PacketCMD_1=0xAA
|
| | | PacketSubCMD_1=0x07
|
| | | PacketCallFunc_1=OnActWishingRefresh
|
| | |
|
| | | PacketCMD_2=0xAA
|
| | | PacketSubCMD_2=0x06
|
| | | PacketCallFunc_2=OnActWishingDrag |
| | |
| | | Def_PDict_FlashSaleState = "FlashSaleState" # 玩家身上的限时抢购活动state
|
| | | Def_PDict_FlashSaleMailState = "FlashSaleMailState" # 玩家身上的活动更新提醒邮件状态
|
| | | Def_PDict_FlashSaleYY = "FlashSaleYY_%s" # 玩家预约限时抢购商品
|
| | |
|
| | | #许愿池活动
|
| | | Def_PDict_WishingWellID = "WishingWellID" # 玩家身上的许愿池活动ID,唯一标识,取活动开始日期time值
|
| | | Def_PDict_WishingWellFreeTime = "WishingWellFreeTime" # 许愿池免费开始计时时间
|
| | | Def_PDict_WishingWellAwardTime = "WishingWellAwardTime" # 许愿池许愿时间
|
| | | Def_PDict_WishingWellRefreshCnt = "WishingWellRefreshCnt" # 付费刷新次数
|
| | | Def_PDict_WishingWellItem = "WishingWellItem_%s_%s" # 物品ID,是否极品、是否绑定信息 参数(类型,物品数据)
|
| | | Def_PDict_WishingWellItemCnt = "WishingWellItemCnt_%s_%s" # 物品数量记录 参数(类型,物品数据)
|
| | | #-------------------------------------------------------------------------------
|
| | | #类型 Def_PDictType_OnlinePrize
|
| | | Def_PDict1_OnlinePrizeCnt = "OnlinePrizeCnt" # 新手在线已领取奖励次数
|
| | |
| | | Def_Cost_AlchemyPray, # 丹药祈福
|
| | | Def_Cost_ResetGreatMasterSkill, # 重置天赋技能
|
| | | Def_Cost_BindJadeWheel, # 绑玉转盘
|
| | | Def_Cost_WishingWell, # 许愿池刷新
|
| | | #-----------以下为暂时没用的,先不删除,如有新增消费点则放在这些之前------------
|
| | | Def_Cost_RefreshArrestTask, # 刷新悬赏任务
|
| | | Def_Cost_OffLineExp, # 兑换离线经验
|
| | |
| | | Def_Cost_Trade, # 交易
|
| | | Def_Cost_Rename, # 改名
|
| | | Def_Cost_SkillLvUp, # 技能升级
|
| | | ) = range(2000, 2000 + 56)
|
| | | ) = range(2000, 2000 + 57)
|
| | |
|
| | | Def_Cost_Reason_SonKey = "reason_name_son" # 消费点原因子类说明key
|
| | |
|
| | |
| | | Def_Cost_RuneHole:"RuneHole",
|
| | | Def_Cost_AlchemyPray:"AlchemyPray",
|
| | | Def_Cost_BindJadeWheel:"BindJadeWheel",
|
| | | Def_Cost_WishingWell:"WishingWell",
|
| | | }
|
| | | ## -----------------------------------------------------
|
| | |
|
| | |
| | | Def_RewardType_FCRecharge, # 仙界盛典充值大礼13
|
| | | Def_RewardType_FCParty, # 仙界盛典全民来嗨14
|
| | | Def_RewardType_DownLoad, # 分包下载奖励15
|
| | | )= range(16)
|
| | | Def_RewardType_WishingWell, # 许愿池奖励16
|
| | | )= range(17)
|
| | |
|
| | |
|
| | | #boss复活相关活动定义
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 07 许愿池活动刷新奖池 #tagCMActWishingRefresh
|
| | |
|
| | | class tagCMActWishingRefresh(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("IsFree", c_ubyte), # 是否免费刷新
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x07
|
| | | 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 = 0x07
|
| | | self.IsFree = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMActWishingRefresh)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 07 许愿池活动刷新奖池 //tagCMActWishingRefresh:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | IsFree:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.IsFree
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMActWishingRefresh=tagCMActWishingRefresh()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMActWishingRefresh.Cmd,m_NAtagCMActWishingRefresh.SubCmd))] = m_NAtagCMActWishingRefresh
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 06 许愿池活动许愿 #tagCMActWishing
|
| | |
|
| | | class tagCMActWishing(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("SrcWellType", c_ubyte), # 来源库 0-可选库 1-结果库
|
| | | ("SrcIndex", c_ubyte), # 来源索引
|
| | | ("DesWellType", c_ubyte), # 目标库 0-可选库 1-结果库
|
| | | ("DesIndex", c_ubyte), # 目标索引
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xAA
|
| | | self.SubCmd = 0x06
|
| | | 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 = 0x06
|
| | | self.SrcWellType = 0
|
| | | self.SrcIndex = 0
|
| | | self.DesWellType = 0
|
| | | self.DesIndex = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMActWishing)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 06 许愿池活动许愿 //tagCMActWishing:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | SrcWellType:%d,
|
| | | SrcIndex:%d,
|
| | | DesWellType:%d,
|
| | | DesIndex:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.SrcWellType,
|
| | | self.SrcIndex,
|
| | | self.DesWellType,
|
| | | self.DesIndex
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMActWishing=tagCMActWishing()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMActWishing.Cmd,m_NAtagCMActWishing.SubCmd))] = m_NAtagCMActWishing
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 05 限时抢购预约 #tagCMFlashSaleAppointment
|
| | |
|
| | | class tagCMFlashSaleAppointment(Structure):
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 1B 许愿池拖动结果 #tagMCActWishingDragResult
|
| | |
|
| | | class tagMCPlayerWishingDragInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("WellType", c_ubyte), # 库 0-可选库 1-结果库
|
| | | ("Index", c_ubyte), # 索引
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("ItemCnt", c_ushort), # 物品数量
|
| | | ("IsBind", c_ubyte), # 是否绑定
|
| | | ("IsSpecial", 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.WellType = 0
|
| | | self.Index = 0
|
| | | self.ItemID = 0
|
| | | self.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | self.IsSpecial = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCPlayerWishingDragInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 1B 许愿池拖动结果 //tagMCActWishingDragResult:
|
| | | WellType:%d,
|
| | | Index:%d,
|
| | | ItemID:%d,
|
| | | ItemCnt:%d,
|
| | | IsBind:%d,
|
| | | IsSpecial:%d
|
| | | '''\
|
| | | %(
|
| | | self.WellType,
|
| | | self.Index,
|
| | | self.ItemID,
|
| | | self.ItemCnt,
|
| | | self.IsBind,
|
| | | self.IsSpecial
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActWishingDragResult(Structure):
|
| | | Head = tagHead()
|
| | | Cnt = 0 #(BYTE Cnt)
|
| | | InfoList = list() #(vector<tagMCPlayerWishingDragInfo> InfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1B
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Cnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Cnt):
|
| | | temInfoList = tagMCPlayerWishingDragInfo()
|
| | | _pos = temInfoList.ReadData(_lpData, _pos)
|
| | | self.InfoList.append(temInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1B
|
| | | self.Cnt = 0
|
| | | self.InfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Cnt):
|
| | | length += self.InfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Cnt)
|
| | | for i in range(self.Cnt):
|
| | | data = CommFunc.WriteString(data, self.InfoList[i].GetLength(), self.InfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Cnt:%d,
|
| | | InfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Cnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActWishingDragResult=tagMCActWishingDragResult()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActWishingDragResult.Head.Cmd,m_NAtagMCActWishingDragResult.Head.SubCmd))] = m_NAtagMCActWishingDragResult
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 19 许愿池活动信息 #tagMCActWishingWellInfo
|
| | |
|
| | | class tagMCWishingWellItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("ItemCnt", c_ushort), # 物品数量
|
| | | ("IsBind", c_ubyte), # 是否绑定
|
| | | ("Mark", c_int), # 排序标识
|
| | | ]
|
| | |
|
| | | 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.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | self.Mark = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCWishingWellItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 19 许愿池活动信息 //tagMCActWishingWellInfo:
|
| | | ItemID:%d,
|
| | | ItemCnt:%d,
|
| | | IsBind:%d,
|
| | | Mark:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCnt,
|
| | | self.IsBind,
|
| | | self.Mark
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActWishingWellInfo(Structure):
|
| | | Head = tagHead()
|
| | | StartDate = "" #(char StartDate[10])// 开始日期 y-m-d
|
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | IsDayReset = 0 #(BYTE IsDayReset)//是否每天重置
|
| | | ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置
|
| | | LimitLV = 0 #(WORD LimitLV)// 限制等级
|
| | | Count = 0 #(WORD Count)// 物品数
|
| | | WellItemInfo = list() #(vector<tagMCWishingWellItem> WellItemInfo)// 随机库物品信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x19
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.StartDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.EndtDate,_pos = CommFunc.ReadString(_lpData, _pos,10)
|
| | | self.IsDayReset,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.ResetType,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temWellItemInfo = tagMCWishingWellItem()
|
| | | _pos = temWellItemInfo.ReadData(_lpData, _pos)
|
| | | self.WellItemInfo.append(temWellItemInfo)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x19
|
| | | self.StartDate = ""
|
| | | self.EndtDate = ""
|
| | | self.IsDayReset = 0
|
| | | self.ResetType = 0
|
| | | self.LimitLV = 0
|
| | | self.Count = 0
|
| | | self.WellItemInfo = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 10
|
| | | length += 10
|
| | | length += 1
|
| | | length += 1
|
| | | length += 2
|
| | | length += 2
|
| | | for i in range(self.Count):
|
| | | length += self.WellItemInfo[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteString(data, 10, self.StartDate)
|
| | | data = CommFunc.WriteString(data, 10, self.EndtDate)
|
| | | data = CommFunc.WriteBYTE(data, self.IsDayReset)
|
| | | data = CommFunc.WriteBYTE(data, self.ResetType)
|
| | | data = CommFunc.WriteWORD(data, self.LimitLV)
|
| | | data = CommFunc.WriteWORD(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.WellItemInfo[i].GetLength(), self.WellItemInfo[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | IsDayReset:%d,
|
| | | ResetType:%d,
|
| | | LimitLV:%d,
|
| | | Count:%d,
|
| | | WellItemInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.IsDayReset,
|
| | | self.ResetType,
|
| | | self.LimitLV,
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActWishingWellInfo=tagMCActWishingWellInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActWishingWellInfo.Head.Cmd,m_NAtagMCActWishingWellInfo.Head.SubCmd))] = m_NAtagMCActWishingWellInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 1A 许愿池活动玩家信息 #tagMCActWishingWellPlayerInfo
|
| | |
|
| | | class tagMCPlayerWishingWellItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ItemID", c_int), # 物品ID
|
| | | ("ItemCnt", c_ushort), # 物品数量
|
| | | ("IsBind", c_ubyte), # 是否绑定
|
| | | ("IsSpecial", 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.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | self.IsSpecial = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCPlayerWishingWellItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 1A 许愿池活动玩家信息 //tagMCActWishingWellPlayerInfo:
|
| | | ItemID:%d,
|
| | | ItemCnt:%d,
|
| | | IsBind:%d,
|
| | | IsSpecial:%d
|
| | | '''\
|
| | | %(
|
| | | self.ItemID,
|
| | | self.ItemCnt,
|
| | | self.IsBind,
|
| | | self.IsSpecial
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActWishingWellPlayerInfo(Structure):
|
| | | Head = tagHead()
|
| | | FreeStartTime = 0 #(DWORD FreeStartTime)// 免费开始倒计时时间
|
| | | WishCnt = 0 #(DWORD WishCnt)// 许愿付费刷新次数
|
| | | WellItemCnt = 0 #(BYTE WellItemCnt)//许愿池物品数量
|
| | | WellItemInfo = list() #(vector<tagMCPlayerWishingWellItem> WellItemInfo)// 随机库物品信息
|
| | | CurAwardCnt = 0 #(BYTE CurAwardCnt)// 当前奖励物品数量
|
| | | CurAwardItemInfo = list() #(vector<tagMCPlayerWishingWellItem> CurAwardItemInfo)// 当前奖励物品
|
| | | LastAwardCnt = 0 #(BYTE LastAwardCnt)// 可领取奖励物品数量
|
| | | LastAwardItemInfo = list() #(vector<tagMCPlayerWishingWellItem> LastAwardItemInfo)// 可领取奖励物品
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1A
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.FreeStartTime,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.WishCnt,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.WellItemCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.WellItemCnt):
|
| | | temWellItemInfo = tagMCPlayerWishingWellItem()
|
| | | _pos = temWellItemInfo.ReadData(_lpData, _pos)
|
| | | self.WellItemInfo.append(temWellItemInfo)
|
| | | self.CurAwardCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.CurAwardCnt):
|
| | | temCurAwardItemInfo = tagMCPlayerWishingWellItem()
|
| | | _pos = temCurAwardItemInfo.ReadData(_lpData, _pos)
|
| | | self.CurAwardItemInfo.append(temCurAwardItemInfo)
|
| | | self.LastAwardCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.LastAwardCnt):
|
| | | temLastAwardItemInfo = tagMCPlayerWishingWellItem()
|
| | | _pos = temLastAwardItemInfo.ReadData(_lpData, _pos)
|
| | | self.LastAwardItemInfo.append(temLastAwardItemInfo)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xAA
|
| | | self.Head.SubCmd = 0x1A
|
| | | self.FreeStartTime = 0
|
| | | self.WishCnt = 0
|
| | | self.WellItemCnt = 0
|
| | | self.WellItemInfo = list()
|
| | | self.CurAwardCnt = 0
|
| | | self.CurAwardItemInfo = list()
|
| | | self.LastAwardCnt = 0
|
| | | self.LastAwardItemInfo = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 4
|
| | | length += 4
|
| | | length += 1
|
| | | for i in range(self.WellItemCnt):
|
| | | length += self.WellItemInfo[i].GetLength()
|
| | | length += 1
|
| | | for i in range(self.CurAwardCnt):
|
| | | length += self.CurAwardItemInfo[i].GetLength()
|
| | | length += 1
|
| | | for i in range(self.LastAwardCnt):
|
| | | length += self.LastAwardItemInfo[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteDWORD(data, self.FreeStartTime)
|
| | | data = CommFunc.WriteDWORD(data, self.WishCnt)
|
| | | data = CommFunc.WriteBYTE(data, self.WellItemCnt)
|
| | | for i in range(self.WellItemCnt):
|
| | | data = CommFunc.WriteString(data, self.WellItemInfo[i].GetLength(), self.WellItemInfo[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.CurAwardCnt)
|
| | | for i in range(self.CurAwardCnt):
|
| | | data = CommFunc.WriteString(data, self.CurAwardItemInfo[i].GetLength(), self.CurAwardItemInfo[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.LastAwardCnt)
|
| | | for i in range(self.LastAwardCnt):
|
| | | data = CommFunc.WriteString(data, self.LastAwardItemInfo[i].GetLength(), self.LastAwardItemInfo[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | FreeStartTime:%d,
|
| | | WishCnt:%d,
|
| | | WellItemCnt:%d,
|
| | | WellItemInfo:%s,
|
| | | CurAwardCnt:%d,
|
| | | CurAwardItemInfo:%s,
|
| | | LastAwardCnt:%d,
|
| | | LastAwardItemInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.FreeStartTime,
|
| | | self.WishCnt,
|
| | | self.WellItemCnt,
|
| | | "...",
|
| | | self.CurAwardCnt,
|
| | | "...",
|
| | | self.LastAwardCnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCActWishingWellPlayerInfo=tagMCActWishingWellPlayerInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCActWishingWellPlayerInfo.Head.Cmd,m_NAtagMCActWishingWellPlayerInfo.Head.SubCmd))] = m_NAtagMCActWishingWellPlayerInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # AA 15 仙界盛典全民来嗨玩家信息 #tagMCAllPeoplePartyInfo
|
| | |
|
| | | class tagMCAllPeoplePartyCount(Structure):
|
| | |
| | | ("char", "MailKey", 0),
|
| | | ("list", "MailItemPrize", 0),
|
| | | ),
|
| | |
|
| | | "ActWishingWell":(
|
| | | ("DWORD", "CfgID", 1),
|
| | | ("char", "StartDate", 0),
|
| | | ("char", "EndDate", 0),
|
| | | ("BYTE", "IsDayReset", 0),
|
| | | ("BYTE", "ResetType", 0),
|
| | | ("WORD", "LVLimit", 0),
|
| | | ("BYTE", "TemplateID", 0),
|
| | | ),
|
| | |
|
| | | "WishingWell":(
|
| | | ("BYTE", "TemplateID", 1),
|
| | | ("BYTE", "IsFree", 0),
|
| | | ("list", "WorldLVLimit", 0),
|
| | | ("DWORD", "ItemID", 0),
|
| | | ("WORD", "ItemCnt", 0),
|
| | | ("BYTE", "IsBind", 0),
|
| | | ("DWORD", "Weight", 0),
|
| | | ("DWORD", "Mark", 0),
|
| | | ),
|
| | | }
|
| | |
|
| | | |
| | |
| | | def GetMailKey(self): return self.MailKey # 活动更新时发送邮件key
|
| | | def GetMailItemPrize(self): return self.MailItemPrize # 活动更新时发送邮件奖励物品 |
| | |
|
| | | # 许愿池活动时间表 |
| | | class IPY_ActWishingWell(): |
| | | |
| | | def __init__(self): |
| | | self.CfgID = 0
|
| | | self.StartDate = ""
|
| | | self.EndDate = ""
|
| | | self.IsDayReset = 0
|
| | | self.ResetType = 0
|
| | | self.LVLimit = 0
|
| | | self.TemplateID = 0 |
| | | return |
| | | |
| | | def GetCfgID(self): return self.CfgID # 配置ID
|
| | | def GetStartDate(self): return self.StartDate # 开启日期
|
| | | def GetEndDate(self): return self.EndDate # 结束日期
|
| | | def GetIsDayReset(self): return self.IsDayReset # 是否每天重置
|
| | | def GetResetType(self): return self.ResetType # 重置类型,0-0点重置;1-5点重置
|
| | | def GetLVLimit(self): return self.LVLimit # 限制等级
|
| | | def GetTemplateID(self): return self.TemplateID # 模板编号 |
| | | |
| | | # 许愿池库模板表 |
| | | class IPY_WishingWell(): |
| | | |
| | | def __init__(self): |
| | | self.TemplateID = 0
|
| | | self.IsFree = 0
|
| | | self.WorldLVLimit = []
|
| | | self.ItemID = 0
|
| | | self.ItemCnt = 0
|
| | | self.IsBind = 0
|
| | | self.Weight = 0
|
| | | self.Mark = 0 |
| | | return |
| | | |
| | | def GetTemplateID(self): return self.TemplateID # 模板ID
|
| | | def GetIsFree(self): return self.IsFree # 是否免费库
|
| | | def GetWorldLVLimit(self): return self.WorldLVLimit # 世界等级范围
|
| | | def GetItemID(self): return self.ItemID # 物品ID
|
| | | def GetItemCnt(self): return self.ItemCnt # 物品数量
|
| | | def GetIsBind(self): return self.IsBind # 是否绑定
|
| | | def GetWeight(self): return self.Weight # 权重
|
| | | def GetMark(self): return self.Mark # 排序用标识 |
| | |
|
| | |
|
| | | def Log(msg, playerID=0, par=0):
|
| | | LogUI.Msg("%s\t%s\t%s" % (par, playerID, msg))
|
| | |
| | | self.ipyTalentSkillLen = len(self.ipyTalentSkillCache)
|
| | | self.ipyActFlashSaleCache = self.__LoadFileData("ActFlashSale", IPY_ActFlashSale)
|
| | | self.ipyActFlashSaleLen = len(self.ipyActFlashSaleCache)
|
| | | self.ipyActWishingWellCache = self.__LoadFileData("ActWishingWell", IPY_ActWishingWell)
|
| | | self.ipyActWishingWellLen = len(self.ipyActWishingWellCache)
|
| | | self.ipyWishingWellCache = self.__LoadFileData("WishingWell", IPY_WishingWell)
|
| | | self.ipyWishingWellLen = len(self.ipyWishingWellCache)
|
| | | Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
|
| | | Log("IPY_DataMgr InitOK!")
|
| | | return
|
| | |
| | | def GetTalentSkillByIndex(self, index): return self.ipyTalentSkillCache[index]
|
| | | def GetActFlashSaleCount(self): return self.ipyActFlashSaleLen
|
| | | def GetActFlashSaleByIndex(self, index): return self.ipyActFlashSaleCache[index]
|
| | | def GetActWishingWellCount(self): return self.ipyActWishingWellLen
|
| | | def GetActWishingWellByIndex(self, index): return self.ipyActWishingWellCache[index]
|
| | | def GetWishingWellCount(self): return self.ipyWishingWellLen
|
| | | def GetWishingWellByIndex(self, index): return self.ipyWishingWellCache[index]
|
| | |
|
| | | IPYData = IPY_DataMgr()
|
| | | def IPY_Data(): return IPYData
|
| | |
| | | import FBCommon
|
| | | import PlayerBindJadeWheel
|
| | | import BossHurtMng
|
| | | import PlayerAction
|
| | | import PlayerWishingWell
|
| | | import PlayerAttrFruit
|
| | | import PlayerSuccess
|
| | | import PlayerDienstgrad
|
| | |
| | | FamilyRobBoss.OnPlayerLogin(curPlayer)
|
| | | # 绑玉转盘
|
| | | PlayerBindJadeWheel.OnLogin(curPlayer)
|
| | | |
| | | # 许愿池
|
| | | PlayerWishingWell.OnLogin(curPlayer)
|
| | | # 上线查询一次充值订单
|
| | | curPlayer.SendDBQueryRecharge()
|
| | |
|
| | |
| | | # 领取分包下载奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_DownLoad:
|
| | | GetDownloadAward(curPlayer, dataEx)
|
| | | # 领取许愿池奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_WishingWell:
|
| | | PlayerWishingWell.DoGetWishingAward(curPlayer)
|
| | | |
| | | #
|
| | | # # 充值豪礼奖励
|
| | | # elif rewardType == ShareDefine.Def_RewardType_GoldGift:
|
| | |
| | | import PlayerFairyCeremony
|
| | | import PlayerRefineStove
|
| | | import PlayerFlashSale
|
| | | import PlayerWishingWell
|
| | | import PlayerVip
|
| | | import PlayerDiceEx
|
| | | import IpyGameDataPY
|
| | |
| | |
|
| | | # 仙盟红包OnDay
|
| | | PlayerFamilyRedPacket.RedPacketOnDay(curPlayer, onEventType)
|
| | | #许愿池
|
| | | PlayerWishingWell.OnDay(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | |
| | |
|
| | | elif actionName == ShareDefine.OperationActionName_FlashSale:
|
| | | PlayerFlashSale.RefreshflashSaleActionInfo()
|
| | | |
| | | elif actionName == ShareDefine.OperationActionName_WishingWell:
|
| | | PlayerWishingWell.RefreshWishingWellAction()
|
| | | |
| | | return
|
| | |
|
| | | if msgValue.isdigit():
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Player.PlayerWishingWell
|
| | | #
|
| | | # @todo:许愿池
|
| | | # @author xdh
|
| | | # @date 2018-10-18 19:50
|
| | | # @version 1.0
|
| | | #
|
| | | #
|
| | | # 详细描述: 许愿池
|
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | """Version = 2018-10-18 19:50"""
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | import IPY_GameWorld
|
| | | import GameWorld
|
| | | import ChConfig
|
| | | import IpyGameDataPY
|
| | | import PlayerControl
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import ItemControler
|
| | | import ItemCommon
|
| | |
|
| | | import time
|
| | |
|
| | | g_randomWellDict = {}
|
| | | g_specialMarkDict = {}
|
| | |
|
| | | (
|
| | | WellType_Select, #可选库
|
| | | WellType_Result, #结果库
|
| | | WellType_Get, #可领取库
|
| | | ) = range(3)
|
| | |
|
| | |
|
| | | def __GetItemInfoByData(curPlayer, wellType, i):
|
| | | itemData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellItem % (wellType, i))
|
| | | itemCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellItemCnt % (wellType, i))
|
| | | itemID, isBind, isSpecial = itemData / 100, itemData % 100 / 10, itemData % 10
|
| | | return itemID, itemCnt, isBind, isSpecial
|
| | |
|
| | |
|
| | | def __SetItemData(curPlayer, wellType, i, itemID, itemCnt, isBind, isSpecial):
|
| | | itemID = __GetJobItemID(curPlayer, itemID)
|
| | | itemData = itemID * 100 + isBind * 10 + isSpecial
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellItem % (wellType, i), itemData)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellItemCnt % (wellType, i), itemCnt)
|
| | | return
|
| | |
|
| | |
|
| | | def __GetJobItemID(curPlayer, itemID):
|
| | | if type(itemID) == int:
|
| | | return itemID
|
| | | if type(itemID) != dict:
|
| | | return 0
|
| | | return itemID.get(curPlayer.GetJob(), 0)
|
| | |
|
| | |
|
| | | def OnLogin(curPlayer):
|
| | | isReset = __CheckPlayerWishingWellAction(curPlayer)
|
| | | if not isReset:
|
| | | actCostRebateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
|
| | | # 活动中同步活动信息
|
| | | if actCostRebateInfo.get(ShareDefine.ActKey_State):
|
| | | SyncWishingWellInfo(curPlayer)
|
| | | SyncWishingWellPlayerInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def OnDay(curPlayer):
|
| | | actCostRebateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
|
| | | if not actCostRebateInfo.get(ShareDefine.ActKey_State):
|
| | | __SendWishingWellMail(curPlayer, int(time.time()))
|
| | | return
|
| | |
|
| | | def RefreshWishingWellAction():
|
| | | #__InitWishRateList()
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for i in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(i)
|
| | | if curPlayer == None or not curPlayer.GetInitOK():
|
| | | continue
|
| | | __CheckPlayerWishingWellAction(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | def __CheckPlayerWishingWellAction(curPlayer):
|
| | | ## 检查玩家许愿池活动数据信息
|
| | | global g_randomWellDict
|
| | | global g_specialMarkDict
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | |
| | | actWishingWellInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
|
| | | WishingWellID = actWishingWellInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actWishingWellInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actWishingWellInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | worldLV = actWishingWellInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | playerWishingWellID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellID) # 玩家身上的活动ID
|
| | | |
| | | # 活动ID 相同的话不处理
|
| | | if WishingWellID == playerWishingWellID:
|
| | | #GameWorld.DebugLog("许愿池活动ID不变,不处理!", curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | GameWorld.DebugLog("许愿池重置! WishingWellID=%s,playerWishingWellID=%s,state=%s,worldLv=%s" |
| | | % (WishingWellID, playerWishingWellID, state, worldLV), playerID)
|
| | | |
| | | # 未领取的奖励邮件发放
|
| | | __SendWishingWellMail(curPlayer, WishingWellID or int(time.time()), state)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellID, WishingWellID)
|
| | | #每天开始随机一次免费盘
|
| | | if state:
|
| | | g_randomWellDict = {}
|
| | | g_specialMarkDict = {}
|
| | | __DoActWishingRefresh(curPlayer, 1, True)
|
| | | |
| | | SyncWishingWellInfo(curPlayer)
|
| | | SyncWishingWellPlayerInfo(curPlayer)
|
| | | return True
|
| | |
|
| | |
|
| | | def __SendWishingWellMail(curPlayer, curTime, state=-1):
|
| | | lastAwardTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellAwardTime)
|
| | | |
| | | if not lastAwardTime:
|
| | | if state != -1:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellAwardTime, curTime)
|
| | | return
|
| | | GameWorld.DebugLog('许愿池未领取的奖励邮件发放检查 lastAwardTime=%s,state=%s,pass=%s'%(lastAwardTime, state, curTime - lastAwardTime))
|
| | | passDay = (curTime - lastAwardTime)/86400
|
| | | if passDay <= 0:
|
| | | return
|
| | | isOver = True
|
| | | count = IpyGameDataPY.GetFuncCfg('WishingWellCfg', 4)
|
| | | mailItemList = []
|
| | | saveItemList = []
|
| | | for i in xrange(count):
|
| | | itemID, itemCnt, isBind, isSpecial = __GetItemInfoByData(curPlayer, WellType_Get, i)
|
| | | if itemID:
|
| | | mailItemList.append([itemID, itemCnt, isBind])
|
| | | __SetItemData(curPlayer, WellType_Get, i, 0, 0, 0, 0)
|
| | | j = 0
|
| | | for i in xrange(count):
|
| | | itemID, itemCnt, isBind, isSpecial = __GetItemInfoByData(curPlayer, WellType_Result, i)
|
| | | if not itemID:
|
| | | continue
|
| | | |
| | | if passDay == 1: #相差一天,存储奖励 |
| | | __SetItemData(curPlayer, WellType_Get, j, itemID, itemCnt, isBind, isSpecial)
|
| | | saveItemList.append([itemID, itemCnt, isBind])
|
| | | isOver = False
|
| | | elif passDay > 1: #大于1天,直接邮件发奖励
|
| | | mailItemList.append([itemID, itemCnt, isBind])
|
| | | __SetItemData(curPlayer, WellType_Result, i, 0, 0, 0, 0)
|
| | | j +=1
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellAwardTime, 0 if isOver else curTime)
|
| | | if mailItemList:
|
| | | PlayerControl.SendMailByKey('WishPool', [curPlayer.GetID()], mailItemList)
|
| | | GameWorld.DebugLog('许愿池距离时间 passDay=%s,mailItemList=%s,saveItemList=%s,isOver=%s'%(passDay, mailItemList, saveItemList, isOver), curPlayer.GetID())
|
| | | return
|
| | |
|
| | |
|
| | | def __InitWishRateList():
|
| | | ## 初始许愿池随机库
|
| | | global g_randomWellDict
|
| | | global g_specialMarkDict
|
| | | actWishingWellInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
|
| | | state = actWishingWellInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actWishingWellInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | worldLV = actWishingWellInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | if not cfgID or not worldLV or not state:
|
| | | return
|
| | | actIpyData = IpyGameDataPY.GetIpyGameData("ActWishingWell", cfgID)
|
| | | if not actIpyData:
|
| | | return
|
| | | templateID = actIpyData.GetTemplateID()
|
| | | ipyDataList = IpyGameDataPY.GetIpyGameDataList('WishingWell', templateID)
|
| | | if not ipyDataList:
|
| | | return
|
| | | g_randomWellDict = {} # {是否免费:[[权重,[物品ID,数量,是否绑定,标识]]]}
|
| | | weightDict = {}
|
| | | for ipyData in ipyDataList:
|
| | | worldLVLimit = ipyData.GetWorldLVLimit()
|
| | | if worldLV < worldLVLimit[0] or worldLV > worldLVLimit[1]:
|
| | | continue
|
| | | isFree = ipyData.GetIsFree()
|
| | | itemID = ipyData.GetItemID()
|
| | | itemCnt = ipyData.GetItemCnt()
|
| | | isBind = ipyData.GetIsBind()
|
| | | weight = ipyData.GetWeight()
|
| | | mark = ipyData.GetMark()
|
| | | weightDict[isFree] = weightDict.get(isFree, 0) + weight
|
| | | if isFree not in g_randomWellDict:
|
| | | g_randomWellDict[isFree] = []
|
| | | g_randomWellDict[isFree].append([weightDict[isFree], [itemID, itemCnt, isBind, mark]])
|
| | | |
| | | groupID, rowID = mark / 100, mark % 100
|
| | | if rowID > g_specialMarkDict.get(groupID, 0) % 100:
|
| | | g_specialMarkDict[groupID] = mark
|
| | | GameWorld.DebugLog(' 初始许愿池随机库 g_randomWellDict=%s, g_specialMarkDict=%s' % (g_randomWellDict, g_specialMarkDict))
|
| | | return
|
| | |
|
| | |
|
| | | def __GetRandomRateList(isFree):
|
| | | ## 获取增长列表
|
| | | if not g_randomWellDict:
|
| | | __InitWishRateList()
|
| | | return g_randomWellDict.get(isFree, [])
|
| | |
|
| | |
|
| | | #// AA 07 许愿池活动刷新奖池 #tagCMActWishingRefresh
|
| | | #struct tagCMActWishingRefresh
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE IsFree; // 是否免费刷新
|
| | | #};
|
| | | def OnActWishingRefresh(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | actBossRebornInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
|
| | | state = actBossRebornInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | if not state or not cfgID:
|
| | | return
|
| | | |
| | | isFree = clientData.IsFree
|
| | | __DoActWishingRefresh(curPlayer, isFree)
|
| | | #֪ͨ
|
| | | SyncWishingWellPlayerInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def __DoActWishingRefresh(curPlayer, isFree, isSystem=False):
|
| | | randomRateList = __GetRandomRateList(isFree)
|
| | | if not randomRateList:
|
| | | GameWorld.DebugLog(' 许愿池活动刷新奖池 随机库获取错误 !')
|
| | | return
|
| | | playerID = curPlayer.GetID()
|
| | | GameWorld.DebugLog(' isFree=%s, randomRateList=%s' % (isFree, randomRateList))
|
| | | |
| | | if isFree:
|
| | | if not isSystem:
|
| | | freeStartTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellFreeTime)
|
| | | curTime = int(time.time())
|
| | | freeCountCD = IpyGameDataPY.GetFuncCfg('WishingWellCfg')
|
| | | if curTime - freeStartTime < freeCountCD:
|
| | | GameWorld.DebugLog('许愿池活动免费刷新奖池, 免费CD未到! freeCountCD=%s, passTime=%s' % (freeCountCD, curTime - freeStartTime), playerID)
|
| | | return
|
| | | else:
|
| | | refreshCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellRefreshCnt)
|
| | | infoDict = {'refreshCnt':refreshCnt}
|
| | | costMoney = eval(IpyGameDataPY.GetFuncCompileCfg('WishingWellCfg', 2))
|
| | | if not PlayerControl.HaveMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costMoney):
|
| | | return
|
| | | |
| | | randomCnt = IpyGameDataPY.GetFuncCfg('WishingWellCfg', 3)
|
| | | randomResultList = GameWorld.GetResultByRandomListEx(randomRateList, randomCnt, [])
|
| | | if len(randomResultList) != randomCnt:
|
| | | GameWorld.DebugLog(' 许愿池活动刷新奖池 随机库结果 获取错误 !randomCnt=%s, randomResultList=%s' % (randomCnt, randomResultList))
|
| | | return
|
| | | |
| | | if not isFree:
|
| | | PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costMoney, ChConfig.Def_Cost_WishingWell, infoDict)
|
| | | #增加次数
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellRefreshCnt, refreshCnt+1)
|
| | | elif not isSystem:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellFreeTime, int(time.time()))
|
| | | |
| | | for i, info in enumerate(randomResultList):
|
| | | itemID, itemCnt, isBind, mark = info
|
| | | isSpecial = 1 if mark in g_specialMarkDict.values() else 0
|
| | | __SetItemData(curPlayer, WellType_Select, i, itemID, itemCnt, isBind, isSpecial)
|
| | | GameWorld.DebugLog(' 许愿池活动刷新 isFree=%s, randomResultList=%s' % (isFree, randomResultList), playerID)
|
| | | return
|
| | |
|
| | | #// AA 06 许愿池活动许愿 #tagCMActWishing
|
| | | #struct tagCMActWishing
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE SrcWellType; // 来源库 0-可选库 1-结果库
|
| | | # BYTE SrcIndex; // 来源索引
|
| | | # BYTE DesWellType; // 目标库 0-可选库 1-结果库
|
| | | # BYTE DesIndex; // 目标索引
|
| | | #};
|
| | | def OnActWishingDrag(index, clientData, tick):
|
| | | srcWellType = clientData.SrcWellType
|
| | | srcIndex = clientData.SrcIndex
|
| | | desWellType = clientData.DesWellType
|
| | | desIndex = clientData.DesIndex
|
| | | if srcWellType not in [WellType_Select, WellType_Result] or desWellType not in [WellType_Select, WellType_Result]:
|
| | | return
|
| | | if srcWellType == desWellType:
|
| | | return
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerID = curPlayer.GetID()
|
| | | srcitemID, srcitemCnt, srcisBind, srcisSpecial = __GetItemInfoByData(curPlayer, srcWellType, srcIndex)
|
| | | if not srcitemID:
|
| | | GameWorld.DebugLog('许愿池活动拖拽物品 来源位置没有物品 srcWellType=%s, srcIndex=%s' % (srcWellType, srcIndex), playerID)
|
| | | return
|
| | | desitemID, desitemCnt, desisBind, desisSpecial = __GetItemInfoByData(curPlayer, desWellType, desIndex)
|
| | | __SetItemData(curPlayer, desWellType, desIndex, srcitemID, srcitemCnt, srcisBind, srcisSpecial)
|
| | | if desitemID:
|
| | | __SetItemData(curPlayer, srcWellType, srcIndex, desitemID, desitemCnt, desisBind, desisSpecial)
|
| | | else:
|
| | | __SetItemData(curPlayer, srcWellType, srcIndex, 0, 0, 0, 0)
|
| | | GameWorld.DebugLog('许愿池活动拖拽物品 desWellType=%s,desIndex=%s,srcitemID=%s'%(desWellType, desIndex,srcitemID))
|
| | | #֪ͨ
|
| | | SyncWellItemChange(curPlayer, [[srcWellType, srcIndex],[desWellType, desIndex]])
|
| | | return
|
| | |
|
| | | def SyncWellItemChange(curPlayer, changeList):
|
| | | packData = ChPyNetSendPack.tagMCActWishingDragResult()
|
| | | packData.InfoList = []
|
| | | for wellType, index in changeList:
|
| | | itemID, itemCnt, isBind, isSpecial = __GetItemInfoByData(curPlayer, wellType, index)
|
| | | changeInfo = ChPyNetSendPack.tagMCPlayerWishingDragInfo()
|
| | | changeInfo.WellType = wellType
|
| | | changeInfo.Index = index
|
| | | changeInfo.ItemID = itemID
|
| | | changeInfo.ItemCnt = itemCnt
|
| | | changeInfo.IsBind = isBind
|
| | | changeInfo.IsSpecial = isSpecial
|
| | | packData.InfoList.append(changeInfo)
|
| | | packData.Cnt = len(packData.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | |
|
| | | def DoGetWishingAward(curPlayer):
|
| | | ## 领取许愿池奖励
|
| | | count = IpyGameDataPY.GetFuncCfg('WishingWellCfg', 4)
|
| | | giveItemList = []
|
| | | for i in xrange(count):
|
| | | itemID, itemCnt, isBind, isSpecial = __GetItemInfoByData(curPlayer, WellType_Get, i)
|
| | | if itemID:
|
| | | giveItemList.append([itemID, itemCnt, isBind])
|
| | | if not giveItemList:
|
| | | GameWorld.Log('领取许愿池奖励 没有奖励可领取!', curPlayer.GetID())
|
| | | return
|
| | | |
| | | needSpace = len(giveItemList)
|
| | | packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
|
| | | if needSpace > packSpace:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
|
| | | return
|
| | | for itemID, itemCnt, isBind in giveItemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem])
|
| | | for i in xrange(count):
|
| | | __SetItemData(curPlayer, WellType_Get, i, 0, 0, 0, 0)
|
| | | SyncWishingWellPlayerInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | def SyncWishingWellInfo(curPlayer):
|
| | | ##同步许愿池活动信息
|
| | | actBossRebornInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
|
| | | state = actBossRebornInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | if not state or not cfgID:
|
| | | return
|
| | | actIpyData = IpyGameDataPY.GetIpyGameData("ActWishingWell", cfgID)
|
| | | if not actIpyData:
|
| | | return
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | actInfo = ChPyNetSendPack.tagMCActWishingWellInfo()
|
| | | actInfo.Clear()
|
| | | actInfo.StartDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
|
| | | actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actIpyData.GetEndDate(), openServerDay)
|
| | | actInfo.IsDayReset = actIpyData.GetIsDayReset()
|
| | | actInfo.ResetType = actIpyData.GetResetType()
|
| | | actInfo.LimitLV = actIpyData.GetLVLimit()
|
| | | actInfo.WellItemInfo = []
|
| | | randomItemList = __GetRandomRateList(0)
|
| | | for itemInfo in randomItemList:
|
| | | itemID, itemCnt, isBind, mark = itemInfo[1]
|
| | | wellItemInfo = ChPyNetSendPack.tagMCWishingWellItem()
|
| | | wellItemInfo.ItemID = itemID
|
| | | wellItemInfo.ItemCnt = itemCnt
|
| | | wellItemInfo.IsBind = isBind
|
| | | wellItemInfo.Mark = mark
|
| | | actInfo.WellItemInfo.append(wellItemInfo)
|
| | | actInfo.Count = len(actInfo.WellItemInfo)
|
| | | NetPackCommon.SendFakePack(curPlayer, actInfo)
|
| | | return
|
| | |
|
| | |
|
| | | def SyncWishingWellPlayerInfo(curPlayer):
|
| | | ##同步许愿池玩家信息
|
| | | packData = ChPyNetSendPack.tagMCActWishingWellPlayerInfo()
|
| | | freeStartTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellFreeTime)
|
| | | if not freeStartTime:#没有则默认活动开始时间
|
| | | actBossRebornInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
|
| | | cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | actIpyData = IpyGameDataPY.GetIpyGameData("ActWishingWell", cfgID)
|
| | | if actIpyData:
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | startDate = GameWorld.GetOperationActionDateStr(actIpyData.GetStartDate(), openServerDay)
|
| | | |
| | | resetType = actIpyData.GetResetType() # 重置类型,0-0点重置;1-5点重置
|
| | | if resetType == 1:
|
| | | startDayDate = "%s 05:00:00" % (startDate)
|
| | | else:
|
| | | startDayDate = "%s 00:00:00" % (startDate)
|
| | | freeStartTime = GameWorld.ChangeTimeStrToNum(startDayDate, timeFormat=ChConfig.TYPE_Time_Format)
|
| | | GameWorld.DebugLog('许愿池活动开始时间 startDayDate=%s'%startDayDate)
|
| | | |
| | | |
| | | packData.FreeStartTime = freeStartTime
|
| | | packData.WishCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WishingWellRefreshCnt)
|
| | | packData.WellItemInfo = []
|
| | | __AddWishingWellItemPackInfo(curPlayer, packData.WellItemInfo, WellType_Select)
|
| | | packData.WellItemCnt = len(packData.WellItemInfo)
|
| | | packData.CurAwardItemInfo = []
|
| | | __AddWishingWellItemPackInfo(curPlayer, packData.CurAwardItemInfo, WellType_Result)
|
| | | packData.CurAwardCnt = len(packData.CurAwardItemInfo)
|
| | | packData.LastAwardItemInfo = []
|
| | | __AddWishingWellItemPackInfo(curPlayer, packData.LastAwardItemInfo, WellType_Get)
|
| | | packData.LastAwardCnt = len(packData.LastAwardItemInfo)
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | |
|
| | |
|
| | | def __AddWishingWellItemPackInfo(curPlayer, itemList, wellType):
|
| | | if wellType == WellType_Select:
|
| | | count = IpyGameDataPY.GetFuncCfg('WishingWellCfg', 3)
|
| | | else:
|
| | | count = IpyGameDataPY.GetFuncCfg('WishingWellCfg', 4)
|
| | | for i in xrange(count):
|
| | | itemID, itemCnt, isBind, isSpecial = __GetItemInfoByData(curPlayer, wellType, i)
|
| | | packData = ChPyNetSendPack.tagMCPlayerWishingWellItem()
|
| | | packData.ItemID = itemID
|
| | | packData.ItemCnt = itemCnt
|
| | | packData.IsBind = isBind
|
| | | packData.IsSpecial = isSpecial
|
| | | itemList.append(packData)
|
| | | return
|
| | |
|
| | |
| | | OperationActionName_FairyCeremony = "ActFairyCeremony" # 仙界盛典活动
|
| | | OperationActionName_RealmPoint = "ActRealmPoint" # 多倍修行点活动
|
| | | OperationActionName_FlashSale = "ActFlashSale" # 限时抢购活动
|
| | | OperationActionName_WishingWell = "ActWishingWell" # 许愿池活动
|
| | | OperationActionNameList = [OperationActionName_ExpRate, OperationActionName_CostRebate,
|
| | | OperationActionName_BossReborn,OperationActionName_SpringSale,
|
| | | OperationActionName_FlashGiftbag, OperationActionName_FairyCeremony,
|
| | | OperationActionName_RealmPoint, OperationActionName_FlashSale]
|
| | | OperationActionName_RealmPoint, OperationActionName_FlashSale,
|
| | | OperationActionName_WishingWell]
|
| | | #需要记录开启活动时的世界等级的运营活动
|
| | | NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony]
|
| | | NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell]
|
| | |
|
| | | #活动信息字典key定义
|
| | | ActKey_ID = "ID" # 活动ID,唯一标识的ID,一般是活动开启的time值
|