From fdebf36f0d9201c6a6949a08cdfeebb718c25ce2 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 23 五月 2025 19:35:53 +0800 Subject: [PATCH] 16 卡牌服务端(聊天、广播、通用记录、查看玩家;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py index 9ef6384..b7b2bfe 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DB/StructData/DBFamily.py +++ b/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()) -- Gitblit v1.8.0