From 95cf75eaea1a35b062d4a577888d819f338dfce0 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 11 六月 2019 21:46:33 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/SnxxServerCode

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py       |    8 +++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py |   48 ++++++++++++++++--------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                |    5 +-
 3 files changed, 41 insertions(+), 20 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 0101a93..f12cf73 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -5115,10 +5115,11 @@
 GoldInvestType_Gold, # 仙玉投资
 GoldInvestType_Gold2, # 仙玉投资2
 GoldInvestType_Gold3, # 仙玉投资3
-) = range(1,5+1)
+GoldInvestType_Week, # 周卡投资
+) = range(1,6+1)
 
 #可以循环投资的类型
-CanRepeatInvestType = [GoldInvestType_Month, GoldInvestType_VIP]
+CanRepeatInvestType = [GoldInvestType_Week, GoldInvestType_Month, GoldInvestType_VIP]
 #仙玉投资类型
 InvestGoldTypeList = [GoldInvestType_Gold, GoldInvestType_Gold2, GoldInvestType_Gold3]
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
index 83afe91..ebec6cb 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -49,6 +49,7 @@
 import PlayerActTotalRecharge
 import OpenServerCampaign
 import PlayerWeekParty
+import PlayerGoldInvest
 import ItemCommon
 
 import time
@@ -214,7 +215,7 @@
         DataRecordPack.DR_CTGError(curPlayer, "The orderInfo is useless!", addDRDict)
         return
     
-    DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark)
+    DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark, ipyData)
     
     #充值成功主动查询一次,无充值数量就不会继续查询
     if orderID:
@@ -257,7 +258,7 @@
     Sync_CoinToGoldCountInfo(curPlayer, [recordID])
     return addGold, prizeGold, giveItemList, notifyMark
 
-def DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark=''):
+def DoCTGLogic(curPlayer, orderCoin, addGold, prizeGold, giveItemList, isAddBourseMoney, eventName, addDRDict, notifyMark='', ipyData=None):
     goldBefore = curPlayer.GetGold()
     bourseMoneyBefore = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_BourseMoney)
     
@@ -305,6 +306,9 @@
     #开服活动
     OpenServerCampaign.AddOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Recharge, orderCoin)
     PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Recharge, addVIPExp)
+    #投资
+    if ipyData:
+        PlayerGoldInvest.InvestByCTG(curPlayer, ipyData.GetCTGID()) 
     GameWorld.Log("Billing: eventName=%s, %s" % (eventName, addDRDict), curPlayer.GetPlayerID())
     return
 
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 166411e..1945a3b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
@@ -77,19 +77,19 @@
 
 def __CheckInvestReset(curPlayer):
     ##检查vip投资重置 超过28天或28天奖励已领取可重置
-    investType = ChConfig.GoldInvestType_VIP
-    investGoldRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % investType)
-    if not investGoldRecord:
-        return
-    curDay = __GetInvestCurDay(curPlayer, investType)
-    investMaxDayDict = IpyGameDataPY.GetFuncEvalCfg('InvestMaxDay')
-    maxDay = investMaxDayDict.get(str(investType), 0)
-    if curDay > maxDay or __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (investType, maxDay)):
-        __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)
-    Sync_GoldInvestInfo(curPlayer, investType, isForce=True)
+    for investType in ChConfig.CanRepeatInvestType:
+        investGoldRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % investType)
+        if not investGoldRecord:
+            return
+        curDay = __GetInvestCurDay(curPlayer, investType)
+        investMaxDayDict = IpyGameDataPY.GetFuncEvalCfg('InvestMaxDay')
+        maxDay = investMaxDayDict.get(str(investType), 0)
+        if curDay > maxDay or __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_GotRewardValue % (investType, maxDay)):
+            __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)
+        Sync_GoldInvestInfo(curPlayer, investType, isForce=True)
     return
 
 #// A5 40 投资理财 #tagCMGoldInvest
@@ -107,8 +107,6 @@
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
     investType = clientData.InvestType
     investGold = clientData.InvestGold
-    
-    GameWorld.DebugLog("投资理财:investType=%s,investGold=%s" % (investType, investGold))
     investCostDict = IpyGameDataPY.GetFuncEvalCfg('InvestCost')
     if str(investType) not in investCostDict:
         return
@@ -116,10 +114,26 @@
     if investGold not in costList:
         GameWorld.DebugLog('    投资理财 投资额度不存在 investGold=%s, investType=%s'%(investGold, investType))
         return
-    
     awardData = costList.index(investGold) + 1
     if investType == ChConfig.GoldInvestType_VIP:
         awardData = __GetInvestLVData(curPlayer)
+    __DoLogicInvest(curPlayer, investType, investGold, awardData)
+    return
+
+def InvestByCTG(curPlayer, ctgID):
+    ## 充值投资
+    ctgInvestDict = IpyGameDataPY.GetFuncEvalCfg('InvestCost', 3, {})
+    for investType, ctgIDList in ctgInvestDict.items():
+        if ctgID in ctgIDList:
+            __DoLogicInvest(curPlayer, int(investType), ctgID, 1)
+            GameWorld.Log('投资理财 investType=%s,ctgID=%s'%(investType, ctgID), curPlayer.GetID())
+            break
+    return
+
+
+def __DoLogicInvest(curPlayer, investType, investGold, awardData):
+    GameWorld.DebugLog("投资理财:investType=%s,investGold=%s, awardData=%s" % (investType, investGold, awardData))
+    
     needVIPLVDict = IpyGameDataPY.GetFuncEvalCfg('InvestCost', 2, {})
     needVIPLV = needVIPLVDict.get(str(investType), 0)
     if curPlayer.GetVIPLv() < needVIPLV:
@@ -128,6 +142,8 @@
     
         
     deductGold = investGold
+    if str(investType) in IpyGameDataPY.GetFuncEvalCfg('InvestCost', 3, {}):
+        deductGold = 0 #充钱的不用扣仙玉
     investGoldRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_GoldInvest_Gold % investType)
     if investGoldRecord:
         curDay = __GetInvestCurDay(curPlayer, investType)

--
Gitblit v1.8.0