From 9a33274e49d1c162a506ac1f62d4f793b74af140 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 27 五月 2024 12:03:27 +0800 Subject: [PATCH] 10162 后台优化(砍树 查询玩家增加 仙桃、灵玉显示) --- ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py | 48 +++++++++++++++++++++++++++++------------------- 1 files changed, 29 insertions(+), 19 deletions(-) diff --git a/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py b/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py index 9fb2db9..19cf306 100644 --- a/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py +++ b/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerInfo.py @@ -101,6 +101,24 @@ # 回复gm return GMCommon.Def_NoTag, '' + roleDict = {} + moneyMinusDict = {} + collection = userdb[UCN_RoleNomalDict] + docs = collection.find({'PlayerID':dbPlayer.PlayerID}) + if docs.count(): + obj = DataServerPlayerData.tagRoleNomalDict() + doc = list(docs)[0] + #有数据 + if doc.has_key('__PackSave'): + for i in xrange(doc['Count']): + obj.readRecord(doc['%s'%(i+1)]) + if obj.DictName.startswith("MoneyMinus_") and obj.DictValue > 0: + moneyMinusDict[int(obj.DictName[len("MoneyMinus_"):])] = -obj.DictValue # 货币负值 + if 1 in moneyMinusDict and 2 in moneyMinusDict and 4 in moneyMinusDict: + break + if obj.DictValue > 0: + roleDict[obj.DictName] = obj.DictValue + playerInfo = { 'AccID':dbPlayer.AccID, # 账号 'AccState':dbPlayer.AccState, # 账号状态 @@ -109,39 +127,31 @@ 'GMLV':dbPlayer.GMLevel, #gm等级 'Job':dbPlayer.Job, # 职业 - 'Sex':dbPlayer.Sex, # 性别 'LV':dbPlayer.LV, #玩家等级 - 'LVEx':dbPlayer.LVEx, #转生等级 - 'LV2':dbPlayer.LV2, #大师等级 - 'ReincarnationLv':dbPlayer.ReincarnationLv, #转生次数 - 'FightPower':dbPlayer.FightPower, #战斗力 + 'OfficialRank':dbPlayer.OfficialRank, #境界 + 'FightPower':dbPlayer.FightPowerEx * 100000000 + dbPlayer.FightPower, #战斗力 'VIPLV':dbPlayer.VIPLv, # vip等级 - 'TotalExp':dbPlayer.TotalExp, # 总经验值 'MapID':dbPlayer.MapID, #当前地图id - 'PosX':dbPlayer.PosX, # 当前坐标 - 'PosY':dbPlayer.PosY, - 'Gold':dbPlayer.Gold, # 元宝 - 'GoldPaper':dbPlayer.GoldPaper, # 绑钻 + 'Gold':moneyMinusDict[1] if 1 in moneyMinusDict else dbPlayer.Gold, # 元宝 + 'GoldPaper':moneyMinusDict[2] if 2 in moneyMinusDict else dbPlayer.GoldPaper, # 绑钻 'Silver':dbPlayer.Silver, # 银两 + 'SilverPaper':moneyMinusDict[4] if 4 in moneyMinusDict else dbPlayer.SilverPaper, # 神玉 - 'ZhenQi':dbPlayer.ExAttr5, # 真气 'FamilyName':dbPlayer.FamilyName, # 家族名称 - 'STR':dbPlayer.STR, #力量 - 'PNE':dbPlayer.PNE, #真元 - 'PHY':dbPlayer.PHY, #筋骨 - 'CON':dbPlayer.CON, #体魄 - 'FreePoint':dbPlayer.FreePoint, # 剩余点数 - 'LogoffTime':dbPlayer.LogoffTime, #离线时间 'LoginTime':dbPlayer.LoginTime, # 上线时间 - 'OnlineTime':dbPlayer.OnlineTime, # 累计上线时间 'LoginIP':dbPlayer.LoginIP, #登入IP - 'WarehousePsw':dbPlayer.WarehousePsw, #仓库密码 + 'Online':0, } + # 需要额外同步的自定义货币 + CurrencyValueDict = {} + for moneyType in [99, 41, 42]: + CurrencyValueDict['PlayerCurrency_%s' % moneyType] = roleDict.get("PlayerCurrency_%s" % moneyType, 0) + playerInfo.update(CurrencyValueDict) return GMCommon.Def_Success, playerInfo -- Gitblit v1.8.0