10297 【越南】【英语】【砍树】【tqxbqy】轮回殿-服务端(轮回殿活动时间表增加配置轮回类型对应的CTGID跟商店类型)
| | |
| | | WORD LVLimit; //限制等级
|
| | | BYTE ResetType; //重置类型,0-0点重置;1-5点重置
|
| | | dict RoundSetInfo; //开放轮回设定
|
| | | dict RoundCTGIDInfo; //轮回类型对应充值ID列表
|
| | | dict RoundShopTypeInfo; //轮回类型对应商店类型
|
| | | };
|
| | |
|
| | | //轮回殿活动奖励表
|
| | |
| | | RoundMax = 0 #(BYTE RoundMax)// 最大可循环轮次
|
| | | AwardCount = 0 #(BYTE AwardCount)
|
| | | AwardList = list() #(vector<tagMCActLunhuidianAward> AwardList)// 每轮奖励列表
|
| | | CTGIDCount = 0 #(BYTE CTGIDCount)
|
| | | CTGIDList = list() #(vector<WORD> CTGIDList)// CTGID列表
|
| | | ShopType = 0 #(WORD ShopType)// 开放商店类型,可能为0不开放
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | temAwardList = tagMCActLunhuidianAward()
|
| | | _pos = temAwardList.ReadData(_lpData, _pos)
|
| | | self.AwardList.append(temAwardList)
|
| | | self.CTGIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.CTGIDCount):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.CTGIDList.append(value)
|
| | | self.ShopType,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.RoundMax = 0
|
| | | self.AwardCount = 0
|
| | | self.AwardList = list()
|
| | | self.CTGIDCount = 0
|
| | | self.CTGIDList = list()
|
| | | self.ShopType = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 1
|
| | | for i in range(self.AwardCount):
|
| | | length += self.AwardList[i].GetLength()
|
| | | length += 1
|
| | | length += 2 * self.CTGIDCount
|
| | | length += 2
|
| | |
|
| | | return length
|
| | |
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.AwardCount)
|
| | | for i in range(self.AwardCount):
|
| | | data = CommFunc.WriteString(data, self.AwardList[i].GetLength(), self.AwardList[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.CTGIDCount)
|
| | | for i in range(self.CTGIDCount):
|
| | | data = CommFunc.WriteWORD(data, self.CTGIDList[i])
|
| | | data = CommFunc.WriteWORD(data, self.ShopType)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | AwardTypeValue:%d,
|
| | | RoundMax:%d,
|
| | | AwardCount:%d,
|
| | | AwardList:%s
|
| | | AwardList:%s,
|
| | | CTGIDCount:%d,
|
| | | CTGIDList:%s,
|
| | | ShopType:%d
|
| | | '''\
|
| | | %(
|
| | | self.RoundType,
|
| | |
| | | self.AwardTypeValue,
|
| | | self.RoundMax,
|
| | | self.AwardCount,
|
| | | "..."
|
| | | "...",
|
| | | self.CTGIDCount,
|
| | | "...",
|
| | | self.ShopType
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | RoundMax = 0 #(BYTE RoundMax)// 最大可循环轮次
|
| | | AwardCount = 0 #(BYTE AwardCount)
|
| | | AwardList = list() #(vector<tagMCActLunhuidianAward> AwardList)// 每轮奖励列表
|
| | | CTGIDCount = 0 #(BYTE CTGIDCount)
|
| | | CTGIDList = list() #(vector<WORD> CTGIDList)// CTGID列表
|
| | | ShopType = 0 #(WORD ShopType)// 开放商店类型,可能为0不开放
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | temAwardList = tagMCActLunhuidianAward()
|
| | | _pos = temAwardList.ReadData(_lpData, _pos)
|
| | | self.AwardList.append(temAwardList)
|
| | | self.CTGIDCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.CTGIDCount):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.CTGIDList.append(value)
|
| | | self.ShopType,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.RoundMax = 0
|
| | | self.AwardCount = 0
|
| | | self.AwardList = list()
|
| | | self.CTGIDCount = 0
|
| | | self.CTGIDList = list()
|
| | | self.ShopType = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 1
|
| | | for i in range(self.AwardCount):
|
| | | length += self.AwardList[i].GetLength()
|
| | | length += 1
|
| | | length += 2 * self.CTGIDCount
|
| | | length += 2
|
| | |
|
| | | return length
|
| | |
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.AwardCount)
|
| | | for i in range(self.AwardCount):
|
| | | data = CommFunc.WriteString(data, self.AwardList[i].GetLength(), self.AwardList[i].GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.CTGIDCount)
|
| | | for i in range(self.CTGIDCount):
|
| | | data = CommFunc.WriteWORD(data, self.CTGIDList[i])
|
| | | data = CommFunc.WriteWORD(data, self.ShopType)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | AwardTypeValue:%d,
|
| | | RoundMax:%d,
|
| | | AwardCount:%d,
|
| | | AwardList:%s
|
| | | AwardList:%s,
|
| | | CTGIDCount:%d,
|
| | | CTGIDList:%s,
|
| | | ShopType:%d
|
| | | '''\
|
| | | %(
|
| | | self.RoundType,
|
| | |
| | | self.AwardTypeValue,
|
| | | self.RoundMax,
|
| | | self.AwardCount,
|
| | | "..."
|
| | | "...",
|
| | | self.CTGIDCount,
|
| | | "...",
|
| | | self.ShopType
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | |
|
| | | def ResetShopItemBuyCountByShopType(curPlayer, shopTypeList):
|
| | | ##根据商店类型重置商店限购物品次数
|
| | | if not shopTypeList:
|
| | | return
|
| | | syncIndexList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetStoreCount()):
|
| | |
| | | ("WORD", "LVLimit", 0),
|
| | | ("BYTE", "ResetType", 0),
|
| | | ("dict", "RoundSetInfo", 0),
|
| | | ("dict", "RoundCTGIDInfo", 0),
|
| | | ("dict", "RoundShopTypeInfo", 0),
|
| | | ),
|
| | |
|
| | | "ActLunhuidianAward":(
|
| | |
| | | def GetEndDate(self): return self.attrTuple[2] # 结束日期 char
|
| | | def GetLVLimit(self): return self.attrTuple[3] # 限制等级 WORD
|
| | | def GetResetType(self): return self.attrTuple[4] # 重置类型,0-0点重置;1-5点重置 BYTE
|
| | | def GetRoundSetInfo(self): return self.attrTuple[5] # 开放轮回设定 dict |
| | | def GetRoundSetInfo(self): return self.attrTuple[5] # 开放轮回设定 dict
|
| | | def GetRoundCTGIDInfo(self): return self.attrTuple[6] # 轮回类型对应充值ID列表 dict
|
| | | def GetRoundShopTypeInfo(self): return self.attrTuple[7] # 轮回类型对应商店类型 dict |
| | | |
| | | # 轮回殿活动奖励表 |
| | | class IPY_ActLunhuidianAward(): |
| | |
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import ChPyNetSendPack
|
| | | import FunctionNPCCommon
|
| | | import NetPackCommon
|
| | | import ItemControler
|
| | | import PlayerCoin
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActLunhuidian", cfgID)
|
| | | if ipyData:
|
| | | roundSetDict = ipyData.GetRoundSetInfo()
|
| | | ctgIDDict = ipyData.GetRoundCTGIDInfo()
|
| | | shopTypeDict = ipyData.GetRoundShopTypeInfo()
|
| | | resetCTGIDList, resetShopTypeList = [], []
|
| | | for roundType in roundSetDict.keys():
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianValue % (actNum, roundType), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianRound % (actNum, roundType), 1) # 从第1轮开始
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActLunhuidianAward % (actNum, roundType), 0)
|
| | | Sync_ActLunhuidianPlayerInfo(curPlayer, actNum, roundType)
|
| | | resetCTGIDList += ctgIDDict.get(roundType, [])
|
| | | shopType = shopTypeDict.get(roundType, 0)
|
| | | if shopType and shopType not in resetShopTypeList:
|
| | | resetShopTypeList.append(shopType)
|
| | | |
| | | PlayerCoin.DoResetCTGCountByIDList(curPlayer, "ActLunhuidian", resetCTGIDList)
|
| | | FunctionNPCCommon.ResetShopItemBuyCountByShopType(curPlayer, resetShopTypeList)
|
| | | |
| | | return True
|
| | |
|
| | | def GetRoundSetValue(roundSet, setIndex): return roundSet[setIndex] if len(roundSet) > setIndex else 0
|
| | |
| | | clientPack.LimitLV = ipyData.GetLVLimit()
|
| | |
|
| | | roundSetDict = ipyData.GetRoundSetInfo()
|
| | | ctgIDDict = ipyData.GetRoundCTGIDInfo()
|
| | | shopTypeDict = ipyData.GetRoundShopTypeInfo()
|
| | | for roundType, roundSet in roundSetDict.items():
|
| | | roundInfo = ChPyNetSendPack.tagMCActLunhuidianRound()
|
| | | roundInfo.RoundType = roundType
|
| | |
| | |
|
| | | roundInfo.AwardList.append(award)
|
| | | roundInfo.AwardCount = len(roundInfo.AwardList)
|
| | | roundInfo.CTGIDList = ctgIDDict.get(roundType, [])
|
| | | roundInfo.CTGIDCount = len(roundInfo.CTGIDList)
|
| | | roundInfo.ShopType = shopTypeDict.get(roundType, 0)
|
| | |
|
| | | clientPack.RoundList.append(roundInfo)
|
| | | clientPack.RoundCount = len(clientPack.RoundList)
|