From fe94844205ade47d1652ddd80ccfbfe0fac4a20f Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 19 六月 2019 15:27:20 +0800
Subject: [PATCH] 7385 【2.0】【后端】超值礼包修改

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py |   48 +-----------------------------------------------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py                    |    7 +++++--
 PySysDB/PySysDBPY.h                                                                                     |    1 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py              |    4 +++-
 4 files changed, 10 insertions(+), 50 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 11d93c2..ef0b180 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -83,6 +83,7 @@
 	WORD		LimiRealmLV;	//需要境界等级
 	DWORD		LimitMissionID;	//需要完成的任务ID
 	BYTE		LimitVIPLV;	//需要VIP等级
+	char		MailKey;	//邮件
 };
 
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
index da0f3a2..24147cb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
@@ -197,7 +197,6 @@
 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)
@@ -208,7 +207,6 @@
 # @return 
 def ShopItemOnDay(curPlayer, onEventType):
     if onEventType == ShareDefine.Def_OnEventType:
-        UpdataSuperGiftTime(curPlayer, True)
         OSSaleOpenMail(curPlayer)
         refreshType = [3]
         #神秘商店刷新次数重置
@@ -803,8 +801,7 @@
         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())
@@ -847,49 +844,6 @@
     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 玩家实例
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 0bebfc8..b957a66 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -96,6 +96,7 @@
                         ("WORD", "LimiRealmLV", 0),
                         ("DWORD", "LimitMissionID", 0),
                         ("BYTE", "LimitVIPLV", 0),
+                        ("char", "MailKey", 0),
                         ),
 
                 "ItemCompound":(
@@ -1609,7 +1610,8 @@
         self.LimitMagicWeapon = 0
         self.LimiRealmLV = 0
         self.LimitMissionID = 0
-        self.LimitVIPLV = 0
+        self.LimitVIPLV = 0
+        self.MailKey = ""
         return
         
     def GetFuncId(self): return self.FuncId # 功能标识
@@ -1617,7 +1619,8 @@
     def GetLimitMagicWeapon(self): return self.LimitMagicWeapon # 需要解锁法宝ID
     def GetLimiRealmLV(self): return self.LimiRealmLV # 需要境界等级
     def GetLimitMissionID(self): return self.LimitMissionID # 需要完成的任务ID
-    def GetLimitVIPLV(self): return self.LimitVIPLV # 需要VIP等级
+    def GetLimitVIPLV(self): return self.LimitVIPLV # 需要VIP等级
+    def GetMailKey(self): return self.MailKey # 邮件
 
 # 合成表
 class IPY_ItemCompound():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py
index a203371..e56b5a0 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/GameFuncComm.py
@@ -65,7 +65,6 @@
                      ShareDefine.GameFuncID_AddPoint:lambda curObj:PlayerControl.DoAddPointOpen(curObj),
                      ShareDefine.GameFuncID_Talent:lambda curObj:PlayerGreatMaster.DoTalentOpen(curObj),
                      ShareDefine.GameFuncID_TJG:lambda curObj:PlayerTJG.DoTJGOpen(curObj),
-                     ShareDefine.GameFuncID_SuperGift:lambda curObj:FunctionNPCCommon.UpdataSuperGiftTime(curObj),
                      #ShareDefine.GameFuncID_RunDaily:lambda curObj:FBCommon.DoFuncOpen_RunDaily(curObj),
                      #ShareDefine.GameFuncID_RunFamily:lambda curObj:FBCommon.DoFuncOpen_RunFamily(curObj),
                      #ShareDefine.GameFuncID_RefineExp:lambda curObj:Operate_PlayerBuyZhenQi.DoFuncOpen_RefineExp(curObj),
@@ -140,6 +139,9 @@
         if funcID in FuncOpenLogicDict:
             FuncOpenLogicDict[funcID](curPlayer)
             
+        mailKey = ipyData.GetMailKey()
+        if mailKey:
+            PlayerControl.SendMailByKey(mailKey, [curPlayer.GetPlayerID()])
         openFuncIDList.append(funcID)
         
     if openFuncIDList:

--
Gitblit v1.8.0