#!/usr/bin/python
|
# -*- coding: GBK -*-
|
|
##@package GY_Query_Offline_ViewItem
|
# ²é¿´ËùÓÐÎïÆ·
|
#
|
# @author panwei
|
# @date 2010-3-31
|
# @version 1.2
|
#
|
# ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
|
# @change: "2010-10-29 11:30" panwei ×°±¸Î»°Î³ýÂß¼ÐÞ¸Ä
|
# @change: "2013-04-18 17:00" wdb ÎïÆ·ÑÕɫʹÓÃÐÞ¸Ä
|
#---------------------------------------------------------------------
|
"""Version = 2013-04-18 17:00"""
|
#---------------------------------------------------------------------
|
#µ¼Èë
|
import GameWorld
|
import IPY_GameWorld
|
import ShareDefine
|
#---------------------------------------------------------------------
|
#È«¾Ö±äÁ¿
|
#---------------------------------------------------------------------
|
|
#---------------------------------------------------------------------
|
#Â߼ʵÏÖ
|
## ÇëÇóÂß¼
|
# @param query_Type ÇëÇóÀàÐÍ
|
# @param query_ID ÇëÇóµÄÍæ¼ÒID
|
# @param packCMDList ·¢°üÃüÁî [ ]
|
# @param tick µ±Ç°Ê±¼ä
|
# @return resultDisc
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def DoLogic(query_Type , query_ID , packCMDList , tick):
|
curFindPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)
|
|
if not curFindPlayer or curFindPlayer.IsEmpty():
|
return ''
|
|
# rptDeleted = _IPY_GameWorld.rptDeleted
|
# rptEquip = _IPY_GameWorld.rptEquip
|
# rptItem = _IPY_GameWorld.rptItem
|
# rptRecycle = _IPY_GameWorld.rptRecycle
|
# rptBreakItem = _IPY_GameWorld.rptBreakItem
|
# rptWarehouse = _IPY_GameWorld.rptWarehouse
|
# rptTitle = _IPY_GameWorld.rptTitle(²»Òª)
|
# rptCompose = _IPY_GameWorld.rptCompose
|
# rptIdentify = _IPY_GameWorld.rptIdentify
|
# rptBreakPrepare = _IPY_GameWorld.rptBreakPrepare
|
# rptResult = _IPY_GameWorld.rptResult
|
# rptInvestiture = _IPY_GameWorld.rptInvestiture(²»Òª)
|
|
#Á¬½Ó×°±¸±³°ü
|
curFindPlayerEquipPack = curFindPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
|
resultDisc = {
|
'Result' : '1' ,
|
'DictName' : 'GY_GM_Offline_ViewItem' ,
|
'EquipOne': {
|
#===============================================
|
# 'curEquip' : __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retMask) ,
|
# 'retClothes' : __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retClothes),
|
# 'retShoes' : __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retShoes) ,
|
# 'retArm' : __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retArm) ,
|
# 'retNeck' : __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retNeck) ,
|
#===============================================
|
'retWeapon' : __GetEquipInfo(curFindPlayerEquipPack , ShareDefine.retWeapon) ,
|
}
|
,
|
'EquipOther':{
|
|
}
|
}
|
|
#Á¬½Óɾ³ý±³°ü
|
packDisc = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptDeleted, 'DelPack')
|
resultDisc.update(packDisc)
|
#Á¬½ÓÎïÆ·±³°ü
|
packDisc = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptItem, 'ItemPack')
|
resultDisc.update(packDisc)
|
#Á¬½ÓÀ¬»øÍ°
|
packDisc = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptRecycle, 'RecyclePack')
|
resultDisc.update(packDisc)
|
#Á¬½Ó²ð½â±³°ü
|
packDisc = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptBreakItem, 'BreakItemPack')
|
resultDisc.update(packDisc)
|
#Á¬½Ó²Ö¿â
|
packDisc = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptWarehouse, 'WarehousePack')
|
resultDisc.update(packDisc)
|
#Á¬½Ó´òÔì±³°ü
|
packDisc = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptCompose, 'ComposePack')
|
resultDisc.update(packDisc)
|
#Á¬½Ó¼ø¶¨±³°ü
|
packDisc = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptIdentify, 'IdentifyPack')
|
resultDisc.update(packDisc)
|
#Á¬½Ó²ð½â×¼±¸±³°ü
|
packDisc = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptBreakPrepare, 'BreakPreparePack')
|
resultDisc.update(packDisc)
|
#Á¬½Ó´òÔì½á¹û±³°ü
|
packDisc = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptResult, 'ResultPack')
|
resultDisc.update(packDisc)
|
|
return resultDisc
|
|
#---------------------------------------------------------------------
|
## ·µ»ØÖ¸¶¨ÎïÆ·µÄÐÅÏ¢
|
# @param equipPack ±³°üË÷Òý
|
# @param packIndex λÖÃË÷Òý
|
# @return [name, starLV, stone, durg, maxEnd, count]
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def __GetEquipInfo(equipPack , packIndex):
|
curEquip = equipPack.GetAt(packIndex)
|
#Ãû×Ö , ÐǼ¶ , ÏâǶÊý , Ä;Ã/×î´óÄ;à , ÊýÁ¿
|
if curEquip.IsEmpty():
|
return ['0' , '0' , '0' , '0/0' , '0']
|
|
return [
|
'%s'%(__ParseItemName(curEquip)), '0', '0', '0/0', '%s'%(curEquip.GetCount())
|
]
|
|
#---------------------------------------------------------------------
|
## ½âÎöÎïÆ·Ãû³Æ °× -> ÆÆ¾ÉµÄ,´ÖÖÆµÄ,ÆÕͨµÄ, À¶ -> 4 ÓÅÐãµÄ,¾«Á¼µÄ,׿ԽµÄ, ×Ï -> Ï¡ÓеÄ,ÎÞϾµÄ,ÍêÃÀµÄ
|
# @param item ÎïÆ·
|
# @return itemName
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def __ParseItemName(item):
|
itemName = item.GetName()
|
return itemName
|
#---------------------------------------------------------------------
|
## »ñÈ¡±³°ü×Öµä
|
# @param curFindPlayer µ±Ç°Íæ¼Ò
|
# @param packIndex ±³°üË÷Òý
|
# @param discKey ×Öµäkey
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def __GetItemPackDisc(curFindPlayer , packIndex , discKey):
|
itemPack = curFindPlayer.GetItemManager().GetPack(packIndex)
|
resultDisc = {discKey : {}}
|
for i in range(itemPack.GetCount()):
|
resultDisc[discKey].update({'%s'%i : __GetEquipInfo(itemPack , i)})
|
|
return resultDisc
|
#---------------------------------------------------------------------
|
#Ö´Ðнá¹û
|
## Ö´Ðнá¹û
|
# @param curPlayer ·¢³öÇëÇóµÄÍæ¼Ò
|
# @param callFunName ¹¦ÄÜÃû³Æ
|
# @param funResult ²éѯµÄ½á¹û
|
# @param tick µ±Ç°Ê±¼ä
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def DoResult(curPlayer , callFunName , funResult , tick):
|
curPlayer.GMAnswer('%s;%s'%(callFunName, funResult))
|
return
|