| | |
| | | # @change: "2012-06-29 21:30" wdb 返回信息是否过长
|
| | | # @change: "2015-12-29 11:00" hxp 开放其他背包查询
|
| | | #---------------------------------------------------------------------
|
| | | """Version = 2015-12-29 11:00"""
|
| | | #"""Version = 2015-12-29 11:00"""
|
| | | #---------------------------------------------------------------------
|
| | | import IPY_GameWorld
|
| | | import GameWorld
|
| | | import ItemCommon
|
| | | import ShareDefine
|
| | | import GMCommon
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | # 显示说有背包类型
|
| | |
| | | packIndex = packCMDList[1]
|
| | | itemList = []
|
| | |
|
| | | # # 查看的背包类型
|
| | | # packTypes = (
|
| | | # IPY_GameWorld.rptEquip, #1 装备
|
| | | # IPY_GameWorld.rptItem, #2 物品
|
| | | # IPY_GameWorld.rptRecycle, #3 垃圾桶(回收站)
|
| | | # IPY_GameWorld.rptWarehouse, #5 仓库
|
| | | # IPY_GameWorld.rptTitle, #6 称号背包
|
| | | # IPY_GameWorld.rptHorse, #12 坐骑背包
|
| | | # IPY_GameWorld.rptAnyWhere, #13 万能背包
|
| | | # IPY_GameWorld.rptCabinetDressCoat, #16 衣服外套背包
|
| | | # IPY_GameWorld.rptCabinetWeaponCoat, #17 武器外套背包
|
| | | # IPY_GameWorld.rptCabinetHorse, #18 时装坐骑背包
|
| | | # IPY_GameWorld.rptFineSoulSlot, #21 精魄槽
|
| | | # )
|
| | | |
| | | # 是否指定显示的背包类型
|
| | | if IPY_GameWorld.rptDeleted <= packIndex <= ShareDefine.rptMax:
|
| | | packTypes = [packIndex]
|
| | |
|
| | | elif packIndex != ShowAllPack:
|
| | | packTypes = []
|
| | | elif packIndex == ShowAllPack:
|
| | | return 'Not allowed to query all package items.'
|
| | |
|
| | | # 要查看的背包
|
| | | for packIndex in packTypes:
|
| | |
| | | packItemList = _GetPackItem(curPlayer, packIndex)
|
| | | itemList.extend(packItemList)
|
| | |
|
| | | resultDict = {
|
| | | 'LogoffTime':curPlayer.GetLogoffTime(), #离线时间
|
| | | 'LoginTime':curPlayer.GetLoginTime(), # 上线时间
|
| | | 'OnlineTime':curPlayer.GetOnlineTime(), # 累计上线时间
|
| | | 'LoginIP':curPlayer.GetIP(), #登入IP
|
| | | 'ItemList':itemList, # 物品装备列表
|
| | | }
|
| | | gmResult = GMCommon.Def_Success
|
| | | resultMsg = {"PackIndex":packIndex, "ItemList":itemList}
|
| | | if len(resultMsg) > pow(2, 14):
|
| | | resultMsg = {}
|
| | | gmResult = GMCommon.Def_MaxLimit # 数据过大
|
| | |
|
| | | |
| | | gmResult = 0
|
| | | if len(resultDict) > pow(2, 14):
|
| | | resultDict = ''
|
| | | gmResult = 8 # 数据过大
|
| | | |
| | | resultMsg = str([packCMDList[0], resultDict, 'GMT_PlayerItemInfo', gmResult])
|
| | | resultMsg = str([packCMDList[0], resultMsg, 'GMT_PlayerItemInfo', gmResult])
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'GMToolResult',
|
| | | resultMsg, len(resultMsg))
|
| | | return ''
|
| | |
| | | if curItem.IsEmpty():
|
| | | continue
|
| | |
|
| | | #分为装备和非装备
|
| | | if not ItemCommon.CheckItemIsEquip(curItem):
|
| | | # 获得具体信息
|
| | | itemList.append(_GetItemInfo(curItem, packIndex, index))
|
| | | else:
|
| | | itemList.append(_GetEquipInfo(curItem, packIndex, index))
|
| | | itemList.append(_GetItemInfo(curItem))
|
| | |
|
| | | return itemList
|
| | |
|
| | | def _GetItemInfo(curItem):
|
| | | # "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"
|
| | |
|
| | | ## 获取背包字典
|
| | | # @param curFindPlayer 当前玩家
|
| | | # @param packIndex 背包索引
|
| | | # @param index 物品位置
|
| | | # @return None
|
| | | def _GetItemInfo(curItem, packType, index):
|
| | | # "ItemPlaceIndex" : 1,
|
| | | # "PlayerID" : NumberLong(268902),
|
| | | # "ItemPlaceType" : 2,
|
| | | # "UserDataLen" : NumberLong(2),
|
| | | # "IsLocked" : 0,
|
| | | # "SID" : -1135840175,
|
| | | # "VerNO" : NumberLong(1),
|
| | |
|
| | | itemInfo = {
|
| | | 'PackType':packType, # 背包类型
|
| | | 'ItemIndex':index, # 索引
|
| | | 'GUID':curItem.GetGUID(), # guid
|
| | | 'Name':curItem.GetName(), # 物品名
|
| | | 'ItemID':curItem.GetItemTypeID(), |
| | | |
| | | 'IsBand':curItem.GetIsBind(), # 是否绑定
|
| | | 'ItemCnt':curItem.GetCount(), # 数量
|
| | | curItemInfo = {"ItemGUID":curItem.GetGUID(),
|
| | | "ItemTypeID":curItem.GetItemTypeID(),
|
| | | "ItemName":curItem.GetName().decode(ShareDefine.Def_Game_Character_Encoding).encode(GameWorld.GetCharacterEncoding()),
|
| | | "Count":curItem.GetCount(),
|
| | | "UserData":curItem.GetUserData(),
|
| | | "IsBind":curItem.GetIsBind(),
|
| | | "IsSuite":1 if curItem.GetSuiteID() else 0,
|
| | | "RemainHour":curItem.GetRemainHour(),
|
| | | "GearScore":curItem.GetGearScore(),
|
| | | "CreateTime":curItem.GetCreateTime(),
|
| | | }
|
| | |
|
| | | return itemInfo
|
| | | return curItemInfo
|
| | |
|
| | |
|
| | | ## 获取背包字典
|
| | | # @param curFindPlayer 当前玩家
|
| | | # @param packIndex 背包索引
|
| | | # @param index 物品位置
|
| | | # @return None
|
| | | def _GetEquipInfo(curItem, packType, index):
|
| | | itemInfo = {
|
| | | 'PackType':packType, # 背包类型
|
| | | 'ItemIndex':index, # 索引
|
| | | 'GUID':curItem.GetGUID(), # guid
|
| | | 'Name':curItem.GetName(), # 物品名
|
| | | 'IsBand':curItem.GetIsBind(), # 是否绑定
|
| | | 'ItemID':curItem.GetItemTypeID(), |
| | | 'IsSuite':curItem.GetIsSuite(), # 是否套装
|
| | | |
| | | }
|
| | | |
| | | return itemInfo
|
| | | |
| | |
|
| | | ## 获取装备技能
|
| | | # @param curEquip 装备
|
| | | # @return addSkillList 技能列表
|
| | | def GetEquipSkill(curEquip):
|
| | | |
| | | #该装备当前的灵纹属性列表
|
| | | addSkillList = [] |
| | | |
| | | for i in range(0, curEquip.GetUserAttrCount(IPY_GameWorld.iudetEquipAddSkillList)):
|
| | | |
| | | addSkillID = curEquip.GetUserAttrByIndex(IPY_GameWorld.iudetEquipAddSkillList, i)
|
| | | addSkillList.append(addSkillID)
|
| | | |
| | | return addSkillList
|