| | |
| | | def ShopItemOnLogin(curPlayer):
|
| | | SyncMysticalLimitShopInfo(curPlayer)
|
| | | SyncShopItemTodayBuyCount(curPlayer)
|
| | | SyncSuperGiftInfo(curPlayer)
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MysticalShopGoods % 0):
|
| | | __DoMysticalShopRefresh(curPlayer, True, GameWorld.GetGameWorld().GetTick())
|
| | | SyncMysticalShopInfo(curPlayer)
|
| | |
| | | # @return
|
| | | def ShopItemOnDay(curPlayer, onEventType):
|
| | | if onEventType == ShareDefine.Def_OnEventType:
|
| | | UpdataSuperGiftTime(curPlayer, True)
|
| | | OSSaleOpenMail(curPlayer)
|
| | | refreshType = [3]
|
| | | #神秘商店刷新次数重置
|
| | |
| | | return not PlayerFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
|
| | | if itemIndex in IpyGameDataPY.GetFuncEvalCfg('NewCeremonyFireParty', 1, {}).values():
|
| | | return not PlayerNewFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
|
| | | # if itemIndex in dict(IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList')):
|
| | | # return not CheckSuperGiftBuy(curPlayer, itemIndex)
|
| | |
|
| | | if shopNPCID == 16:#神秘限购
|
| | | startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopItemStartTime % itemIndex)
|
| | | curTime = int(time.time())
|
| | |
| | | PlayerControl.SendMailByKey('SellMail1', [curPlayer.GetID()], addItemList)
|
| | | return
|
| | |
|
| | | #超值礼包购买时间
|
| | | def UpdataSuperGiftTime(curPlayer, isOnday=False):
|
| | | curTime = int(time.time())
|
| | | if isOnday:
|
| | | startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SuperGiftStartTime)
|
| | | if not startTime:
|
| | | return
|
| | | superGiftTimeList = IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList')
|
| | | maxDay = max([info[1] for info in superGiftTimeList])
|
| | | if curTime - startTime >= maxDay * 86400:
|
| | | #活动结束 重置
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftStartTime, 0)
|
| | | else:
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftStartTime, curTime)
|
| | | addItemList = IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList', 2)
|
| | | PlayerControl.SendMailByKey('SellMail2', [curPlayer.GetID()], addItemList)
|
| | | SyncSuperGiftInfo(curPlayer)
|
| | | return True
|
| | |
|
| | | def SyncSuperGiftInfo(curPlayer):
|
| | | startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SuperGiftStartTime)
|
| | | if not startTime:
|
| | | return
|
| | | packData = ChPyNetSendPack.tagMCSuperGiftInfo()
|
| | | packData.StartTime = startTime
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | | def CheckSuperGiftBuy(curPlayer, giftID):
|
| | | #超值礼包是否可购买
|
| | | startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SuperGiftStartTime)
|
| | | if not startTime:
|
| | | return
|
| | | |
| | | superGiftTimeDict = dict(IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList'))
|
| | | totalDay = superGiftTimeDict.get(giftID, 0)
|
| | | if not totalDay:
|
| | | return
|
| | | curTime = int(time.time())
|
| | | if (curTime - startTime)/86400 >= totalDay:
|
| | | #已结束
|
| | | return
|
| | | return True
|
| | |
|
| | | ## 商店npcid
|
| | | # @param curPlayer 玩家实例
|