| | |
| | | import GameWorld
|
| | | import ChConfig
|
| | |
|
| | | def GetShopTypeList(cfgID, dayIndex):
|
| | | if cfgID == None or dayIndex == None:
|
| | | return []
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("ActSpringSale", cfgID)
|
| | | if not ipyData:
|
| | | return []
|
| | | shopTypeList = ipyData.GetShopTypeList()
|
| | | todayShopType = shopTypeList[-1] if dayIndex >= len(shopTypeList) else shopTypeList[dayIndex]
|
| | | return todayShopType
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | isReset = __CheckPlayerSpringSaleAction(curPlayer)
|
| | |
| | | actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_SpringSale, {})
|
| | | actID = actInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actInfo.get(ShareDefine.ActKey_State, 0)
|
| | | shopTypeList = actInfo.get(ShareDefine.ActKey_ShopTypeList, [])
|
| | | #if not state or not shopTypeList:
|
| | | # return
|
| | |
|
| | | playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SpringSaleID) # 玩家身上的活动ID
|
| | |
|
| | |
| | | GameWorld.DebugLog("限时特惠活动ID不变,不处理!", curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | shopTypeList = GetShopTypeList(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SpringSaleID, actID)
|
| | | FunctionNPCCommon.ResetShopItemBuyCountByShopType(curPlayer, shopTypeList)
|
| | |
|
| | |
| | | return
|
| | |
|
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | shopTypeList = actInfo.get(ShareDefine.ActKey_ShopTypeList, 0)
|
| | | shopTypeList = GetShopTypeList(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | |
|
| | | if not cfgID or not shopTypeList:
|
| | | return
|