From c060aabfb4621e897f7b69d6e537fc3ccf59d860 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 28 一月 2019 20:44:25 +0800
Subject: [PATCH] 2969 【BUG】【1.5.200】限时抢购,重新开服全服抢购次数会重置​

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerStore.py                    |   12 +++++-------
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py |   10 +++++-----
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
index 993ca3f..0064807 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldActionControl.py
@@ -463,7 +463,10 @@
             elif actName == ShareDefine.OperationActionName_NewFairyCeremony:
                 #重置仙界盛典
                 PlayerNewFairyCeremony.ResetNewFairyCeremony()
-            
+            elif actName == ShareDefine.OperationActionName_FlashSale:
+                #限时抢购重置购买次数 本次活动每场不能重复
+                #dayIndex = sendMapServerMsgDict.get(ShareDefine.ActKey_DayIndex, 0)
+                PlayerStore.ResetFlashSaleBuyCnt(ipyData)
                 
         if actName in ShareDefine.NeedWorldLVOperationActNameList:
             actWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % actName)
@@ -494,10 +497,7 @@
         elif actName == ShareDefine.OperationActionName_RealmPoint:
             if isReload and ipyData:
                 Sync_OperationAction_RealmPoint(ipyData)
-        elif actName == ShareDefine.OperationActionName_FlashSale:
-            if ipyData and preState != state:
-                dayIndex = sendMapServerMsgDict.get(ShareDefine.ActKey_DayIndex, 0)
-                PlayerStore.ResetFlashSaleBuyCnt(ipyData, dayIndex, state)
+        
                 
         #通知Mapserver,设置字典
         #GameWorld.SendMapServerMsgEx(dictName, state) # 运营活动不单独通知活动状态,需与活动信息整合后一起通知
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerStore.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerStore.py
index 551d2aa..547c164 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerStore.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerStore.py
@@ -95,18 +95,16 @@
     return
 
 
-def ResetFlashSaleBuyCnt(ipyData, dayIndex, state):
+def ResetFlashSaleBuyCnt(ipyData):
     #重置限时抢购商店全服购买次数
-    if state == 0:
-        return
     dayShopRangeDict = ipyData.GetShopTypeList()
     
     resetTypeList = []
     for shopTypeList in dayShopRangeDict.values():
-        dayShopList = shopTypeList[dayIndex] if dayIndex < len(shopTypeList) else shopTypeList[-1]
-        shopType = dayShopList[state-1] if state-1 < len(dayShopList) else dayShopList[-1]
-        if shopType not in resetTypeList:
-            resetTypeList.append(shopType)
+        for dayShopList in shopTypeList:
+            for shopType in dayShopList:
+                if shopType not in resetTypeList:
+                    resetTypeList.append(shopType)
     if resetTypeList:
         DoResetStoreServerBuyCnt(resetTypeList)
     return

--
Gitblit v1.8.0