2303 【后端】限时特惠提前通知前端开启
2302 【后端】限时礼包开启提前通知前端
| | |
| | | return todayGiftbag
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | isReset = __CheckPlayerFlashGiftbagAction(curPlayer)
|
| | | if not isReset:
|
| | | actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FlashGiftbag, {})
|
| | | # 活动中同步活动信息
|
| | | if actInfo.get(ShareDefine.ActKey_State):
|
| | | giftbagTypeList = GetGiftbagTypeList(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | SyncFlashGiftbagBuyCount(curPlayer, giftbagTypeList=giftbagTypeList)
|
| | | Sync_FlashGiftbagActionInfo(curPlayer)
|
| | | __CheckPlayerFlashGiftbagAction(curPlayer)
|
| | | return
|
| | |
|
| | | def RefreshFlashGiftbagActionInfo():
|
| | |
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | |
|
| | | playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FlashGiftbagID) # 玩家身上的活动ID
|
| | | |
| | | giftbagTypeList = [] if not cfgID else GetGiftbagTypeList(cfgID, actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | isReset = False
|
| | | if actID != playerActID:
|
| | | giftbagTypeList = GetGiftbagTypeList(cfgID, actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | ResetGiftbagItemBuyCount(curPlayer, giftbagTypeList)
|
| | | isReset = True
|
| | | __ResetGiftbagItemBuyCount(curPlayer, giftbagTypeList)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FlashGiftbagID, actID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FlashGiftbagMailState, 0)
|
| | | GameWorld.DebugLog("限时礼包重置! actID=%s,playerActID=%s,state=%s,giftbagTypeList=%s" % (actID, playerActID, state, giftbagTypeList), playerID)
|
| | |
| | | PlayerControl.SendMailByKey(flashGiftbagIpyData.GetMailKey(), [playerID], flashGiftbagIpyData.GetMailItemPrize())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FlashGiftbagMailState, state)
|
| | | GameWorld.DebugLog(" 发送新限时礼包邮件提醒! state=%s,playerMailState=%s" % (state, playerMailState), playerID)
|
| | | return True
|
| | |
|
| | | def ResetGiftbagItemBuyCount(curPlayer, giftbagTypeList):
|
| | | if not isReset and cfgID:
|
| | | if giftbagTypeList:
|
| | | SyncFlashGiftbagBuyCount(curPlayer, giftbagTypeList=giftbagTypeList)
|
| | | Sync_FlashGiftbagActionInfo(curPlayer)
|
| | | return isReset
|
| | |
|
| | | def __ResetGiftbagItemBuyCount(curPlayer, giftbagTypeList):
|
| | | ##重置限时礼包限购物品次数
|
| | | syncIDList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | |
| | | if not actInfo:
|
| | | return
|
| | |
|
| | | if not actInfo.get(ShareDefine.ActKey_State):
|
| | | return
|
| | | #需要提前通知,所以去掉此限制
|
| | | #if not actInfo.get(ShareDefine.ActKey_State):
|
| | | # return
|
| | |
|
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | giftbagTypeList = GetGiftbagTypeList(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | if not cfgID:
|
| | | return
|
| | | giftbagTypeList = GetGiftbagTypeList(cfgID, actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | |
|
| | | if not cfgID or not giftbagTypeList:
|
| | | if not giftbagTypeList:
|
| | | return
|
| | |
|
| | | flashGiftbagIpyData = IpyGameDataPY.GetIpyGameData("ActFlashGiftbag", cfgID)
|
| | |
| | | return todayShopType
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | isReset = __CheckPlayerSpringSaleAction(curPlayer)
|
| | | if not isReset:
|
| | | actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_SpringSale, {})
|
| | | # 活动中同步活动信息
|
| | | if actInfo.get(ShareDefine.ActKey_State):
|
| | | Sync_SpringSaleActionInfo(curPlayer)
|
| | | __CheckPlayerSpringSaleAction(curPlayer)
|
| | | return
|
| | |
|
| | | def RefreshSpringSaleActionInfo():
|
| | |
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | |
|
| | | playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SpringSaleID) # 玩家身上的活动ID
|
| | | |
| | | isReset = False
|
| | | if actID != playerActID:
|
| | | isReset = True
|
| | | shopTypeList = GetShopTypeList(cfgID, actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | FunctionNPCCommon.ResetShopItemBuyCountByShopType(curPlayer, shopTypeList)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SpringSaleID, actID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SpringSaleMailState, 0)
|
| | | Sync_SpringSaleActionInfo(curPlayer)
|
| | | #Sync_SpringSaleActionInfo(curPlayer)
|
| | | GameWorld.DebugLog("限时特惠重置! actID=%s,playerActID=%s,state=%s,shopTypeList=%s" % (actID, playerActID, state, shopTypeList), playerID)
|
| | | else:
|
| | | GameWorld.DebugLog("限时特惠活动ID不变,不处理!", playerID)
|
| | |
| | | PlayerControl.SendMailByKey(springSaleIpyData.GetMailKey(), [playerID], springSaleIpyData.GetMailItemPrize())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SpringSaleMailState, state)
|
| | | GameWorld.DebugLog(" 发送新限时特惠邮件提醒! state=%s,playerMailState=%s" % (state, playerMailState), playerID)
|
| | | return True
|
| | | |
| | | if cfgID:
|
| | | Sync_SpringSaleActionInfo(curPlayer)
|
| | | return isReset
|
| | |
|
| | | def Sync_SpringSaleActionInfo(curPlayer):
|
| | | ## 通知限时特惠活动信息
|
| | |
| | | if not actInfo:
|
| | | return
|
| | |
|
| | | if not actInfo.get(ShareDefine.ActKey_State):
|
| | | return
|
| | | #需要提前通知,所以去掉此限制
|
| | | #if not actInfo.get(ShareDefine.ActKey_State):
|
| | | # return
|
| | |
|
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | shopTypeList = GetShopTypeList(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | |
| | | if not cfgID or not shopTypeList:
|
| | | if not cfgID:
|
| | | return
|
| | | shopTypeList = GetShopTypeList(cfgID, actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | if not shopTypeList:
|
| | | return
|
| | |
|
| | | springSaleIpyData = IpyGameDataPY.GetIpyGameData("ActSpringSale", cfgID)
|