From fa5febca2eaaa55d7d855a4bdefda07da9ef4c27 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 28 四月 2025 11:10:26 +0800 Subject: [PATCH] 10367 【越南】【英语】【BT】【砍树】仙盟攻城战-服务端(C0 28增加同步玩家仙盟ID) --- ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_PlayerItemInfo.py | 96 +++++++++++++++++++++--------------------------- 1 files changed, 42 insertions(+), 54 deletions(-) diff --git a/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_PlayerItemInfo.py b/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_PlayerItemInfo.py index e29c429..5b5a96d 100644 --- a/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_PlayerItemInfo.py +++ b/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_PlayerItemInfo.py @@ -89,6 +89,10 @@ # queryType为accID,发送的信息就是玩家的AccID playerAccID = playerFind + # 返回playerid,判断是否在线 + if data == '%s'%GMCommon.Def_GMKey_PlayerName: + return GMCommon.Def_DoQueryLogDB, playerAccID + collection = userdb[UCN_DBPlayer] dbPlayer = DataServerPlayerData.tagDBPlayer() dbPlayer.IsDeleted = 0 @@ -96,29 +100,23 @@ loadOK = dbPlayer.adoLoadCEx(collection, {'AccID':fix_incomingText(playerAccID), 'IsDeleted':dbPlayer.IsDeleted}) # 加入人物信息 - resultMsg = {} - if loadOK: - resultMsg = { - 'LogoffTime':dbPlayer.LogoffTime, #离线时间 - 'LoginTime':dbPlayer.LoginTime, # 上线时间 - 'OnlineTime':dbPlayer.OnlineTime, # 累计上线时间 - 'LoginIP':dbPlayer.LoginIP, #登入IP - } - else: - return GMCommon.Def_NoTag, '' + if not loadOK: + return GMCommon.Def_NoTag, "" # 获得玩家物品 itemCollection = userdb[UCN_RoleItem] itemFind = itemCollection.find({'PlayerID':dbPlayer.PlayerID}) + itemList = [] # 无物品 if itemFind.count() <= 0: - return GMCommon.Def_Success, resultMsg + return GMCommon.Def_Success, itemList - itemList = [] itemInfo = itemFind[0] packIndex = GMCommon.ToIntDef(gmCmdDict.get(GMCommon.Def_GMKey_PackIndex, '')) - + if packIndex == ShowAllPack: + # 暂不提供查询所有的物品 + return GMCommon.Def_ParamErr, "Not allowed to query all package items." # 遍历所有物品 for itemIndex in range(1, itemInfo['Count'] + 1): itemDict = itemInfo.get('%s'%itemIndex, {}) @@ -127,13 +125,13 @@ continue itemList.append(_GetItemInfo(itemDict)) - - resultMsg['ItemList'] = itemList - - # 不大与word - if len(resultMsg) > pow(2, 14): - return GMCommon.Def_MaxLimit, '' + totalItemCount = len(itemList) + resultMsg = {"PackIndex":packIndex, "TotalItemCount":totalItemCount, "ItemList":itemList} + # 不大与word + if len(str(resultMsg)) > 65000: + return GMCommon.Def_MaxLimit, '' + # 回复查询信息 return GMCommon.Def_Success, resultMsg @@ -142,41 +140,31 @@ # @param itemDict: 物品信息字典 # @return curItemInfo:当前物品显示信息 def _GetItemInfo(itemDict): - - stoneList = [] - hourCnt = itemDict['CanPlaceStoneCount'] - for hourIndex in range(1, hourCnt + 1): - stoneList.append(itemDict['Stone%d'%hourIndex]) +# "ItemGUID" : "096389AD-904F-4DAA-B7ED155B8663CE45", +# "ItemTypeID" : NumberLong(3901), +# "Count" : 100, +# "IsBind" : 0, +# "UserData" : "{}", +# "IsSuite" : 0, +# "RemainHour" : 0, +# "GearScore" : NumberLong(0), +# "CreateTime" : "2019-10-16 20:12:17" - itemData = eval(itemDict['UserData']) - curItemInfo = { - 'PackType':itemDict['ItemPlaceType'], # 背包类型 - 'ItemIndex':itemDict['ItemPlaceIndex'], # 索引 - 'GUID':itemDict['ItemGUID'], # guid - 'IsBand':itemDict['IsBind'], # 是否绑定 - 'ItemCnt':itemDict['Count'], # 数量 - 'ItemID':itemDict['ItemTypeID'], - - 'StarLV':itemDict['ItemStarLV'], # 星级 - 'Endure':itemDict['CurDurg'], # 当前耐久 - 'MaxEndure':itemDict['MaxDurg'], # 最大耐久 - 'IsSuite':itemDict['IsSuite'], # 是否套装 - 'HoleCnt':hourCnt, # 孔数 - 'StoneList':stoneList, # 宝石id列表 - - 'SkillCnt':itemData.get(IudetEquipAddSkillCnt, 0), #灵纹数 - 'MaxSkillCnt':itemDict['MaxAddSkillCnt'], # 最大灵纹数 - 'SkillList':itemData.get(IudetEquipAddSkillList, []), # 技能id列表 - - 'FitLV':itemDict['FitLV'], # 契合等级 - 'Proficiency':itemDict['Proficiency'], # 熟练度 - - 'MinAtk':itemDict['EquipMinAtkValue'], # 最小伤害值 - 'MaxAtk':itemDict['EquipMaxAtkValue'], # 最大伤害值 - 'Defense':itemDict['BaseMagicDef'], # 防御值 - 'BaseHP':itemDict['BaseHP'], # 气血值 - 'MagicDef':itemDict['EquipMagicDefValue'], # 内防值 - 'isWakeUp':itemData.get(IudetWakeUpCnt, 0), # 是否唤醒 - } +# "ItemPlaceIndex" : 1, +# "PlayerID" : NumberLong(268902), +# "ItemPlaceType" : 2, +# "UserDataLen" : NumberLong(2), +# "IsLocked" : 0, +# "SID" : -1135840175, +# "VerNO" : NumberLong(1), + + curItemInfo = {} + for k, v in itemDict.items(): + if k in ["UserDataLen", "ItemPlaceType", "PlayerID", "IsLocked", "SID", "VerNO"]: + continue + if not v or v == "{}": + continue + curItemInfo[k] = v + return curItemInfo \ No newline at end of file -- Gitblit v1.8.0