10205 【越南】【主干】【港台】【砍树】自选礼包
| | |
| | | WORD FirstGoldPrize; //首次充值该档位赠送仙玉
|
| | | list GainItemList; //获得物品列表[[物品ID,个数,是否绑定], ...]
|
| | | dict ActWorldLVGainItemInfo; //根据活动世界等级获得物品信息,活动专用 {"世界等级":[[物品ID,个数,是否绑定], ...], ...}
|
| | | list SelectItemInfo; //自选礼包物品信息 [[自选1ID, ...], [自选2ID, ...], ...]
|
| | | char NotifyMark; //广播提示
|
| | | BYTE PayType; //充值类型
|
| | | };
|
| | |
|
| | | //充值自选物品表
|
| | |
|
| | | struct tagCTGSelectItem
|
| | | {
|
| | | WORD _SelectID; //自选ID
|
| | | DWORD ItemID; //物品ID
|
| | | DWORD ItemCount; //物品个数
|
| | | BYTE IsAuctionItem; //是否拍品
|
| | | };
|
| | |
|
| | | //首充表
|
| | |
| | | WORD LVLimit; //限制等级
|
| | | BYTE IsDayReset; //是否每天重置
|
| | | BYTE ResetType; //重置类型,0-0点重置;1-5点重置
|
| | | dict CTGIDInfo; //充值ID信息 {ctgID:折扣力度百分比, ...}
|
| | | list CTGIDList; //充值ID列表 [ctgID, ...]
|
| | | dict CTGCountAwardInfo; //累计充值次数额外奖励
|
| | | };
|
| | |
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A1 26 充值自选物品选择 #tagCMSelectCTGItem
|
| | |
|
| | | class tagCMSelectCTGItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("RecordID", c_ushort), #充值ID
|
| | | ("SelectItemValue", c_int), # 自选物品索引值,每两位存储每个自选索引对应选择的物品索引+1,存储位值为0代表未选择,最多支持选择4种物品
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA1
|
| | | self.SubCmd = 0x26
|
| | | 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 = 0xA1
|
| | | self.SubCmd = 0x26
|
| | | self.RecordID = 0
|
| | | self.SelectItemValue = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMSelectCTGItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A1 26 充值自选物品选择 //tagCMSelectCTGItem:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | RecordID:%d,
|
| | | SelectItemValue:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.RecordID,
|
| | | self.SelectItemValue
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMSelectCTGItem=tagCMSelectCTGItem()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSelectCTGItem.Cmd,m_NAtagCMSelectCTGItem.SubCmd))] = m_NAtagCMSelectCTGItem
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A1 03 设置是否成年 #tagCMAdult
|
| | |
|
| | | class tagCMAdult(Structure):
|
| | |
| | | ("TotalPayCount", c_int), # 累计总购买次数
|
| | | ("WeekPayCount", c_ushort), # 周总购买次数
|
| | | ("MonthPayCount", c_ushort), # 月总购买次数
|
| | | ("SelectItemValue", c_int), # 自选物品索引值,每两位存储每个自选索引对应选择的物品索引+1,存储位值为0代表未选择,最多支持选择4种物品
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.TotalPayCount = 0
|
| | | self.WeekPayCount = 0
|
| | | self.MonthPayCount = 0
|
| | | self.SelectItemValue = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | TodayPayCount:%d,
|
| | | TotalPayCount:%d,
|
| | | WeekPayCount:%d,
|
| | | MonthPayCount:%d
|
| | | MonthPayCount:%d,
|
| | | SelectItemValue:%d
|
| | | '''\
|
| | | %(
|
| | | self.RecordID,
|
| | | self.TodayPayCount,
|
| | | self.TotalPayCount,
|
| | | self.WeekPayCount,
|
| | | self.MonthPayCount
|
| | | self.MonthPayCount,
|
| | | self.SelectItemValue
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActBuyCountCTGID(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("CTGID", c_ushort), # 充值表ID
|
| | | ("Discount", c_ushort), # 折扣力度百分比
|
| | | ]
|
| | |
|
| | | 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.CTGID = 0
|
| | | self.Discount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCActBuyCountCTGID)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 74 购买次数礼包活动信息 //tagMCActBuyCountGiftInfo:
|
| | | CTGID:%d,
|
| | | Discount:%d
|
| | | '''\
|
| | | %(
|
| | | self.CTGID,
|
| | | self.Discount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActBuyCountGiftInfo(Structure):
|
| | | Head = tagHead()
|
| | | ActNum = 0 #(BYTE ActNum)// 活动编号
|
| | |
| | | ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置
|
| | | LimitLV = 0 #(WORD LimitLV)// 限制等级
|
| | | CTGIDCount = 0 #(BYTE CTGIDCount)
|
| | | CTGIDInfoList = list() #(vector<tagMCActBuyCountCTGID> CTGIDInfoList)// CTGID信息列表;总购买次数前端自己统计,直接取CTGID对应的累计购买次数累加
|
| | | CTGIDList = list() #(vector<WORD> CTGIDList)// CTGID列表;总购买次数前端自己统计,直接取CTGID对应的累计购买次数累加
|
| | | GiftCount = 0 #(BYTE GiftCount)
|
| | | BuyCountGiftList = list() #(vector<tagMCActBuyCountGift> BuyCountGiftList)// 购买次数礼包列表
|
| | | data = None
|
| | |
| | | self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.CTGIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.CTGIDCount):
|
| | | temCTGIDInfoList = tagMCActBuyCountCTGID()
|
| | | _pos = temCTGIDInfoList.ReadData(_lpData, _pos)
|
| | | self.CTGIDInfoList.append(temCTGIDInfoList)
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.CTGIDList.append(value)
|
| | | self.GiftCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.GiftCount):
|
| | | temBuyCountGiftList = tagMCActBuyCountGift()
|
| | |
| | | self.ResetType = 0
|
| | | self.LimitLV = 0
|
| | | self.CTGIDCount = 0
|
| | | self.CTGIDInfoList = list()
|
| | | self.CTGIDList = list()
|
| | | self.GiftCount = 0
|
| | | self.BuyCountGiftList = list()
|
| | | return
|
| | |
| | | length += 1
|
| | | length += 2
|
| | | length += 1
|
| | | for i in range(self.CTGIDCount):
|
| | | length += self.CTGIDInfoList[i].GetLength()
|
| | | length += 2 * self.CTGIDCount
|
| | | length += 1
|
| | | for i in range(self.GiftCount):
|
| | | length += self.BuyCountGiftList[i].GetLength()
|
| | |
| | | data = CommFunc.WriteWORD(data, self.LimitLV)
|
| | | data = CommFunc.WriteBYTE(data, self.CTGIDCount)
|
| | | for i in range(self.CTGIDCount):
|
| | | data = CommFunc.WriteString(data, self.CTGIDInfoList[i].GetLength(), self.CTGIDInfoList[i].GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.CTGIDList[i])
|
| | | data = CommFunc.WriteBYTE(data, self.GiftCount)
|
| | | for i in range(self.GiftCount):
|
| | | data = CommFunc.WriteString(data, self.BuyCountGiftList[i].GetLength(), self.BuyCountGiftList[i].GetBuffer())
|
| | |
| | | ResetType:%d,
|
| | | LimitLV:%d,
|
| | | CTGIDCount:%d,
|
| | | CTGIDInfoList:%s,
|
| | | CTGIDList:%s,
|
| | | GiftCount:%d,
|
| | | BuyCountGiftList:%s
|
| | | '''\
|
| | |
| | | Writer = hxp
|
| | | Releaser = hxp
|
| | | RegType = 0
|
| | | RegisterPackCount = 2
|
| | | RegisterPackCount = 3
|
| | |
|
| | | PacketCMD_1=0xA1
|
| | | PacketSubCMD_1=0x23
|
| | |
| | | PacketSubCMD_2=0x25
|
| | | PacketCallFunc_2=OnCoinBuyOrderInfo
|
| | |
|
| | | PacketCMD_3=0xA1
|
| | | PacketSubCMD_3=0x26
|
| | | PacketCallFunc_3=OnSelectCTGItem
|
| | |
|
| | | ;首充
|
| | | [PlayerGoldGift]
|
| | | ScriptName = Player\PlayerGoldGift.py
|
| | |
| | | Def_PDict_WeekCTGCount = "WeekCTGCount_%s" # 本周充值次数,参数(CTG对应的商品记录ID)
|
| | | Def_PDict_MonthCTGCount = "MonthCTGCount_%s" # 本月充值次数,参数(CTG对应的商品记录ID)
|
| | | Def_PDict_CTGGoodsBuyCount = "CTGGoodsBuyCount_%s" # 对应充值商品已购买次数,参数(CTG对应的商品记录ID)
|
| | | Def_PDict_CTGSelectItemValue = "CTGSelectItemValue_%s" # 充值自选选择记录,参数(CTG对应的商品记录ID) 每两位存储每个自选索引对应选择的物品索引+1,存储位值为0代表未选择,最多支持选择4种物品
|
| | | Def_PDict_OnlineRechargeTHAward = "OnlineRechargeTHAward" # 在线特惠充值额外奖励 - 是否已领取奖励
|
| | | Def_PDict_DayFreeGoldGiftState = "DayFreeGoldGiftState" # 每日免费直购礼包领取记录
|
| | | Def_PDict_GoldGiftFirstRecord = "GoldGiftFirstRecord" # 首充领取记录,按位记录首充第x天是否已领取
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A1 26 充值自选物品选择 #tagCMSelectCTGItem
|
| | |
|
| | | class tagCMSelectCTGItem(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("Cmd", c_ubyte),
|
| | | ("SubCmd", c_ubyte),
|
| | | ("RecordID", c_ushort), #充值ID
|
| | | ("SelectItemValue", c_int), # 自选物品索引值,每两位存储每个自选索引对应选择的物品索引+1,存储位值为0代表未选择,最多支持选择4种物品
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Cmd = 0xA1
|
| | | self.SubCmd = 0x26
|
| | | 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 = 0xA1
|
| | | self.SubCmd = 0x26
|
| | | self.RecordID = 0
|
| | | self.SelectItemValue = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagCMSelectCTGItem)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A1 26 充值自选物品选择 //tagCMSelectCTGItem:
|
| | | Cmd:%s,
|
| | | SubCmd:%s,
|
| | | RecordID:%d,
|
| | | SelectItemValue:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | | self.SubCmd,
|
| | | self.RecordID,
|
| | | self.SelectItemValue
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMSelectCTGItem=tagCMSelectCTGItem()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMSelectCTGItem.Cmd,m_NAtagCMSelectCTGItem.SubCmd))] = m_NAtagCMSelectCTGItem
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | #A1 03 设置是否成年 #tagCMAdult
|
| | |
|
| | | class tagCMAdult(Structure):
|
| | |
| | | ("TotalPayCount", c_int), # 累计总购买次数
|
| | | ("WeekPayCount", c_ushort), # 周总购买次数
|
| | | ("MonthPayCount", c_ushort), # 月总购买次数
|
| | | ("SelectItemValue", c_int), # 自选物品索引值,每两位存储每个自选索引对应选择的物品索引+1,存储位值为0代表未选择,最多支持选择4种物品
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.TotalPayCount = 0
|
| | | self.WeekPayCount = 0
|
| | | self.MonthPayCount = 0
|
| | | self.SelectItemValue = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | TodayPayCount:%d,
|
| | | TotalPayCount:%d,
|
| | | WeekPayCount:%d,
|
| | | MonthPayCount:%d
|
| | | MonthPayCount:%d,
|
| | | SelectItemValue:%d
|
| | | '''\
|
| | | %(
|
| | | self.RecordID,
|
| | | self.TodayPayCount,
|
| | | self.TotalPayCount,
|
| | | self.WeekPayCount,
|
| | | self.MonthPayCount
|
| | | self.MonthPayCount,
|
| | | self.SelectItemValue
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActBuyCountCTGID(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("CTGID", c_ushort), # 充值表ID
|
| | | ("Discount", c_ushort), # 折扣力度百分比
|
| | | ]
|
| | |
|
| | | 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.CTGID = 0
|
| | | self.Discount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCActBuyCountCTGID)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// AA 74 购买次数礼包活动信息 //tagMCActBuyCountGiftInfo:
|
| | | CTGID:%d,
|
| | | Discount:%d
|
| | | '''\
|
| | | %(
|
| | | self.CTGID,
|
| | | self.Discount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCActBuyCountGiftInfo(Structure):
|
| | | Head = tagHead()
|
| | | ActNum = 0 #(BYTE ActNum)// 活动编号
|
| | |
| | | ResetType = 0 #(BYTE ResetType)// 重置类型,0-0点重置;1-5点重置
|
| | | LimitLV = 0 #(WORD LimitLV)// 限制等级
|
| | | CTGIDCount = 0 #(BYTE CTGIDCount)
|
| | | CTGIDInfoList = list() #(vector<tagMCActBuyCountCTGID> CTGIDInfoList)// CTGID信息列表;总购买次数前端自己统计,直接取CTGID对应的累计购买次数累加
|
| | | CTGIDList = list() #(vector<WORD> CTGIDList)// CTGID列表;总购买次数前端自己统计,直接取CTGID对应的累计购买次数累加
|
| | | GiftCount = 0 #(BYTE GiftCount)
|
| | | BuyCountGiftList = list() #(vector<tagMCActBuyCountGift> BuyCountGiftList)// 购买次数礼包列表
|
| | | data = None
|
| | |
| | | self.LimitLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.CTGIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.CTGIDCount):
|
| | | temCTGIDInfoList = tagMCActBuyCountCTGID()
|
| | | _pos = temCTGIDInfoList.ReadData(_lpData, _pos)
|
| | | self.CTGIDInfoList.append(temCTGIDInfoList)
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.CTGIDList.append(value)
|
| | | self.GiftCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.GiftCount):
|
| | | temBuyCountGiftList = tagMCActBuyCountGift()
|
| | |
| | | self.ResetType = 0
|
| | | self.LimitLV = 0
|
| | | self.CTGIDCount = 0
|
| | | self.CTGIDInfoList = list()
|
| | | self.CTGIDList = list()
|
| | | self.GiftCount = 0
|
| | | self.BuyCountGiftList = list()
|
| | | return
|
| | |
| | | length += 1
|
| | | length += 2
|
| | | length += 1
|
| | | for i in range(self.CTGIDCount):
|
| | | length += self.CTGIDInfoList[i].GetLength()
|
| | | length += 2 * self.CTGIDCount
|
| | | length += 1
|
| | | for i in range(self.GiftCount):
|
| | | length += self.BuyCountGiftList[i].GetLength()
|
| | |
| | | data = CommFunc.WriteWORD(data, self.LimitLV)
|
| | | data = CommFunc.WriteBYTE(data, self.CTGIDCount)
|
| | | for i in range(self.CTGIDCount):
|
| | | data = CommFunc.WriteString(data, self.CTGIDInfoList[i].GetLength(), self.CTGIDInfoList[i].GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.CTGIDList[i])
|
| | | data = CommFunc.WriteBYTE(data, self.GiftCount)
|
| | | for i in range(self.GiftCount):
|
| | | data = CommFunc.WriteString(data, self.BuyCountGiftList[i].GetLength(), self.BuyCountGiftList[i].GetBuffer())
|
| | |
| | | ResetType:%d,
|
| | | LimitLV:%d,
|
| | | CTGIDCount:%d,
|
| | | CTGIDInfoList:%s,
|
| | | CTGIDList:%s,
|
| | | GiftCount:%d,
|
| | | BuyCountGiftList:%s
|
| | | '''\
|
| | |
| | | for i in xrange(ipyDataMgr.GetCTGCount()):
|
| | | ipyData = ipyDataMgr.GetCTGByIndex(i)
|
| | | recordID = ipyData.GetRecordID()
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGSelectItemValue % recordID, 0)
|
| | | totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
|
| | | todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID)
|
| | | weekBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekCTGCount % recordID)
|
| | |
| | | ("WORD", "FirstGoldPrize", 0),
|
| | | ("list", "GainItemList", 0),
|
| | | ("dict", "ActWorldLVGainItemInfo", 0),
|
| | | ("list", "SelectItemInfo", 0),
|
| | | ("char", "NotifyMark", 0),
|
| | | ("BYTE", "PayType", 0),
|
| | | ),
|
| | |
|
| | | "CTGSelectItem":(
|
| | | ("WORD", "SelectID", 1),
|
| | | ("DWORD", "ItemID", 0),
|
| | | ("DWORD", "ItemCount", 0),
|
| | | ("BYTE", "IsAuctionItem", 0),
|
| | | ),
|
| | |
|
| | | "FirstGold":(
|
| | |
| | | ("WORD", "LVLimit", 0),
|
| | | ("BYTE", "IsDayReset", 0),
|
| | | ("BYTE", "ResetType", 0),
|
| | | ("dict", "CTGIDInfo", 0),
|
| | | ("list", "CTGIDList", 0),
|
| | | ("dict", "CTGCountAwardInfo", 0),
|
| | | ),
|
| | |
|
| | |
| | | def GetFirstGoldPrize(self): return self.attrTuple[9] # 首次充值该档位赠送仙玉 WORD
|
| | | def GetGainItemList(self): return self.attrTuple[10] # 获得物品列表[[物品ID,个数,是否绑定], ...] list
|
| | | def GetActWorldLVGainItemInfo(self): return self.attrTuple[11] # 根据活动世界等级获得物品信息,活动专用 {"世界等级":[[物品ID,个数,是否绑定], ...], ...} dict
|
| | | def GetNotifyMark(self): return self.attrTuple[12] # 广播提示 char
|
| | | def GetPayType(self): return self.attrTuple[13] # 充值类型 BYTE |
| | | def GetSelectItemInfo(self): return self.attrTuple[12] # 自选礼包物品信息 [[自选1ID, ...], [自选2ID, ...], ...] list
|
| | | def GetNotifyMark(self): return self.attrTuple[13] # 广播提示 char
|
| | | def GetPayType(self): return self.attrTuple[14] # 充值类型 BYTE |
| | | |
| | | # 充值自选物品表 |
| | | class IPY_CTGSelectItem(): |
| | | |
| | | def __init__(self): |
| | | self.attrTuple = None |
| | | return |
| | | |
| | | def GetSelectID(self): return self.attrTuple[0] # 自选ID WORD
|
| | | def GetItemID(self): return self.attrTuple[1] # 物品ID DWORD
|
| | | def GetItemCount(self): return self.attrTuple[2] # 物品个数 DWORD
|
| | | def GetIsAuctionItem(self): return self.attrTuple[3] # 是否拍品 BYTE |
| | | |
| | | # 首充表 |
| | | class IPY_FirstGold(): |
| | |
| | | def GetLVLimit(self): return self.attrTuple[3] # 限制等级 WORD
|
| | | def GetIsDayReset(self): return self.attrTuple[4] # 是否每天重置 BYTE
|
| | | def GetResetType(self): return self.attrTuple[5] # 重置类型,0-0点重置;1-5点重置 BYTE
|
| | | def GetCTGIDInfo(self): return self.attrTuple[6] # 充值ID信息 {ctgID:折扣力度百分比, ...} dict
|
| | | def GetCTGIDList(self): return self.attrTuple[6] # 充值ID列表 [ctgID, ...] list
|
| | | def GetCTGCountAwardInfo(self): return self.attrTuple[7] # 累计充值次数额外奖励 dict |
| | | |
| | | # 任务活动时间表 |
| | |
| | | self.__LoadFileData("SpringSale", onlyCheck)
|
| | | self.__LoadFileData("OrderInfo", onlyCheck)
|
| | | self.__LoadFileData("CTG", onlyCheck)
|
| | | self.__LoadFileData("CTGSelectItem", onlyCheck)
|
| | | self.__LoadFileData("FirstGold", onlyCheck)
|
| | | self.__LoadFileData("LVAward", onlyCheck)
|
| | | self.__LoadFileData("Invest", onlyCheck)
|
| | |
| | | self.CheckLoadData("CTG") |
| | | return self.ipyCTGCache[index]
|
| | | |
| | | def GetCTGSelectItemCount(self): |
| | | self.CheckLoadData("CTGSelectItem") |
| | | return self.ipyCTGSelectItemLen
|
| | | def GetCTGSelectItemByIndex(self, index): |
| | | self.CheckLoadData("CTGSelectItem") |
| | | return self.ipyCTGSelectItemCache[index]
|
| | | |
| | | def GetFirstGoldCount(self): |
| | | self.CheckLoadData("FirstGold") |
| | | return self.ipyFirstGoldLen
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActBuyCountGift", cfgID) |
| | | if not ipyData: |
| | | return |
| | | ctgIDInfo = ipyData.GetCTGIDInfo() |
| | | resetCTGIDList = ctgIDInfo.keys() |
| | | resetCTGIDList = ipyData.GetCTGIDList() |
| | | PlayerCoin.DoResetCTGCountByIDList(curPlayer, "ActBuyCountGift", resetCTGIDList) |
| | | return |
| | | |
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActBuyCountGift", cfgID) |
| | | if not ipyData: |
| | | return |
| | | CTGIDInfo= ipyData.GetCTGIDInfo() |
| | | CTGIDList = CTGIDInfo.keys() |
| | | CTGIDList = ipyData.GetCTGIDList() |
| | | CTGCountAwardInfo = ipyData.GetCTGCountAwardInfo() |
| | | if buyCount not in CTGCountAwardInfo: |
| | | GameWorld.DebugLog("购买次数礼包没有该次数礼包奖励! actNum=%s,cfgID=%s,buyCount=%s" % (actNum, cfgID, buyCount), playerID) |
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActBuyCountGift", cfgID) |
| | | if not ipyData: |
| | | return |
| | | CTGIDInfo = ipyData.GetCTGIDInfo() |
| | | CTGCountAwardInfo = ipyData.GetCTGCountAwardInfo() |
| | | |
| | | startDateStr, endDateStr = GameWorld.GetOperationActionDateStr(ipyData) |
| | |
| | | actInfo.LimitLV = ipyData.GetLVLimit() |
| | | actInfo.IsDayReset = ipyData.GetIsDayReset() |
| | | actInfo.ResetType = ipyData.GetResetType() |
| | | actInfo.CTGIDInfoList = [] |
| | | for ctgID, discount in CTGIDInfo.items(): |
| | | ctg = ChPyNetSendPack.tagMCActBuyCountCTGID() |
| | | ctg.CTGID = ctgID |
| | | ctg.Discount = discount |
| | | actInfo.CTGIDInfoList.append(ctg) |
| | | actInfo.CTGIDCount = len(actInfo.CTGIDInfoList) |
| | | actInfo.CTGIDList = ipyData.GetCTGIDList() |
| | | actInfo.CTGIDCount = len(actInfo.CTGIDList) |
| | | |
| | | actInfo.BuyCountGiftList = [] |
| | | for buyCount, awardItemList in CTGCountAwardInfo.items(): |
| | |
| | | for i in xrange(ipyDataMgr.GetCTGCount()):
|
| | | ipyData = ipyDataMgr.GetCTGByIndex(i)
|
| | | recordID = ipyData.GetRecordID()
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGSelectItemValue % recordID, 0)
|
| | | if not ipyData.GetCanResetBuyCount():
|
| | | continue
|
| | | totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
|
| | |
| | | return
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | for recordID in resetCTGIDList:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGSelectItemValue % recordID, 0)
|
| | | totalBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
|
| | | todayBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID)
|
| | | weekBuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekCTGCount % recordID)
|
| | |
| | | #if not ipyData.GetDailyBuyCount():
|
| | | # continue
|
| | | recordID = ipyData.GetRecordID()
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID):
|
| | | selectItemValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGSelectItemValue % recordID)
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % recordID) and not selectItemValue:
|
| | | continue
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TodayCTGCount % recordID, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGSelectItemValue % recordID, 0)
|
| | | syncRecordIDList.append(recordID)
|
| | | if syncRecordIDList:
|
| | | Sync_CoinToGoldCountInfo(curPlayer, syncRecordIDList)
|
| | |
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | recordID = clientData.RecordID
|
| | | Sync_CoinToGoldCountInfo(curPlayer, [recordID] if recordID else [])
|
| | | return
|
| | |
|
| | | #// A1 26 充值自选物品选择 #tagCMSelectCTGItem
|
| | | #
|
| | | #struct tagCMSelectCTGItem
|
| | | #{
|
| | | # tagHead Head;
|
| | | # WORD RecordID; //充值ID
|
| | | # DWORD SelectItemValue; // 自选物品索引值,每两位存储每个自选索引对应选择的物品索引+1,存储位值为0代表未选择,最多支持选择4种物品
|
| | | #};
|
| | | def OnSelectCTGItem(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | recordID = clientData.RecordID
|
| | | selectItemValue = clientData.SelectItemValue
|
| | | if selectItemValue > ChConfig.Def_UpperLimit_DWord:
|
| | | GameWorld.ErrLog("充值自选物品选择值溢出! recordID=%s,selectItemValue=%s" % (recordID, selectItemValue), playerID)
|
| | | return
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("CTG", recordID)
|
| | | if not ipyData:
|
| | | return
|
| | | selectItemInfo = ipyData.GetSelectItemInfo()
|
| | | selectItemList, errorInfo = GetSelectItemListInfo(selectItemInfo, selectItemValue)
|
| | | if errorInfo:
|
| | | GameWorld.ErrLog("充值自选物品选择错误! recordID=%s,errorInfo=%s" % (recordID, errorInfo), playerID)
|
| | | return
|
| | | GameWorld.DebugLog("充值自选物品: recordID=%s,selectItemValue=%s,selectItemList=%s" % (recordID, selectItemValue, selectItemList), playerID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGSelectItemValue % recordID, selectItemValue)
|
| | | Sync_CoinToGoldCountInfo(curPlayer, [recordID])
|
| | | return
|
| | |
|
| | | #// A1 25 代币购买充值商品编号商品 #tagCMCoinBuyOrderInfo
|
| | |
| | | ExchangePayCoin(curPlayer, "Pay count limit month!monthBuyCount=%s" % monthBuyCount, addDRDict)
|
| | | return
|
| | |
|
| | | selectItemList = []
|
| | | selectItemInfo = ipyData.GetSelectItemInfo()
|
| | | if selectItemInfo:
|
| | | selectItemValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGSelectItemValue % recordID)
|
| | | addDRDict.update({"selectItemValue":selectItemValue})
|
| | | selectItemList, errorInfo = GetSelectItemListInfo(selectItemInfo, selectItemValue)
|
| | | if errorInfo:
|
| | | ExchangePayCoin(curPlayer, errorInfo, addDRDict)
|
| | | return
|
| | | addDRDict.update({"selectItemList":selectItemList})
|
| | | |
| | | totalBuyCountUpd = min(totalBuyCount + 1, ChConfig.Def_UpperLimit_DWord)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CTGGoodsBuyCount % recordID, totalBuyCountUpd)
|
| | | addDRDict.update({"totalBuyCountUpd":totalBuyCountUpd})
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MonthCTGCount % recordID, monthBuyCountUpd)
|
| | | addDRDict.update({"monthBuyCountUpd":monthBuyCountUpd})
|
| | |
|
| | | giveItemList = GetCTGGiveItemList(ipyData)
|
| | | giveItemList = []
|
| | | giveItemList += GetCTGGiveItemList(ipyData)
|
| | | giveItemList += selectItemList
|
| | | |
| | | moneyType = ipyData.GetMoneyType() # 获得货币类型
|
| | | addGold = ipyData.GetGainGold() # 获得货币数
|
| | | gainGoldPrize = ipyData.GetGainGoldPrize() # 赠送货币数,首次充值赠送仙玉时,此仙玉不给
|
| | |
| | |
|
| | | Sync_CoinToGoldCountInfo(curPlayer, [recordID])
|
| | | return moneyType, addGold, prizeGold, giveItemList, ipyData
|
| | |
|
| | | def GetSelectItemListInfo(selectItemInfo, selectItemValue):
|
| | | errorInfo = ""
|
| | | selectItemList = []
|
| | | selectValue = selectItemValue
|
| | | GameWorld.DebugLog("selectItemValue=%s,selectItemInfo=%s" % (selectItemValue, selectItemInfo))
|
| | | for selectNum, selectIDList in enumerate(selectItemInfo, 1):
|
| | | selectIndex = selectValue % 100 - 1 # 记录的时候+1
|
| | | if selectIndex < 0:
|
| | | errorInfo = "Select item is not complete!selectItemValue=%s,selectNum=%s,selectIndex=%s" % (selectItemValue, selectNum, selectIndex)
|
| | | return selectItemList, errorInfo
|
| | | if selectIndex >= len(selectIDList):
|
| | | errorInfo = "Select item index out of range!selectItemValue=%s,selectNum=%s,selectIndex=%s" % (selectItemValue, selectNum, selectIndex)
|
| | | return selectItemList, errorInfo
|
| | | selectID = selectIDList[selectIndex]
|
| | | selectIpyData = IpyGameDataPY.GetIpyGameData("CTGSelectItem", selectID)
|
| | | if not selectIpyData:
|
| | | errorInfo = "SelectID is not exist!selectItemValue=%s,selectNum=%s,selectIndex=%s,selectID=%s" % (selectItemValue, selectNum, selectIndex, selectID)
|
| | | return selectItemList, errorInfo
|
| | | selectItemList.append([selectIpyData.GetItemID(), selectIpyData.GetItemCount(), selectIpyData.GetIsAuctionItem()])
|
| | | selectValue = selectValue / 100
|
| | | GameWorld.DebugLog(" selectNum=%s,selectIndex=%s,selectID=%s,selectItemList=%s,selectItemValue=%s" |
| | | % (selectNum, selectIndex, selectID, selectItemList, selectItemValue))
|
| | | return selectItemList, errorInfo
|
| | |
|
| | | def GetCTGGiveItemList(ipyData):
|
| | | ## 获取充值ID对应给物品列表
|
| | |
| | | countInfo.TotalPayCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGGoodsBuyCount % recordID)
|
| | | countInfo.WeekPayCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekCTGCount % recordID)
|
| | | countInfo.MonthPayCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MonthCTGCount % recordID)
|
| | | countInfo.SelectItemValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGSelectItemValue % recordID)
|
| | | countInfoPack.CTGCountInfoList.append(countInfo)
|
| | | countInfoPack.RecordCount = len(countInfoPack.CTGCountInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, countInfoPack)
|