|  |  | 
 |  |  | import datetime
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  | def GetShopTypeList(cfgID, dayIndex, state):
 | 
 |  |  | def GetShopTypeList(cfgID, dayIndex, state, woldLV):
 | 
 |  |  |     if cfgID == 0 or state == 0:
 | 
 |  |  |         return []
 | 
 |  |  |     ipyData = IpyGameDataPY.GetIpyGameData("ActFlashSale", cfgID)
 | 
 |  |  |     if not ipyData:
 | 
 |  |  |         return []
 | 
 |  |  |     shopTypeList = ipyData.GetShopTypeList()
 | 
 |  |  |     shopTypeList = GameWorld.GetDictValueByRangeKey(ipyData.GetShopTypeList(), woldLV, [])
 | 
 |  |  |     if not shopTypeList:
 | 
 |  |  |         return []
 | 
 |  |  |     todayShopTypeList = shopTypeList[-1] if dayIndex >= len(shopTypeList) else shopTypeList[dayIndex]
 | 
 |  |  |     return [todayShopTypeList[state - 1] if state - 1 < len(todayShopTypeList) else todayShopTypeList[-1]]
 | 
 |  |  | 
 | 
 |  |  | 
 |  |  |     state = actInfo.get(ShareDefine.ActKey_State, 0)
 | 
 |  |  |     cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0)
 | 
 |  |  |     dayIndex = actInfo.get(ShareDefine.ActKey_DayIndex, 0)
 | 
 |  |  |     woldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
 | 
 |  |  |     playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FlashSaleID, 0, ChConfig.Def_PDictType_FlashSale)  # 玩家身上的活动ID
 | 
 |  |  |     playerActState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FlashSaleState, 0, ChConfig.Def_PDictType_FlashSale)  # 玩家身上的活动State
 | 
 |  |  |     playerMailState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FlashSaleMailState, 0, ChConfig.Def_PDictType_FlashSale)  # 玩家身上的活动提醒邮件状态
 | 
 |  |  | 
 |  |  |             GameWorld.DebugLog('    限时抢购活动重置!')
 | 
 |  |  |             curPlayer.ClearNomalDict(ChConfig.Def_PDictType_FlashSale)
 | 
 |  |  |         
 | 
 |  |  |         shopTypeList = GetShopTypeList(cfgID, dayIndex, state)
 | 
 |  |  |         shopTypeList = GetShopTypeList(cfgID, dayIndex, state, woldLV)
 | 
 |  |  |         if shopTypeList:
 | 
 |  |  |             FunctionNPCCommon.ResetShopItemBuyCountByShopType(curPlayer, shopTypeList)
 | 
 |  |  |         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FlashSaleID, actID, ChConfig.Def_PDictType_FlashSale)
 | 
 |  |  | 
 |  |  |     flashSaleIpyData = IpyGameDataPY.GetIpyGameData("ActFlashSale", cfgID)
 | 
 |  |  |     if not flashSaleIpyData:
 | 
 |  |  |         return
 | 
 |  |  |     shopTypeList = flashSaleIpyData.GetShopTypeList()
 | 
 |  |  |     woldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
 | 
 |  |  |     shopTypeList = GameWorld.GetDictValueByRangeKey(flashSaleIpyData.GetShopTypeList(), woldLV, [])
 | 
 |  |  |     startTimeList = flashSaleIpyData.GetStartTimeList()
 | 
 |  |  |     endTimeList = flashSaleIpyData.GetEndTimeList()
 | 
 |  |  |     if len(startTimeList) != len(endTimeList):
 | 
 |  |  | 
 |  |  |     flashSaleIpyData = IpyGameDataPY.GetIpyGameData("ActFlashSale", cfgID)
 | 
 |  |  |     if not flashSaleIpyData:
 | 
 |  |  |         return
 | 
 |  |  |     woldLV = actInfo.get(ShareDefine.ActKey_WorldLV, 0)
 | 
 |  |  |      | 
 |  |  |     packInfo = ChPyNetSendPack.tagMCFlashSaleAppointmentInfo()
 | 
 |  |  |     packInfo.GoodsList = []
 | 
 |  |  |     if goodsID == 0:
 | 
 |  |  |         packInfo.IsAll = 1
 | 
 |  |  |         shopTypeList = flashSaleIpyData.GetShopTypeList()
 | 
 |  |  |         shopTypeList = GameWorld.GetDictValueByRangeKey(flashSaleIpyData.GetShopTypeList(), woldLV, [])
 | 
 |  |  |         for dayIndex, shopList in enumerate(shopTypeList):
 | 
 |  |  |             for timeIndex, shopType in enumerate(shopList):
 | 
 |  |  |                 shopItemIpyDataList = IpyGameDataPY.GetIpyGameDataByCondition("Store", {"ShopType":shopType}, True, True)
 |