|  |  | 
 |  |  | #  @param curPlayer 玩家
 | 
 |  |  | #  @return
 | 
 |  |  | def OnLogin(curPlayer):
 | 
 |  |  |     __CheckOldInvest(curPlayer)
 | 
 |  |  |     for iType in ChConfig.GoldInvestTypeList:
 | 
 |  |  |         Sync_GoldInvestInfo(curPlayer, iType)
 | 
 |  |  |     return
 | 
 |  |  | 
 |  |  | #  @param curPlayer 玩家
 | 
 |  |  | #  @return
 | 
 |  |  | def OnDay(curPlayer):
 | 
 |  |  |     __CheckOldInvest(curPlayer)
 | 
 |  |  |     #vip投资过了整个周期则重置
 | 
 |  |  |     __CheckInvestReset(curPlayer)
 | 
 |  |  |     
 | 
 |  |  | 
 |  |  |     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
 | 
 |  |  | 
 |  |  |     GameWorld.DebugLog("    领取投资理财回报 rewardItemList=%s" % (rewardItemList))
 | 
 |  |  |     if rewardItemList:
 | 
 |  |  |         for itemID, itemCnt, isBind in rewardItemList:
 | 
 |  |  |             ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere], True, showSysInfo=True)
 | 
 |  |  |             ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere])
 | 
 |  |  |     
 | 
 |  |  |     __CheckInvestReset(curPlayer)
 | 
 |  |  |     # 记录领取事件
 |