From fee42f94b6eed8592d24e24726d8b7cb058c0d1a Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 04 七月 2019 15:25:40 +0800
Subject: [PATCH] 7788 【2.0.200】【后端】周卡月卡调整

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py            |    3 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py |   80 +++++++++++++++++++++++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                |   23 ++++++-----
 3 files changed, 94 insertions(+), 12 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 87f9f97..b3b3484 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -4538,9 +4538,9 @@
 }
 
 #版本修正标记, 使用key格式 Def_Player_Dict_VersionFix
-#(
-#
-#) = range(0)
+(
+Def_VerFix_LingGenShow, #灵根特效外观
+) = range(1)
 
 ##==================================================================================================
 #游戏消费点类型定义
@@ -5103,16 +5103,17 @@
 
 # 投资理财类型
 GoldInvestTypeList = (
-GoldInvestType_Month, # 月卡投资
-GoldInvestType_VIP, # vip投资
-GoldInvestType_Gold, # 仙玉投资
-GoldInvestType_Gold2, # 仙玉投资2
-GoldInvestType_Gold3, # 仙玉投资3
-GoldInvestType_Week, # 周卡投资
-) = range(1,6+1)
+GoldInvestType_Month, # 月卡投资1
+GoldInvestType_VIP, # vip投资2
+GoldInvestType_Gold, # 仙玉投资3
+GoldInvestType_Gold2, # 仙玉投资4
+GoldInvestType_Gold3, # 仙玉投资5
+GoldInvestType_Week, # 周卡投资6
+GoldInvestType_NewMonth, # 新月卡投资7
+) = range(1,7+1)
 
 #可以循环投资的类型
-CanRepeatInvestType = [GoldInvestType_Week, GoldInvestType_Month, GoldInvestType_VIP]
+CanRepeatInvestType = [GoldInvestType_Week, GoldInvestType_Month, GoldInvestType_VIP, GoldInvestType_NewMonth]
 #仙玉投资类型
 InvestGoldTypeList = [GoldInvestType_Gold, GoldInvestType_Gold2, GoldInvestType_Gold3]
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
index d8dd02f..ce2bb75 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ChEquip.py
@@ -193,6 +193,9 @@
     #ChEquip.SyncAllEquipAttrActiveInfo(curPlayer)
     #装备位宝石镶嵌通知
     #Operate_EquipStone.OnLogin(curPlayer)
+    if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_LingGenShow):
+        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_LingGenShow, 1)
+        ChangeEquipfacadeByLingGen(curPlayer)
     
     ePartStarLVPack = ChPyNetSendPack.tagMCEquipPartStarInfo() # A3 B1 装备部位星数信息 #tagMCEquipPartStarInfo
     ePartPlusLVPack = ChPyNetSendPack.tagMCEquipPartPlusInfo() # A3 B3 装备部位强化信息 #tagMCEquipPartPlusInfo
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
index ae2e1f0..cae352a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
@@ -55,6 +55,7 @@
 #  @param curPlayer 玩家
 #  @return
 def OnLogin(curPlayer):
+    CheckOldInvestMail(curPlayer)
     for iType in ChConfig.GoldInvestTypeList:
         Sync_GoldInvestInfo(curPlayer, iType)
     return
@@ -64,6 +65,7 @@
 #  @param curPlayer 玩家
 #  @return
 def OnDay(curPlayer):
+    CheckOldInvestMail(curPlayer)
     #vip投资过了整个周期则重置
     __CheckInvestReset(curPlayer)
     
@@ -91,6 +93,82 @@
                 __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (investType, i), 0)
         Sync_GoldInvestInfo(curPlayer, investType, isForce=True)
     return
+
+def CheckOldInvestMail(curPlayer):
+    ## 老号旧投资邮件补偿
+    investMaxDayDict = IpyGameDataPY.GetFuncEvalCfg('InvestMaxDay')
+        
+    for oldInvestType in [ChConfig.GoldInvestType_Month, ChConfig.GoldInvestType_Week]:
+        investGoldRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % oldInvestType)
+        if not investGoldRecord:
+            continue
+        curDay = __GetInvestCurDay(curPlayer, oldInvestType)
+        maxDay = investMaxDayDict.get(str(oldInvestType), 0)
+        hasGotGold, lostGold, notGetGold, notGetDays = 0, 0, 0, 0 #已领取,错过领取,未领取,还有几天可领
+        for day in xrange(1, maxDay+1): 
+            ipyData = IpyGameDataPY.GetIpyGameData('Invest', oldInvestType*100+day)
+            if not ipyData:
+                continue
+            rewardDict = ipyData.GetReward()
+            awardData = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_AwardData % oldInvestType, 1)
+            if str(awardData) not in rewardDict:
+                GameWorld.DebugLog('    旧投资邮件补偿, rewardDict=%s, 没有key=%s'%(rewardDict, awardData))
+                continue
+            rewardList = rewardDict[str(awardData)]
+            gold = rewardList[0][1]
+            rewardRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (oldInvestType, day))
+            if rewardRecord:
+                hasGotGold += gold
+            elif day < curDay:
+                lostGold += gold
+            else:
+                notGetGold += gold
+                notGetDays += 1
+        GameWorld.DebugLog('旧投资邮件补偿 oldInvestType=%s,hasGotGold=%s, lostGold=%s, notGetGold=%s,notGetDays=%s'%
+                           (oldInvestType, hasGotGold, lostGold, notGetGold, notGetDays))
+        if not notGetGold:
+            continue
+        if oldInvestType == ChConfig.GoldInvestType_Week:
+            PlayerControl.SendMailByKey('WeekCardMail', [curPlayer.GetID()], [], [notGetDays, notGetGold], notGetGold)
+        elif oldInvestType == ChConfig.GoldInvestType_Month:
+            newInvestType = ChConfig.GoldInvestType_NewMonth
+            newMaxDay = investMaxDayDict.get(str(newInvestType), 0)
+            newTotalGold = 0
+            for day in xrange(1, newMaxDay+1): 
+                ipyData = IpyGameDataPY.GetIpyGameData('Invest', newInvestType*100+day)
+                if not ipyData:
+                    continue
+                rewardDict = ipyData.GetReward()
+                awardData = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_AwardData % newInvestType, 1)
+                if str(awardData) not in rewardDict:
+                    GameWorld.DebugLog('    旧投资邮件补偿, rewardDict=%s, 没有key=%s'%(rewardDict, awardData))
+                    continue
+                rewardList = rewardDict[str(awardData)]
+                gold = rewardList[0][1]
+                newTotalGold+=gold
+            oldTotalGold = hasGotGold+ lostGold+notGetGold
+            giveGold = newTotalGold-oldTotalGold + notGetGold
+            if not giveGold:
+                continue
+            if lostGold:
+                paramList = [newTotalGold, oldTotalGold, hasGotGold, lostGold, notGetGold, notGetGold, newTotalGold-oldTotalGold]
+            else:
+                paramList = [newTotalGold, oldTotalGold, hasGotGold, notGetGold, notGetGold, newTotalGold-oldTotalGold]
+            PlayerControl.SendMailByKey('MonthCardMail2' if lostGold else 'MonthCardMail1', [curPlayer.GetID()], [], paramList, giveGold)
+        #重置数据
+        valueKey = ChConfig.Def_PDict_GoldInvest_Time % oldInvestType
+        PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
+        
+        valueKey = ChConfig.Def_PDict_GoldInvest_Gold % oldInvestType
+        PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
+        
+        valueKey = ChConfig.Def_PDict_GoldInvest_AwardData % oldInvestType
+        PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
+        for i in xrange(1, maxDay+1):
+            valueKey = ChConfig.Def_PDict_GoldInvest_GotRewardValue % (oldInvestType, i)
+            PlayerControl.NomalDictSetProperty(curPlayer, valueKey, 0, ChConfig.Def_PDictType_GoldInvest)
+    return
+
 
 #// A5 40 投资理财 #tagCMGoldInvest
 #
@@ -219,7 +297,7 @@
         PlayerControl.WorldNotify(0, 'VIPInvestmentRadio', [curPlayer.GetName()])
     elif investType in ChConfig.InvestGoldTypeList:
         PlayerControl.WorldNotify(0, 'JadeInvestmentRadio', [curPlayer.GetName(), investGold])
-    elif investType == ChConfig.GoldInvestType_Month:
+    elif investType == ChConfig.GoldInvestType_NewMonth:
         PlayerControl.WorldNotify(0, 'MonthInvestment', [curPlayer.GetName()])
     elif investType == ChConfig.GoldInvestType_Week:
         PlayerControl.WorldNotify(0, 'WeekInPInvestment', [curPlayer.GetName()])

--
Gitblit v1.8.0