xdh
2019-01-14 e7e1e93c2d2237f5fdcb94e4053e7c7584dbc7bf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#!/usr/bin/python
# -*- coding: GBK -*-
#---------------------------------------------------------------------
#
#---------------------------------------------------------------------
##@package GY_Query_GetPlayerFuncInfo
# @todo: Ìṩ²éÑ¯Íæ¼Ò¹¦ÄÜÐÅÏ¢
#
# @author: xdh
# @date 2017-07-12 12:00
# @version 1.0
# @note
#---------------------------------------------------------------------
"""Version = 2017-07-12 12:00"""
#---------------------------------------------------------------------
import IPY_GameWorld
import GameWorld
import ChConfig
import Operate_EquipPlus
import ItemCommon
 
#---------------------------------------------------------------------
 
## ÇëÇóÂß¼­
#  @param query_Type ÇëÇóÀàÐÍ
#  @param query_ID ÇëÇóµÄÍæ¼ÒID
#  @param packCMDList ·¢°üÃüÁî [ ]
#  @param tick µ±Ç°Ê±¼ä
#  @return resultDisc
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def DoLogic(query_Type, query_ID, packCMDList, tick):
    curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(query_ID)
    
    if not curPlayer or curPlayer.IsEmpty():
        return ''
    #GameWorld.Log('GY_Query_GetPlayerFuncInfo packCMDList=%s'%packCMDList)
    queryKeyStr = packCMDList[1]
    
    resultDict = {}
    queryKeyList = queryKeyStr.split('|')
    for queryKey in queryKeyList:
        if queryKey == 'herolv': #½ÇÉ«µÈ¼¶
            resultDict['herolv'] = curPlayer.GetLV()
        if queryKey == 'viplv': #vipµÈ¼¶
            resultDict['viplv'] = curPlayer.GetVIPLv()
        #if queryKey == 'rechargeOnce': #Ò»´ÎÐÔ³äֵǮ
        #    result = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_RechargeOnce_Coin)
        #    resultDict['rechargeOnce'] = result
#        elif queryKey == 'horselv': #×øÆï½×¼¶
#            result = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_ClassLV, 0, ChConfig.Def_PDictType_Horse)
#            resultDict['horselv'] = result
        #elif queryKey == 'petlv': #×î¸ßµÄ³èÎï½×¼¶
        #    result = curPlayer.GetDictByKey(ChConfig.Def_PDict_BillboardPetClassLV)
        #    resultDict['petlv'] = result
        elif queryKey == 'officiallv': #¾ôλ½×¼¶
            result = curPlayer.GetOfficialRank()
            resultDict['officiallv'] = result
        #=======================================================================
        # elif queryKey == 'pluslv':
        #    #È«Éí12²¿Î»Ç¿»¯µÈ¼¶×îµÍµÄÒ»¼þ
        #    result = Operate_EquipPlus.GetMinPlusLV(curPlayer)
        #    resultDict['pluslv'] = result
        #=======================================================================
        elif queryKey == 'orangeEquip':
            equipPartIndexList = ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, [])
            equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
            result = -1 #È«Éí×îµÍ³Èɫװ±¸µÄ½×Êý
            for equipIndex in range(0, equipPack.GetCount()):
                #·Ç¿ÉÇ¿»¯²¿Î»²»´¦Àí
                if equipIndex not in equipPartIndexList:
                    continue
                curEquip = equipPack.GetAt(equipIndex)
                if curEquip.IsEmpty():
                    result = 0
                    break
                if curEquip.GetItemQuality() < ChConfig.Def_Quality_Orange:
                    result = 0
                    break
                equipClassLV = ItemCommon.GetItemClassLV(curEquip)
                if result == -1 or equipClassLV < result:
                    result = equipClassLV
            resultDict['orangeEquip'] = result
            
    
    resultMsg = str([packCMDList[0], resultDict, 'GMT_GetPlayerFuncInfo'])
    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, 'GMToolResult', 
                                                              resultMsg, len(resultMsg))
    return ''