8710 【开发】【主干】【BT2】根据世界等级配置奖励(成长必买世界等级不同奖励配置改为放在充值表);
# Conflicts:
# ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
| | |
| | | WORD GainGoldPrize; //赠送仙玉数
|
| | | WORD FirstGoldPrize; //首次充值该档位赠送仙玉
|
| | | list GainItemList; //获得物品列表[[物品ID,个数,是否绑定], ...]
|
| | | dict ActWorldLVGainItemInfo; //根据活动世界等级获得物品信息,活动专用 {"世界等级":[[物品ID,个数,是否绑定], ...], ...}
|
| | | char NotifyMark; //广播提示
|
| | | BYTE PayType; //充值类型
|
| | | };
|
| | |
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | GroupCount = 0 #(BYTE GroupCount)// 循环购买礼包组数
|
| | | GroupList = list() #(vector<tagMCActGrowupBuyGroup> GroupList)//循环购买礼包组列表
|
| | | ActWorldLV = 0 #(WORD ActWorldLV)// 活动世界等级
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | temGroupList = tagMCActGrowupBuyGroup()
|
| | | _pos = temGroupList.ReadData(_lpData, _pos)
|
| | | self.GroupList.append(temGroupList)
|
| | | self.ActWorldLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.EndtDate = ""
|
| | | self.GroupCount = 0
|
| | | self.GroupList = list()
|
| | | self.ActWorldLV = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 1
|
| | | for i in range(self.GroupCount):
|
| | | length += self.GroupList[i].GetLength()
|
| | | length += 2
|
| | |
|
| | | return length
|
| | |
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.GroupCount)
|
| | | for i in range(self.GroupCount):
|
| | | data = CommFunc.WriteString(data, self.GroupList[i].GetLength(), self.GroupList[i].GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.ActWorldLV)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | GroupCount:%d,
|
| | | GroupList:%s
|
| | | GroupList:%s,
|
| | | ActWorldLV:%d
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.GroupCount,
|
| | | "..."
|
| | | "...",
|
| | | self.ActWorldLV
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | EndtDate = "" #(char EndtDate[10])// 结束日期 y-m-d
|
| | | GroupCount = 0 #(BYTE GroupCount)// 循环购买礼包组数
|
| | | GroupList = list() #(vector<tagMCActGrowupBuyGroup> GroupList)//循环购买礼包组列表
|
| | | ActWorldLV = 0 #(WORD ActWorldLV)// 活动世界等级
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | |
| | | temGroupList = tagMCActGrowupBuyGroup()
|
| | | _pos = temGroupList.ReadData(_lpData, _pos)
|
| | | self.GroupList.append(temGroupList)
|
| | | self.ActWorldLV,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | |
| | | self.EndtDate = ""
|
| | | self.GroupCount = 0
|
| | | self.GroupList = list()
|
| | | self.ActWorldLV = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | length += 1
|
| | | for i in range(self.GroupCount):
|
| | | length += self.GroupList[i].GetLength()
|
| | | length += 2
|
| | |
|
| | | return length
|
| | |
|
| | |
| | | data = CommFunc.WriteBYTE(data, self.GroupCount)
|
| | | for i in range(self.GroupCount):
|
| | | data = CommFunc.WriteString(data, self.GroupList[i].GetLength(), self.GroupList[i].GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.ActWorldLV)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | |
| | | StartDate:%s,
|
| | | EndtDate:%s,
|
| | | GroupCount:%d,
|
| | | GroupList:%s
|
| | | GroupList:%s,
|
| | | ActWorldLV:%d
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.StartDate,
|
| | | self.EndtDate,
|
| | | self.GroupCount,
|
| | | "..."
|
| | | "...",
|
| | | self.ActWorldLV
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | | ("WORD", "GainGoldPrize", 0),
|
| | | ("WORD", "FirstGoldPrize", 0),
|
| | | ("list", "GainItemList", 0),
|
| | | ("dict", "ActWorldLVGainItemInfo", 0),
|
| | | ("char", "NotifyMark", 0),
|
| | | ("BYTE", "PayType", 0),
|
| | | ),
|
| | |
| | | self.GainGoldPrize = 0
|
| | | self.FirstGoldPrize = 0
|
| | | self.GainItemList = []
|
| | | self.ActWorldLVGainItemInfo = {}
|
| | | self.NotifyMark = ""
|
| | | self.PayType = 0 |
| | | return |
| | |
| | | def GetGainGoldPrize(self): return self.GainGoldPrize # 赠送仙玉数
|
| | | def GetFirstGoldPrize(self): return self.FirstGoldPrize # 首次充值该档位赠送仙玉
|
| | | def GetGainItemList(self): return self.GainItemList # 获得物品列表[[物品ID,个数,是否绑定], ...]
|
| | | def GetActWorldLVGainItemInfo(self): return self.ActWorldLVGainItemInfo # 根据活动世界等级获得物品信息,活动专用 {"世界等级":[[物品ID,个数,是否绑定], ...], ...}
|
| | | def GetNotifyMark(self): return self.NotifyMark # 广播提示
|
| | | def GetPayType(self): return self.PayType # 充值类型 |
| | | |
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActGrowupBuy", cfgID)
|
| | | if not ipyData:
|
| | | return
|
| | | ctgIDGroupList = __GetCTGIDGroupList(ipyData.GetCTGIDGroupList(), actInfo.get(ShareDefine.ActKey_WorldLV, 0))
|
| | | ctgIDGroupList = ipyData.GetCTGIDGroupList()
|
| | |
|
| | | buyState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GrowupBuyState)
|
| | | GameWorld.DebugLog("更新成长必买今日可购买礼包索引! buyState=%s,ctgIDGroupList=%s" % (buyState, ctgIDGroupList))
|
| | |
| | | Sync_GrowupActionInfo(curPlayer)
|
| | | return
|
| | |
|
| | | def __GetCTGIDGroupList(cfgGroupList, worldLV):
|
| | | if isinstance(cfgGroupList, dict):
|
| | | return GameWorld.GetDictValueByRangeKey(cfgGroupList, worldLV, [])
|
| | | return cfgGroupList
|
| | |
|
| | | def CheckGrowupBuyState(curPlayer, ctgID):
|
| | | ## 检查是否可购买成长必买礼包ID
|
| | | # @return: 是否可买, 不可买原因说明
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActGrowupBuy", cfgID)
|
| | | if not ipyData:
|
| | | return False, "not grow up buy action ipyData cfgID(%s)!" % cfgID
|
| | | ctgIDGroupList = __GetCTGIDGroupList(ipyData.GetCTGIDGroupList(), actInfo.get(ShareDefine.ActKey_WorldLV, 0))
|
| | | ctgIDGroupList = ipyData.GetCTGIDGroupList()
|
| | | buyState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GrowupBuyState)
|
| | | curCTGIDList = []
|
| | | playerBuyIndex = -1
|
| | |
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActGrowupBuy", cfgID)
|
| | | if not ipyData:
|
| | | return
|
| | | ctgIDGroupList = __GetCTGIDGroupList(ipyData.GetCTGIDGroupList(), actInfo.get(ShareDefine.ActKey_WorldLV, 0))
|
| | | ctgIDGroupList = ipyData.GetCTGIDGroupList()
|
| | | if not ctgIDGroupList:
|
| | | return
|
| | |
|
| | | buyState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GrowupBuyState)
|
| | |
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | actInfo = ChPyNetSendPack.tagMCActGrowupBuyInfo()
|
| | | actInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
|
| | | actInfo.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
|
| | | actInfo.GroupList = []
|
| | | actPack = ChPyNetSendPack.tagMCActGrowupBuyInfo()
|
| | | actPack.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
|
| | | actPack.EndtDate = GameWorld.GetOperationActionDateStr(ipyData.GetEndDate(), openServerDay)
|
| | | actPack.GroupList = []
|
| | | for i, ctgIDList in enumerate(ctgIDGroupList):
|
| | | groupInfo = ChPyNetSendPack.tagMCActGrowupBuyGroup()
|
| | | groupInfo.BuyCTGIDList = ctgIDList
|
| | | groupInfo.BuyCount = len(groupInfo.BuyCTGIDList)
|
| | | groupInfo.PlayerBuyIndex = GameWorld.GetDataByDigitPlace(buyState, i)
|
| | | actInfo.GroupList.append(groupInfo)
|
| | | actInfo.GroupCount = len(actInfo.GroupList)
|
| | | NetPackCommon.SendFakePack(curPlayer, actInfo)
|
| | | actPack.GroupList.append(groupInfo)
|
| | | actPack.GroupCount = len(actPack.GroupList)
|
| | | actPack.ActWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | NetPackCommon.SendFakePack(curPlayer, actPack)
|
| | | return
|