1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package Player.PlayerGoldInvest
#
# @todo:Ͷ×Ê
# @author hxp
# @date 2020-09-10
# @version 1.0
#
# ÏêϸÃèÊö: Í¶×Ê
#
#-------------------------------------------------------------------------------
#"""Version = 2020-09-10 11:00"""
#-------------------------------------------------------------------------------
 
import GameWorld
import IpyGameDataPY
import NetPackCommon
import DataRecordPack
import ChPyNetSendPack
import PlayerFamilyRedPacket
import ItemControler
import PlayerControl
import IPY_GameWorld
import ChConfig
 
import time
 
def __TransferPlayerInvestDBKey(curPlayer):
    ## ×ª»»Íæ¼Ò´æ´¢×ֵ䣬»»keyÃû
    
    # ¾É°ækey
    # Í¶×ÊÀí²Æ Def_PDictType_GoldInvest
    Def_PDict_GoldInvest_Time = "Invest_Time_%s"  # Í¶×ÊʱµÄʱ¼ä£¬²ÎÊýΪͶ×ÊÀàÐÍ
    #Def_PDict_GoldInvest_Gold = "Invest_Gold_%s"  # Í¶×ʵĶî¶È£¬²ÎÊýΪͶ×ÊÀàÐÍ                                             ±ê¼ÇÊÇ·ñÒÑͶ×Ê£¬¿ÉÓÃͶ×Êʱ¼ä¼´¿É£¬²»´¦Àí
    #Def_PDict_GoldInvest_AwardData = "Invest_AwardData_%s"  # Í¶×ÊʱµÄÊý¾Ý£¬²ÎÊýΪͶ×ÊÀàÐÍ                                 Ä¬ÈÏ1£¬ÎÞÓ㬿ɲ»¹Ü
    Def_PDict_GoldInvest_GotRewardValue = "Invest_GotRewardValue_%s_%s"  # µÈ¼¶»Ø±¨ÒÑÁìÈ¡ÊýÖµ£¬²ÎÊýΪͶ×ÊÀàÐÍ Ë÷Òý
    
    playerID = curPlayer.GetPlayerID()
    for investType in [ChConfig.InvestType_NewMonth, ChConfig.InvestType_Month1]:
        investTimeKeyOld = Def_PDict_GoldInvest_Time % investType
        investTime = curPlayer.NomalDictGetProperty(investTimeKeyOld, 0, ChConfig.Def_PDictType_GoldInvest)
        if not investTime:
            continue
        
        investTimeKeyNew = ChConfig.Def_PDict_InvestTime % investType
        PlayerControl.NomalDictSetProperty(curPlayer, investTimeKeyNew, investTime)
        PlayerControl.NomalDictSetProperty(curPlayer, investTimeKeyOld, 0, ChConfig.Def_PDictType_GoldInvest)
        GameWorld.Log("ת»»Í¶×Êkey: investType=%s,investTimeKeyNew=%s,investTime=%s,investTimeKeyOld=%s" 
                      % (investType, investTimeKeyNew, investTime, investTimeKeyOld), playerID)
        
        maxDay = __GetInvestMaxDays(investType)
        for i in xrange(1, maxDay + 1):
            rewardKeyOld = Def_PDict_GoldInvest_GotRewardValue % (investType, i)
            reward = curPlayer.NomalDictGetProperty(rewardKeyOld, 0, ChConfig.Def_PDictType_GoldInvest)
            if not reward:
                continue
            
            GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_InvestReward, i, 1, True, [investType])
            PlayerControl.NomalDictSetProperty(curPlayer, rewardKeyOld, 0, ChConfig.Def_PDictType_GoldInvest)
            GameWorld.Log("    ×ª»»Í¶×ÊÒÑÁìÈ¡¼Ç¼: i=%s,rewardKeyOld=%s" % (i, rewardKeyOld), playerID)
            
    return
 
## µÇ¼
def OnLogin(curPlayer):
    __TransferPlayerInvestDBKey(curPlayer)
    for investType in ChConfig.InvestTypeList:
        if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_InvestTime % investType):
            continue
        Sync_InvestInfo(curPlayer, investType)
    return
 
## ¹ýÌì
def OnDay(curPlayer):
    for investType in ChConfig.InvestTypeList:
        if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_InvestTime % investType):
            continue
        
        # µÇ¼¿¨
        if investType == ChConfig.InvestType_Login:
            progressValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_InvestProgress % (investType, 0))
            maxDays = __GetInvestMaxDays(investType)
            if maxDays and progressValue < maxDays:
                progressValue += 1
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestProgress % (investType, 0), progressValue)
                GameWorld.DebugLog("¸üеǼͶ×Ê¿ÉÁì½±ÌìÊý½ø¶È: %s" % progressValue)
                
        # ÖÕÉí¿¨
        elif investType == ChConfig.InvestType_Life:
            __GiveUnGetPerDayReward(curPlayer, investType)
            for keyNum in range(ChConfig.Def_PDict_InvestKeyCount):
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestReward % (investType, keyNum), 0)
                
        Sync_InvestInfo(curPlayer, investType)
    return
 
def __GiveUnGetPerDayReward(curPlayer, investType):
    ## ²¹·¢Î´ÁìÈ¡µÄÿÈÕ½±Àø£¬Ò»°ãÓÃÓڠÿÈÕ¿ÉÁìÈ¡µÄ¹Ì¶¨½±Àø£¬ÈçÓÀ¾Ã¿¨µÈ
    playerID = curPlayer.GetPlayerID()
    curTime = int(time.time())
    lastRewardTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_InvestRewardTime % investType)
    if not lastRewardTime:
        passDays = __GetInvestPassDays(curPlayer, investType)
        #GameWorld.DebugLog("²¹·¢½±Àøʱ£¬¾àÀ뿪ͨͶ×ÊÒѹýÌìÊý: %s" % passDays, playerID)
    else:
        passDays = GameWorld.GetDiff_Day(curTime, lastRewardTime)
        #GameWorld.DebugLog("²¹·¢½±Àøʱ£¬¾àÀëÉÏ´ÎÁì½±ÒѹýÌìÊý: %s" % passDays, playerID)
        
    rewardDays = passDays - 1 # # ÐèÒª²¹·¢µÄ½±ÀøÌìÊý£¬Ö»²¹µ½×òÌ죬²»Ëãµ±Ìì
    if rewardDays <= 0:
        GameWorld.DebugLog("²»Óò¹·¢Í¶×Ê¿¨Ã¿ÈÕ½±Àø: investType=%s,rewardDays=%s" % (investType, rewardDays), playerID)
        return
    updRewardTime = curTime - 3600 * 24 # ×îºóÒ»´ÎÁ콱ǿÖÆÉèÖõ½×òÌì
    
    rewardIndex = 0 # Ã¿ÈÕ½±ÀøĬÈÏ0Ë÷Òý
    ipyData = IpyGameDataPY.GetIpyGameData("Invest", investType * 100 + rewardIndex)
    if not ipyData:
        return
    rewardInfo = ipyData.GetReward()
    
    rewardKey = "1" # Ä¬ÈÏ1
    rewardItemList = rewardInfo.get(str(rewardKey), [])
    if not rewardItemList:
        return
    
    mailItemList = []
    for itemID, itemCount, isAuctionItem in rewardItemList:
        mailItemList.append([itemID, itemCount * rewardDays, isAuctionItem])
            
    GameWorld.DebugLog("Óʼþ²¹·¢Í¶×Ê¿¨Ã¿ÈÕ½±Àø! investType=%s, rewardDays=%s, updRewardTime=%s, mailItemList=%s" 
                       % (investType, rewardDays, updRewardTime, mailItemList), playerID)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestRewardTime % investType, updRewardTime)
    PlayerControl.SendMailByKey("InvestDayReward_%s" % investType, [playerID], mailItemList, [rewardDays])
    return
 
def __GetInvestPassDays(curPlayer, investType):
    ## »ñȡͶ×ÊÒѹýÌìÊý£¬Í¶×ʵ±ÌìΪµÚÒ»Ì죬¼´´Ó 1 ¿ªÊ¼£» 0´ú±íδͶ×Ê
    investTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_InvestTime % investType)
    if not investTime:
        return 0
    curTime = int(time.time())
    return max(0, GameWorld.GetDiff_Day(curTime, investTime) + 1)
 
def __GetInvestMaxDays(investType):
    ## »ñȡͶ×Ê×î´óÌìÊý£¬0ΪÓÀ¾Ã
    investMaxDayDict = IpyGameDataPY.GetFuncEvalCfg("InvestMaxDay", 1, {})
    return investMaxDayDict.get(str(investType), 0)
 
def GetInvestState(curPlayer, investType):
    ## »ñȡͶ×Ê¿¨×´Ì¬ 0-δͶ×Ê£»1-ÒÑͶ×Ê£»
    investTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_InvestTime % investType)
    if not investTime:
        return 0
    return 1
 
#// A5 40 Í¶×ÊÀí²Æ #tagCMGoldInvest
#
#struct    tagCMGoldInvest
#{
#    tagHead        Head;
#    BYTE        InvestType; // Í¶×ÊÀàÐÍ
#    DWORD        InvestGold; // Í¶×ʶî¶È
#};
def OnGoldInvest(index, clientData, tick):
    ## ÏûºÄÏÉÓñͶ×ʵģ¬ÔÝ·ÏÆú
    return
 
## ³äÖµÖ±¹ºÍ¶×Ê
def InvestByCTG(curPlayer, ctgID):
    ctgInvestDict = IpyGameDataPY.GetFuncEvalCfg("InvestCost", 3, {})
    for investType, ctgIDList in ctgInvestDict.items():
        if ctgID in ctgIDList:
            __DoLogicInvest(curPlayer, int(investType))
            break
    return
 
## Ö´ÐÐͶ×ÊÂß¼­
def __DoLogicInvest(curPlayer, investType):
    if GetInvestState(curPlayer, investType) == 1:
        GameWorld.DebugLog("ÒÑͶ×Ê£¬ÎÞ·¨Öظ´Í¶×Ê! investType=%s" % investType)
        return
    
    # ¿ÉͶ×Ê£¬¸üÐÂÖØÖÃͶ×ÊÏà¹ØÊý¾Ý
    curTime = int(time.time())
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestTime % investType, curTime)
    for keyNum in range(ChConfig.Def_PDict_InvestKeyCount):
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestReward % (investType, keyNum), 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestProgress % (investType, keyNum), 0)
    
    # µÇ¼¿¨£¬Í¶×ʵ±Ìì¿ÉÁì½±£¬Íê³ÉÉèÖÃΪ1
    if investType == ChConfig.InvestType_Login:
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestProgress % (investType, 0), 1)
        
    # Í¶×ʺì°ü
    redPacketID = IpyGameDataPY.GetFuncEvalCfg("InvestRedPackAward", 1, {}).get(investType, 0)
    if redPacketID:
        PlayerFamilyRedPacket.CreatRedPacketByID(curPlayer, redPacketID)
        
    # ¹ã²¥
    PlayerControl.WorldNotify(0, "BuyInvest_%s" % investType, [curPlayer.GetName(), __GetTotalGetGold(investType)])
    
    GameWorld.DebugLog("Ͷ×ÊÀí²Æ³É¹¦: investType=%s" % (investType))
    Sync_InvestInfo(curPlayer, investType)
    return
 
def __GetTotalGetGold(investType):
    ## »ñȡͶ×ÊÔ¤¼Æ×ÜÊÕÒæÏÉÓñ¡¢Áéʯ
    totalGold = 0
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for index in xrange(ipyDataMgr.GetInvestCount()):
        ipyData = ipyDataMgr.GetInvestByIndex(index)
        if ipyData.GetType() != investType:
            continue
        rewardDict = ipyData.GetReward()
        for rewardInfo in rewardDict.values():
            for itemID, itemCount, _ in rewardInfo:
                if itemID in [20, 30]: # µ¥Î»1µÄÏÉÓñ¡¢Áéʯ
                    totalGold += itemCount
    return totalGold
 
def GetAddBossCnt(curPlayer, bossFuncIndex):
    ## »ñÈ¡Ôö¼ÓµÄboss´ÎÊýÉÏÏÞ
    addBossCnt = 0
    if GetInvestState(curPlayer, ChConfig.InvestType_Life):
        lifeCardAddBossCntDict = IpyGameDataPY.GetFuncEvalCfg("InvestPower", 1, {})
        lifeCardAddCnt = lifeCardAddBossCntDict.get(str(bossFuncIndex), 0)
        addBossCnt += lifeCardAddCnt
    return addBossCnt
 
def GetAddFBCnt(curPlayer, mapID):
    ## »ñÈ¡Ôö¼ÓµÄ¸±±¾´ÎÊýÉÏÏÞ
    addFBCnt = 0
    if GetInvestState(curPlayer, ChConfig.InvestType_Life):
        lifeCardAddFBCntDict = IpyGameDataPY.GetFuncEvalCfg("InvestPower", 2, {})
        lifeCardAddCnt = lifeCardAddFBCntDict.get(str(mapID), 0)
        addFBCnt += lifeCardAddCnt
    return addFBCnt
 
def CanQuickFinishMissionFree(curPlayer):
    ## ¿É·ñÃâ·Ñ¿ìËÙÍê³ÉÈÎÎñ
    for investType in IpyGameDataPY.GetFuncEvalCfg("InvestPower", 3):
        if GetInvestState(curPlayer, investType):
            return True
    return False
 
def OnKillBoss(curPlayer, npcID):
    ## ²ÎÓë»÷ɱboss
    if GetInvestState(curPlayer, ChConfig.InvestType_Boss) != 1:
        #GameWorld.DebugLog("bossͶ×ÊδͶ×Ê!")
        return
    key = "BossInvestNPCIDDict"
    BossInvestNPCIDDict = IpyGameDataPY.GetConfigEx(key)
    if not BossInvestNPCIDDict:
        BossInvestNPCIDDict = {}
        ipyDataMgr = IpyGameDataPY.IPY_Data()
        for index in xrange(ipyDataMgr.GetInvestCount()):
            ipyData = ipyDataMgr.GetInvestByIndex(index)
            if ipyData.GetType() != ChConfig.InvestType_Boss:
                continue
            if not ipyData.GetNeedNPCID():
                continue
            BossInvestNPCIDDict[ipyData.GetNeedNPCID()] = ipyData.GetID()
        IpyGameDataPY.SetConfigEx(key, BossInvestNPCIDDict)
        GameWorld.Log("»º´æbossͶ×ʶÔÓ¦¹Øϵ: %s" % BossInvestNPCIDDict)
        
    if npcID not in BossInvestNPCIDDict:
        #GameWorld.DebugLog("    ¸ÃbossûÓÐͶ×ʽ±Àø!")
        return
    investID = BossInvestNPCIDDict[npcID]
    investType, rewardIndex = investID / 100, investID % 100
    if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_InvestProgress, rewardIndex, True, [investType]):
        #GameWorld.DebugLog("ÒÑÉèÖû÷ɱ¹ý¸ÃͶ×Êboss: npcID=%s,rewardIndex=%s,progressValue=%s" % (npcID, rewardIndex, progressValue))
        return
    progressValue, updProgressValue = GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_InvestProgress, rewardIndex, 1, True, [investType])
    Sync_InvestInfo(curPlayer, investType)
    GameWorld.DebugLog("ÉèÖÃɱ¹ýͶ×Êboss: npcID=%s,rewardIndex=%s,progressValue=%s,updProgressValue=%s" 
                       % (npcID, rewardIndex, progressValue, updProgressValue))
    return
 
#// A5 41 ÁìȡͶ×ÊÀí²Æ»Ø±¨ #tagCMGetInvestReward
#
#struct    tagCMGetInvestReward
#{
#    tagHead        Head;
#    BYTE        InvestType; // Í¶×ÊÀàÐÍ
#    BYTE        RewardIndex; // »Ø±¨Ë÷Òý
#};
def OnGetInvestReward(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    investType = clientData.InvestType
    rewardIndex = clientData.RewardIndex
    GameWorld.DebugLog("ÁìȡͶ×ÊÀí²Æ»Ø±¨£ºinvestType=%s,rewardIndex=%s" % (investType, rewardIndex))
    
    if investType not in ChConfig.InvestTypeList:
        #GameWorld.DebugLog("²»´æÔÚ¸ÃͶ×ÊÀàÐÍ!")
        return
    
    if GetInvestState(curPlayer, investType) != 1:
        GameWorld.DebugLog("    Î´Í¶×Ê»òÒѹýÆÚ£¬ÎÞ·¨Áì½±!")
        return
    
    ipyData = IpyGameDataPY.GetIpyGameData("Invest", investType * 100 + rewardIndex)
    if not ipyData:
        return
    
    needLV = ipyData.GetNeedLV()
    if needLV and curPlayer.GetLV() < needLV:
        GameWorld.DebugLog("    µÈ¼¶²»×㣬ÎÞ·¨Áì½±! needLV=%s" % needLV)
        return
    
    if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_InvestReward, rewardIndex, True, [investType]):
        GameWorld.DebugLog("    ÒÑÁìÈ¡¹ý¸ÃË÷Òý½±Àø! rewardIndex=%s" % rewardIndex)
        return
    
    needDay = ipyData.GetNeedDay()
    rewardInfo = ipyData.GetReward()
    
    indexProgressState = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_InvestProgress, rewardIndex, True, [investType])
    
    # Ô¿¨
    if investType in [ChConfig.InvestType_NewMonth, ChConfig.InvestType_Month1]:
        passDays = __GetInvestPassDays(curPlayer, investType) # °´Í¶×Êʱ¼ä¼ÆËãÌì
        if needDay > passDays:
            GameWorld.DebugLog("    Í¶×ÊÌìÊý²»×㣬ÎÞ·¨ÁìÈ¡! needDay=%s > passDays=%s" % (ipyData.GetNeedDay(), passDays))
            return
        
    # µÇ¼
    elif investType == ChConfig.InvestType_Login:
        loginDays = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_InvestProgress % (investType, 0)) # °´µÇ¼Ìì¼ÆËãÌ죬ÓеǼ²ÅËã
        if needDay > loginDays:
            GameWorld.DebugLog("    µÇ¼Ͷ×ÊÌìÊý²»×㣬ÎÞ·¨ÁìÈ¡! needDay=%s > loginDays=%s" % (needDay, loginDays))
            return
        
    # µÈ¼¶
    elif investType == ChConfig.InvestType_LV:
        # ¹«¹²µÈ¼¶Ìõ¼þÒÑÅжÏ
        pass
        
    # Boss
    elif investType == ChConfig.InvestType_Boss:
        if not indexProgressState:
            GameWorld.DebugLog("    BossͶ×ÊÎÞ²ÎÓë»÷ɱ¸Ãboss£¬ÎÞ·¨ÁìÈ¡! rewardIndex=%s" % (rewardIndex))
            return
        
    # ÖÕÉí¿¨
    elif investType == ChConfig.InvestType_Life:
        pass
    
    else:
        return
    
    if not ipyData:
        return
        
    rewardKey = "1" # Ä¬ÈÏ1
    rewardItemList = rewardInfo.get(str(rewardKey), [])
    if not rewardItemList:
        return
    
    if not ItemControler.CheckPackSpaceEnough(curPlayer, rewardItemList):
        return
    
    rewardValue, updRewardValue = GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_PDict_InvestReward, rewardIndex, 1, True, [investType])
    Sync_InvestInfo(curPlayer, investType)
    GameWorld.DebugLog("    rewardValue=%s,updRewardValue=%s,rewardItemList=%s" % (rewardValue, updRewardValue, rewardItemList))
    
    # ¼Ç¼×îºóÒ»´ÎÁ콱ʱ¼ä
    if investType == ChConfig.InvestType_Life:
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestRewardTime % (investType), int(time.time()))
        
    for itemID, itemCount, isAuctionItem in rewardItemList:
        ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isAuctionItem, [IPY_GameWorld.rptItem],
                                     event=["Invest", False, {}])
        
    # ¼Ç¼Áìȡʼþ
    DataRecordPack.DR_GetGoldInvestReward(curPlayer, investType, rewardIndex, rewardItemList)
    
    # ÁìÍêÁË£¬ÖØÖÿÉÖظ´¹ºÂòµÄ·ÇÓÀ¾Ã¿¨
    maxDays = __GetInvestMaxDays(investType)
    canRepetBuyTypeList = IpyGameDataPY.GetFuncEvalCfg("InvestMaxDay", 2)
    if maxDays > 1 and investType in canRepetBuyTypeList:
        isAllDayGet = True
        for i in range(maxDays, -1, -1):
            if not IpyGameDataPY.GetIpyGameDataNotLog("Invest", investType * 100 + i):
                continue
            if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_InvestReward, i, True, [investType]):
                isAllDayGet = False
                #GameWorld.DebugLog("    »¹ÓÐδÁìÈ¡: i=%s,isAllDayGet=%s" % (i, isAllDayGet))
                break
            
        if isAllDayGet:
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestTime % investType, 0)
            for keyNum in range(ChConfig.Def_PDict_InvestKeyCount):
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestReward % (investType, keyNum), 0)
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestProgress % (investType, keyNum), 0)
            Sync_InvestInfo(curPlayer, investType)
            GameWorld.DebugLog("    ÁìÍê½±ÀøÁË£¬ÖØÖÃͶ×Ê! investType=%s" % investType)
            
    return
 
## Í¬²½Í¶×ÊÀí²ÆÐÅÏ¢
def Sync_InvestInfo(curPlayer, investType):
    investInfoPack = ChPyNetSendPack.tagMCInvestInfo()
    investInfoPack.InvestType = investType
    investInfoPack.CurDay = __GetInvestPassDays(curPlayer, investType)
    for keyNum in range(ChConfig.Def_PDict_InvestKeyCount):
        investInfoPack.RewardValue.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_InvestReward % (investType, keyNum)))
        investInfoPack.ProgressValue.append(curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_InvestProgress % (investType, keyNum)))
    investInfoPack.ValueCount = len(investInfoPack.RewardValue)
    NetPackCommon.SendFakePack(curPlayer, investInfoPack)
    return