hxp
2025-05-23 fdebf36f0d9201c6a6949a08cdfeebb718c25ce2
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py
@@ -20,6 +20,7 @@
import GameWorld
import ShareDefine
import PlayerControl
import PlayerViewCache
import PyMongoMain
import DBDataMgr
import ChConfig
@@ -82,12 +83,15 @@
        self.__actionDataList.append(actionData)
        return actionData
    
    def AddAction(self, fullClear=True):
    def AddAction(self, maxCount=None):
        ## 添加仙盟Action数据
        # @param fullClear: 数据条数超过最大数时是否清除最早一条,并创建一条新记录
        # @param maxCount: 可传入由配置决定的最大条数,如果为None则进一步取程序默认设定的最大条数,都没配置的话默认不限条数
        
        fullClear = True
        if maxCount == None:
            maxCount = ShareDefine.ActionTypeSaveCnt.get(self.actionType, 0)
        actionData = None
        if self.Count() >= ChConfig.ActionTypeSaveCnt.get(self.actionType, 0):
        if maxCount and self.Count() >= maxCount:
            if not fullClear:
                #超过记录记录不了了
                return actionData
@@ -207,7 +211,7 @@
        ## 根据玩家ID更新成员数据,一般用于离线功能,如添加离线成员,直接使用查看缓存更新
        if playerID != self.GetPlayerID():
            return
        viewCache = DBDataMgr.GetPlayerViewCacheMgr().FindViewCache(playerID)
        viewCache = PlayerViewCache.FindViewCache(playerID)
        if not viewCache:
            return
        self.SetPlayerName(viewCache.GetPlayerName())