From 1d3b44ba8b959cb66322d896efd3a03f6ee03feb Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 10 十二月 2021 14:13:46 +0800
Subject: [PATCH] 9341 【BT5】【主干】【后端】情缘系统(1.删除拉黑伴侣限制提示;2.邮件支持配置物品邮件过天不删除;3.礼物魅力字段改为支持小数;4.合服首登同步魅力榜)
---
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_PlayerItemInfo.py | 68 +++++++++++++++++++---------------
1 files changed, 38 insertions(+), 30 deletions(-)
diff --git a/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_PlayerItemInfo.py b/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_PlayerItemInfo.py
index 4e688d3..5b5a96d 100644
--- a/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_PlayerItemInfo.py
+++ b/ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_PlayerItemInfo.py
@@ -100,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, {})
@@ -131,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
@@ -146,17 +140,31 @@
# @param itemDict: 物品信息字典
# @return curItemInfo:当前物品显示信息
def _GetItemInfo(itemDict):
+# "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'],
-
- 'IsSuite':itemDict['IsSuite'], # 是否套装
- }
+# "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