| | |
| | | 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():
|
| | |
| | | actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FlashGiftbag, {})
|
| | | actID = actInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | |
|
| | | playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FlashGiftbagID) # 玩家身上的活动ID
|
| | | |
| | | # 活动ID 相同的话不处理
|
| | | if actID == playerActID:
|
| | | giftbagTypeList = [] if not cfgID else GetGiftbagTypeList(cfgID, actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | isReset = False
|
| | | if actID != playerActID:
|
| | | 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)
|
| | | Sync_FlashGiftbagActionInfo(curPlayer)
|
| | | else:
|
| | | GameWorld.DebugLog("限时礼包活动ID不变,不处理!", curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | giftbagTypeList = GetGiftbagTypeList(actInfo.get(ShareDefine.ActKey_CfgID, 0), actInfo.get(ShareDefine.ActKey_DayIndex, 0))
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FlashGiftbagID, actID)
|
| | | ResetGiftbagItemBuyCount(curPlayer, giftbagTypeList)
|
| | | |
| | | GameWorld.DebugLog("限时礼包重置! actID=%s,playerActID=%s,state=%s,giftbagTypeList=%s" % (actID, playerActID, state, giftbagTypeList), playerID)
|
| | | |
| | | Sync_FlashGiftbagActionInfo(curPlayer)
|
| | | return True
|
| | | |
| | | playerMailState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FlashGiftbagMailState) # 玩家身上的活动提醒邮件状态
|
| | | if actID and state and state != playerMailState:
|
| | | flashGiftbagIpyData = IpyGameDataPY.GetIpyGameData("ActFlashGiftbag", cfgID)
|
| | | if flashGiftbagIpyData and flashGiftbagIpyData.GetMailKey() and curPlayer.GetLV() >= flashGiftbagIpyData.GetLVLimit():
|
| | | PlayerControl.SendMailByKey(flashGiftbagIpyData.GetMailKey(), [playerID], flashGiftbagIpyData.GetMailItemPrize())
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FlashGiftbagMailState, state)
|
| | | GameWorld.DebugLog(" 发送新限时礼包邮件提醒! state=%s,playerMailState=%s" % (state, playerMailState), playerID)
|
| | | |
| | | if not isReset and cfgID:
|
| | | if giftbagTypeList:
|
| | | SyncFlashGiftbagBuyCount(curPlayer, giftbagTypeList=giftbagTypeList)
|
| | | Sync_FlashGiftbagActionInfo(curPlayer)
|
| | | return isReset
|
| | |
|
| | | def ResetGiftbagItemBuyCount(curPlayer, giftbagTypeList):
|
| | | def __ResetGiftbagItemBuyCount(curPlayer, giftbagTypeList):
|
| | | ##重置限时礼包限购物品次数
|
| | | syncIDList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | |
| | | event=[ChConfig.ItemGive_CTG, True, addDRDict])
|
| | |
|
| | | # 取玩家APPID,混服使用
|
| | | appID = GameWorld.GetPlayerPlatform(curPlayer.GetAccID())
|
| | | appID = GameWorld.GetPlayerPlatform(curPlayer)
|
| | | notifyKey = giftbagIpyData.GetNotifyKey()
|
| | | if notifyKey:
|
| | | orderIpyData = GetFlashGiftbagIDOrderInfoIpyData(giftbagID, appID)
|
| | |
| | | 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
|
| | |
|
| | | # 取玩家APPID,混服使用
|
| | | appID = GameWorld.GetPlayerPlatform(curPlayer.GetAccID())
|
| | | appID = GameWorld.GetPlayerPlatform(curPlayer)
|
| | |
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | packInfo = ChPyNetSendPack.tagMCFlashGiftbagInfo()
|
| | | packInfo.StartDate = flashGiftbagIpyData.GetStartDate()
|
| | | packInfo.EndtDate = flashGiftbagIpyData.GetEndDate()
|
| | | packInfo.StartDate = GameWorld.GetOperationActionDateStr(flashGiftbagIpyData.GetStartDate(), openServerDay)
|
| | | packInfo.EndtDate = GameWorld.GetOperationActionDateStr(flashGiftbagIpyData.GetEndDate(), openServerDay)
|
| | | packInfo.AdvanceMinutes = flashGiftbagIpyData.GetAdvanceMinutes()
|
| | | packInfo.ActivityTime = []
|
| | | for i, startTime in enumerate(startTimeList):
|
| | | timeInfo = ChPyNetSendPack.tagMCFlashGiftbagTime()
|