| | |
| | |
|
| | | buyIndex = GameWorld.GetDataByDigitPlace(buyState, i)
|
| | | updBuyIndex = 0
|
| | | # 最后一个礼包了,不管有没有买都重置
|
| | | if buyIndex >= len(ctgIDList) - 1:
|
| | | updBuyIndex = 0
|
| | | GameWorld.DebugLog(" 最后一个礼包,重置!")
|
| | | else:
|
| | | yestodayCtgID = ctgIDList[buyIndex]
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TodayCTGCount % yestodayCtgID):
|
| | | updBuyIndex = 0
|
| | | GameWorld.DebugLog(" 前置礼包没买,重置!yestodayCtgID=%s" % yestodayCtgID)
|
| | | GameWorld.DebugLog(" 昨日礼包没买,重置!yestodayCtgID=%s" % yestodayCtgID)
|
| | | else:
|
| | | if buyIndex >= len(ctgIDList) - 1:
|
| | | updBuyIndex = len(ctgIDList) - 1
|
| | | GameWorld.DebugLog(" 昨日礼包已买,最后一档礼包保持不变! yestodayCtgID=%s,updBuyIndex=%s" % (yestodayCtgID, updBuyIndex))
|
| | | else:
|
| | | updBuyIndex = buyIndex + 1
|
| | | GameWorld.DebugLog(" 前置礼包已买,更新后续礼包索引! yestodayCtgID=%s,updBuyIndex=%s" % (yestodayCtgID, updBuyIndex))
|
| | | GameWorld.DebugLog(" 昨日礼包已买,更新后续礼包索引! yestodayCtgID=%s,updBuyIndex=%s" % (yestodayCtgID, updBuyIndex))
|
| | |
|
| | | buyState = GameWorld.ChangeDataByDigitPlace(buyState, i, updBuyIndex)
|
| | | GameWorld.DebugLog(" updState=%s" % buyState)
|
| | |
| | | if not ctgIDGroupList:
|
| | | return
|
| | |
|
| | | import PlayerCoin
|
| | | buyState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GrowupBuyState)
|
| | |
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | |
| | | actPack.GroupList = []
|
| | | for i, ctgIDList in enumerate(ctgIDGroupList):
|
| | | groupInfo = ChPyNetSendPack.tagMCActGrowupBuyGroup()
|
| | | groupInfo.BuyCTGIDList = ctgIDList
|
| | | groupInfo.BuyCTGIDList = []
|
| | | for ctgID in ctgIDList:
|
| | | ctgIpyData = IpyGameDataPY.GetIpyGameData("CTG", ctgID)
|
| | | ctgGiveItemList = PlayerCoin.GetCTGGiveItemList(ctgIpyData)
|
| | | ctgInfo = ChPyNetSendPack.tagMCActGrowupBuyCTGInfo()
|
| | | ctgInfo.CTGID = ctgID
|
| | | ctgInfo.GainItemList = []
|
| | | for itemID, itemCount, isAuctionItem in ctgGiveItemList:
|
| | | ctgItem = ChPyNetSendPack.tagMCActGrowupBuyCTGItem()
|
| | | ctgItem.ItemID = itemID
|
| | | ctgItem.ItemCount = itemCount
|
| | | ctgItem.IsBind = isAuctionItem
|
| | | ctgInfo.GainItemList.append(ctgItem)
|
| | | ctgInfo.GainItemCount = len(ctgInfo.GainItemList)
|
| | | groupInfo.BuyCTGIDList.append(ctgInfo)
|
| | | groupInfo.BuyCount = len(groupInfo.BuyCTGIDList)
|
| | | groupInfo.PlayerBuyIndex = GameWorld.GetDataByDigitPlace(buyState, i)
|
| | | actPack.GroupList.append(groupInfo)
|
| | | actPack.GroupCount = len(actPack.GroupList)
|
| | | actPack.ActWorldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
|
| | | NetPackCommon.SendFakePack(curPlayer, actPack)
|
| | | return
|