From 623442b524137821ea6abb1b429660a9a107b364 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 31 一月 2019 19:27:01 +0800
Subject: [PATCH] 6118 【后端】【1.5.200】新增技能效果-- 宠物技能-宠物主人受到暴击伤害时触发技能 - 效果填写错误

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py |   54 ++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 46 insertions(+), 8 deletions(-)

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 31d6ff3..4476d93 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):
+    __CheckOldInvest(curPlayer)
     for iType in ChConfig.GoldInvestTypeList:
         Sync_GoldInvestInfo(curPlayer, iType)
     return
@@ -64,6 +65,7 @@
 #  @param curPlayer 玩家
 #  @return
 def OnDay(curPlayer):
+    __CheckOldInvest(curPlayer)
     #vip投资过了整个周期则重置
     __CheckInvestReset(curPlayer)
     
@@ -91,7 +93,43 @@
             __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (investType, i), 0)
     Sync_GoldInvestInfo(curPlayer, investType, isForce=True)
     return
+
+def __CheckOldInvest(curPlayer):
+    #旧版本投资补偿
+    investType = ChConfig.GoldInvestType_VIP
+    investGoldRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % investType)
+    if investGoldRecord != 300:
+        return
+    maxDay = 28
+    curDay = __GetInvestCurDay(curPlayer, investType)
+    if curDay > maxDay:
+        return
+    if __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (investType, curDay)):
+        sendDayList = range(curDay+1,maxDay+1)
+    else:
+        sendDayList = range(curDay, maxDay+1)
+    if sendDayList:
+        sendItemDict = {}
+        for day in sendDayList:
+            index = day%7
+            if index == 0:
+                index = 7
+            ipyData = IpyGameDataPY.GetIpyGameData('Invest', investType*100+index)
+            if not ipyData:
+                continue
+            itemList = ipyData.GetReward()['1']
+            for itemID, itemCnt, isBind in itemList:
+                sendItemDict[itemID] = sendItemDict.get(itemID, 0) + itemCnt
     
+        sendItemList = [(itemID, itemCnt, 1) for itemID, itemCnt in sendItemDict.items()]
+        PlayerControl.SendMailByKey('VIPInvest', [curPlayer.GetID()], sendItemList, [len(sendDayList)])
+        GameWorld.Log('    旧版本投资补偿 sendDay=%s, sendItemList=%s'%(len(sendDayList), sendItemList), curPlayer.GetID())
+        
+    __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Time % investType, 0)
+    __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % investType, 0)
+    for i in xrange(1, maxDay+1):
+        __SetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (investType, i), 0)
+    return
 #// A5 40 投资理财 #tagCMGoldInvest
 #
 #struct    tagCMGoldInvest
@@ -147,7 +185,7 @@
                 
                 
         # 不可循环投资,但可追加投资
-        elif investType in [ChConfig.GoldInvestType_Gold]:
+        elif investType in ChConfig.InvestGoldTypeList:
             if investGoldRecord >= investGold:
                 GameWorld.DebugLog("    已投资档次=%s >= 追加投资档次=%s ,不可追加投资!" 
                                    % (investGoldRecord, investGold))
@@ -158,11 +196,11 @@
         else:
             GameWorld.DebugLog("    investType = %s 已投资过,不可重复投资" % investType)
             return
-    elif investType == ChConfig.GoldInvestType_Gold:
-        goldInvestLVLimit = IpyGameDataPY.GetFuncCfg('GoldInvestLVLimit')
-        if curPlayer.GetLV() > goldInvestLVLimit:
-            GameWorld.DebugLog('    仙玉投资理财 等级不能高于%s'%(goldInvestLVLimit))
-            return
+#    elif investType in ChConfig.InvestGoldTypeList:
+#        goldInvestLVLimit = IpyGameDataPY.GetFuncEvalCfg('GoldInvestLVLimit', 1, {}).get(investType, 0)
+#        if goldInvestLVLimit and curPlayer.GetLV() > goldInvestLVLimit:
+#            GameWorld.DebugLog('    仙玉投资理财 等级不能高于%s'%(goldInvestLVLimit))
+#            return
         
     __DoGoldInvest(curPlayer, investType, investGold, deductGold, awardData)
     return
@@ -200,7 +238,7 @@
             PlayerFamilyRedPacket.CreatRedPacketByID(curPlayer, redPacketID)
     if investType == ChConfig.GoldInvestType_VIP:
         PlayerControl.WorldNotify(0, 'VIPInvestmentRadio', [curPlayer.GetName()])
-    elif investType == ChConfig.GoldInvestType_Gold:
+    elif investType in ChConfig.InvestGoldTypeList:
         PlayerControl.WorldNotify(0, 'JadeInvestmentRadio', [curPlayer.GetName(), investGold])
 
     # 更新投资时时间,投资金额,重置回报记录
@@ -279,7 +317,7 @@
     lastDayGotData = __GetPDictValue(curPlayer, rewardValueKey) # 已领取数据
 
     if lastDayGotData:
-        if investType == ChConfig.GoldInvestType_Gold:
+        if investType in ChConfig.InvestGoldTypeList:
             if awardData > lastDayGotData:
                 lastGotAwardList = rewardDict[str(lastDayGotData)]
                 rewardItemList = []

--
Gitblit v1.8.0