10389 【越南】【英语】【BT】【砍树】魅力值来源是别人的有每日额度限制
1个文件已修改
24 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCharm.py 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerCharm.py
@@ -17,6 +17,7 @@
import CommFunc
import ShareDefine
import IpyGameDataPY
import PlayerControl
import ChPyNetSendPack
import PyGameDataStruct
@@ -175,6 +176,29 @@
        charmValueRecMgr.charmValueRecDict[playerID] = {}
    recTypeDataDict = charmValueRecMgr.charmValueRecDict[playerID]
    
    dayCharmMax = IpyGameDataPY.GetFuncCfg("CharmCfg", 1)
    couple = PyDataManager.GetDBPyCoupleManager().GetCouple(playerID)
    coupleID = couple.GetCoupleID(playerID) if couple else 0
    if dayCharmMax and offerPlayerID not in [playerID, coupleID]:
        if CharmValueRecType_Day not in recTypeDataDict:
            recTypeDataDict[CharmValueRecType_Day] = {}
        dayOfferPlayerDict = recTypeDataDict[CharmValueRecType_Day]
        dayFromOtherTotal = 0 # 今日非伴侣来源魅力
        dayFromOtherList = []
        for oID, recData in dayOfferPlayerDict.items():
            if oID not in [playerID, coupleID]:
                dayFromOtherTotal += recData.CharmValue
                dayFromOtherList.append([oID, recData.CharmValue, dayFromOtherTotal])
        if dayFromOtherTotal >= dayCharmMax:
            GameWorld.Log("今日非自己或伴侣赠送获得魅力值已达上限! dayFromOtherTotal=%s >= %s, %s"
                          % (dayFromOtherTotal, dayCharmMax, dayFromOtherList), playerID)
            return
        canAddToday = dayCharmMax - dayFromOtherTotal
        GameWorld.DebugLog("addValue=%s,canAddToday=%s,dayCharmMax=%s,dayFromOtherTotal=%s,%s"
                           % (addValue, canAddToday, dayCharmMax, dayFromOtherTotal, dayFromOtherList), playerID)
        addValue = min(canAddToday, addValue)
        GameWorld.DebugLog("实际增加: addValue=%s" % (addValue), playerID)
    if playerID not in charmValueRecMgr.charmTotalDict:
        charmValueRecMgr.charmTotalDict[playerID] = {}
    recTypeValueDict = charmValueRecMgr.charmTotalDict[playerID]