#!/usr/bin/python # -*- coding: GBK -*- ##@package GY_Query_PlayerDetailByID # ²éÑ¯Íæ¼ÒÐÅÏ¢ # # @author panwei # @date 2010-3-31 # @version 1.2 # # @change: "2010-10-29 11:30" panwei ×°±¸Î»°Î³ýÂß¼­ÐÞ¸Ä # @change: "2014-01-07 15:30" hxp ϵͳmarkÐÞ¸Ä #--------------------------------------------------------------------- """Version = 2014-01-07 15:30""" #--------------------------------------------------------------------- #ÃüÁî: #GY_GM_PlayerDetailByID # #·µ»Ø×Öµä: #Result: 1 #0 #DictName: GY_GM_PlayerDetailByID #AccID: ÕÊ»§ID #Job: Ö°Òµ #STR : Á¦Á¿ #PNE : ÕæÔª #PHY : ½î¹Ç #CON : ÌåÖÊ #EquipOther:{ # RetINC1: [ID,MaxEndure, CurEndure] # RetINC2: [ID,MaxEndure, CurEndure] # RetHorse: [ID,MaxEndure, CurEndure] # retHorseFood: [ID,MaxEndure, CurEndure] # } #EquipOne: { #curEquip:[ID,MaxEndure, CurEndure] , #Í·¿ø # retClothes:[ID,MaxEndure, CurEndure ], #Ò·þ # retShoes:[ID,MaxEndure, CurEndure ] , #Ь×Ó # retArm:[ID,MaxEndure, CurEndure ], #ÊÖÌ× # retNeck:[ID,MaxEndure, CurEndure ], #ÏîÁ´ # retWeapon:[ID,MaxEndure, CurEndure ], #ÎäÆ÷ # #} #EquipTwo: { #curEquip:[ID,MaxEndure, CurEndure] , #Í·¿ø # retClothes:[ID,MaxEndure, CurEndure ], #Ò·þ # retShoes:[ID,MaxEndure, CurEndure ] , #Ь×Ó # retArm:[ID,MaxEndure, CurEndure ], #ÊÖÌ× # retNeck:[ID,MaxEndure, CurEndure ], #ÏîÁ´ # retWeapon:[ID,MaxEndure, CurEndure ], #ÎäÆ÷ # #Pack:{ # 0:[ ID,MaxEndure, CurEndure, Count] # 1:[ ID,MaxEndure, CurEndure, Count] # 2:[ ID,MaxEndure, CurEndure, Count] # 3:[ ID,MaxEndure, CurEndure, Count] # . # . # . # } #½áÊø±êÖ¾:ÎªÍæ¼Ò±³°üµ±Ç°¿ªÊ¼Êý # #WareHouse:{ # 0:[ ID,MaxEndure, CurEndure, Count] # 1:[ ID,MaxEndure, CurEndure, Count] # 2:[ ID,MaxEndure, CurEndure, Count] # 3:[ ID,MaxEndure, CurEndure, Count] # . # . # . # } #} #--------------------------------------------------------------------- #µ¼Èë import IPY_GameWorld import PlayerControl import 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) resultDisc = {} #ÎÞ·¨²éÕÒÍæ¼Ò if not curFindPlayer or curFindPlayer.IsEmpty(): resultDisc = { 'Result' : '0' , 'DictName': 'GY_GM_PlayerDetailByID' } return resultDisc else: curFindPlayerEquipPack = curFindPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip) #======================================================================= # mast_ID , mast_maxEdu , mast_curEdu = __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retMask) # clothes_ID , clothes_maxEdu , clothes_curEdu = __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retClothes) # shoes_ID , shoes_maxEdu , shoes_curEdu = __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retShoes) # arm_ID , arm_maxEdu , arm_curEdu = __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retArm) # neck_ID , neck_maxEdu , neck_curEdu = __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retNeck) #======================================================================= weapon_ID , weapon_maxEdu , weapon_curEdu = __GetEquipInfo(curFindPlayerEquipPack , ShareDefine.retWeapon) #=============================================================================== # inc1_ID , inc1_maxEdu , inc1_curEdu = __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retINC1) # inc2_ID , inc2_maxEdu , inc2_curEdu = __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retINC2) # # horse_ID , horse_maxEdu , horse_curEdu = __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retHorse) # food_ID , food_maxEdu , food_curEdu = __GetEquipInfo(curFindPlayerEquipPack , IPY_GameWorld.retHorseFood) #=============================================================================== gold = curFindPlayer.GetGold() goldPaper = curFindPlayer.GetGoldPaper() silver = PlayerControl.GetSilver(curFindPlayer) silverPaper = curFindPlayer.GetSilverPaper() resultDisc = { 'Result' : '1' , 'DictName': 'GY_GM_PlayerDetailByID' , 'AccID' : '%s'%curFindPlayer.GetAccID() , 'Job' : '%s'%curFindPlayer.GetJob() , 'STR' : '%s'%curFindPlayer.GetSTR() , 'PNE' : '%s'%curFindPlayer.GetPNE() , 'PHY' : '%s'%curFindPlayer.GetPHY() , 'CON' : '%s'%curFindPlayer.GetCON() , 'EquipOne': { #======================================= # 'curEquip' :['%s'%mast_ID ,'%s'%mast_maxEdu ,'%s'%mast_curEdu ] , # 'retClothes' :['%s'%clothes_ID,'%s'%clothes_maxEdu,'%s'%clothes_curEdu] , # 'retShoes' :['%s'%shoes_ID ,'%s'%shoes_maxEdu ,'%s'%shoes_curEdu ] , # 'retArm' :['%s'%arm_ID ,'%s'%arm_maxEdu ,'%s'%arm_curEdu ] , # 'retNeck' :['%s'%neck_ID ,'%s'%neck_maxEdu ,'%s'%neck_curEdu ] , #======================================= 'retWeapon' :['%s'%weapon_ID ,'%s'%weapon_maxEdu ,'%s'%weapon_curEdu ] , } , 'EquipOther':{ #=============================================================================== # 'RetINC1' : ['%s'%inc1_ID , '%s'%inc1_maxEdu , '%s'%inc1_curEdu ] , # 'RetINC2' : ['%s'%inc2_ID , '%s'%inc2_maxEdu , '%s'%inc2_curEdu ] , # # 'RetHorse': ['%s'%horse_ID , '%s'%horse_maxEdu, '%s'%horse_curEdu ] , # # 'retHorseFood': ['%s'%food_ID , '%s'%food_maxEdu , '%s'%food_curEdu ] #=============================================================================== } , 'Gold' : '%s'%gold , 'GoldPaper' : '%s'%goldPaper , 'Silver' : '%s'%silver , 'SilverPaper': '%s'%silverPaper , } packDisc = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptItem , 'Pack') #Á´½Ó±³°ü resultDisc.update(packDisc) wareHouse = __GetItemPackDisc(curFindPlayer , IPY_GameWorld.rptWarehouse , 'WareHouse') #Á¬½Ó²Ö¿â resultDisc.update(wareHouse) return resultDisc #--------------------------------------------------------------------- ## »ñȡװ±¸ÐÅÏ¢ # @param equipPack ±³°üË÷Òý # @param packIndex λÖÃË÷Òý # @return [itemTypeID, maxEndure, curDurg] # @remarks º¯ÊýÏêϸ˵Ã÷. def __GetEquipInfo(equipPack , packIndex): curEquip = equipPack.GetAt(packIndex) if curEquip.IsEmpty(): return '0' , '0' , '0' return curEquip.GetItemTypeID() , 0 , 0 #--------------------------------------------------------------------- ## »ñÈ¡±³°ü×Öµä # @param curFindPlayer µ±Ç°Íæ¼Ò # @param packIndex ±³°üË÷Òý # @param discKey ×ÖµäÖµ # @return resultDisc # @remarks º¯ÊýÏêϸ˵Ã÷. def __GetItemPackDisc(curFindPlayer , packIndex , discKey): itemPack = curFindPlayer.GetItemManager().GetPack(packIndex) resultDisc = {discKey : {}} #ID,MaxEndure, CurEndure, Count for i in range(itemPack.GetCount()): item = itemPack.GetAt(i) if item.IsEmpty(): resultDisc[discKey].update({'%s'%i : ['0','0','0','0']}) else: resultDisc[discKey].update({'%s'%i : ['%s'%item.GetItemTypeID(),'0','0','%s'%item.GetCount()]}) 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)) #GeRen_chenxin_673416 GMÖ¸ÁîÒÑÉúЧ£¬²Ù×÷³É¹¦ PlayerControl.NotifyCode(curPlayer,"GeRen_chenxin_673416") return