| #!/usr/bin/python  | 
| # -*- coding: GBK -*-  | 
| #---------------------------------------------------------------------  | 
| #  | 
| #---------------------------------------------------------------------  | 
| ##@package GMT_GetPlayerInfo.py  | 
| # GMÃüÁ»ñµÃÍæ¼ÒÐÅÏ¢  | 
| #  | 
| # @author wdb  | 
| # @date 2012-6-14  | 
| # @version 1.6  | 
| #  | 
| # @note  | 
| # @change: "2012-06-21 15:30" wdb intÐ޸ĵ½GMCommon¿ª½Ó¿Ú  | 
| # @change: "2012-07-12 18:00" wdb Ôö¼Ó±àÂëÊôÐÔ  | 
| # @change: "2012-07-30 11:30" wdb GM»Ø¸´Ï¸»¯£¬´úÂëÓÅ»¯  | 
| # @change: "2012-08-10 17:00" whx Ôö¼Ó²Ö¿âÃÜÂë  | 
| # @change: "2015-01-30 02:00" hxp Ôö¼ÓתÉú´ÎÊý¡¢×ªÉúµÈ¼¶¡¢°ó×êÐÅÏ¢  | 
| # @change: "2015-05-22 14:30" hxp Ôö¼Ó´óʦµÈ¼¶¡¢Õ½¶·Á¦  | 
| #---------------------------------------------------------------------  | 
| """Version = 2015-05-22 14:30"""  | 
| #---------------------------------------------------------------------  | 
| #µ¼Èë  | 
| from Collections import DataServerPlayerData  | 
| from MangoDBCommon import fix_incomingText  | 
| from Collections.CollectionDefine import *  | 
| import GMCommon  | 
| #---------------------------------------------------------------------  | 
| #È«¾Ö±äÁ¿  | 
|   | 
| #---------------------------------------------------------------------  | 
|   | 
| ## ÊÕµ½gmÃüÁîÖ´ÐÐ  | 
| # @param gmCmdDict:gmÃüÁî×Öµä  | 
| # @return None   | 
| def OnExec(gmCmdDict):  | 
|     playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '')  | 
|     queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')  | 
|       | 
|     if playerFind == '':  | 
|         return GMCommon.Def_ParamErr, ''  | 
|       | 
|     elif queryType == 'accID':  | 
|         return GMCommon.Def_DoQueryLogDB, ''  | 
|      | 
|     return GMCommon.Def_DoQueryUserDB, '%s'%GMCommon.Def_GMKey_PlayerName  | 
|       | 
|       | 
| ## ²éѯlogdb·µ»Ø  | 
| # @param logdb:logdb  | 
| # @param data:´«ÈëµÄÐÅÏ¢  | 
| # @param gmCmdDict:gmÃüÁî×Öµä  | 
| # @return None   | 
| def LogDBResponse(logdb, data, gmCmdDict):  | 
|     playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '')  | 
|     queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')  | 
|       | 
|     if queryType == 'accID' and GMCommon.GetPlayerOnLineByAccID(logdb, playerFind):  | 
|         return GMCommon.Def_SendToGameServer, ''  | 
|     | 
|     # ×ª»»×Ö·û´®  | 
|     if data != '' and GMCommon.GetPlayerOnLineByAccID(logdb, data):          | 
|         return GMCommon.Def_SendToGameServer, ''  | 
|           | 
|     return GMCommon.Def_DoQueryUserDB, ''  | 
|   | 
|   | 
| ## ²éѯuserdb·µ»Ø  | 
| # @param userdb:userdb  | 
| # @param data:´«ÈëµÄÐÅÏ¢  | 
| # @param gmCmdDict:gmÃüÁî×Öµä  | 
| # @return None   | 
| def UserDBResponse(userdb, data, gmCmdDict):  | 
|     # ×ª»»×Ö·û´®  | 
|     playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '')  | 
|     queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')  | 
|           | 
|     # queryType²»ÊÇaccID£¬·¢Ë͵ÄÐÅÏ¢ÊÇÍæ¼ÒµÄÃû×Ö    | 
|     if queryType != 'accID':  | 
|         playerAccID = GMCommon.GetPlayerAccID(userdb, {'PlayerName':fix_incomingText(playerFind), 'IsDeleted':0})  | 
|           | 
|         if playerAccID == '':  | 
|             return GMCommon.Def_NoTag, ''  | 
|           | 
|     else:  | 
|         # queryTypeΪaccID£¬·¢Ë͵ÄÐÅÏ¢¾ÍÊÇÍæ¼ÒµÄAccID  | 
|         playerAccID = playerFind  | 
|       | 
|     # ·µ»Øplayerid£¬ÅжÏÊÇ·ñÔÚÏß  | 
|     if data == '%s'%GMCommon.Def_GMKey_PlayerName:          | 
|         return GMCommon.Def_DoQueryLogDB, playerAccID  | 
|   | 
|     collection = userdb[UCN_DBPlayer]     | 
|     dbPlayer = DataServerPlayerData.tagDBPlayer()  | 
|     dbPlayer.IsDeleted = 0  | 
|       | 
|     loadOK = dbPlayer.adoLoadCEx(collection, {'AccID':fix_incomingText(playerAccID),  | 
|                                                  'IsDeleted':dbPlayer.IsDeleted})   | 
|          | 
|     if not loadOK:  | 
|         # »Ø¸´gm  | 
|         return GMCommon.Def_NoTag, ''  | 
|       | 
|     playerInfo = {  | 
|                   'AccID':dbPlayer.AccID,   # Õ˺Š | 
|                   'AccState':dbPlayer.AccState,  # Õ˺Å״̬  | 
|                   'PlayerID':dbPlayer.PlayerID,    | 
|                   'Name':dbPlayer.PlayerName,  # Íæ¼ÒÃû  | 
|                   'GMLV':dbPlayer.GMLevel,  #gmµÈ¼¶  | 
|                     | 
|                   'Job':dbPlayer.Job,  # Ö°Òµ  | 
|                   'Sex':dbPlayer.Sex,  # ÐÔ±ð  | 
|                   'LV':dbPlayer.LV,  #Íæ¼ÒµÈ¼¶  | 
|                   'LVEx':dbPlayer.LVEx,  #תÉúµÈ¼¶  | 
|                   'LV2':dbPlayer.LV2,  #´óʦµÈ¼¶  | 
|                   'ReincarnationLv':dbPlayer.ReincarnationLv,  #תÉú´ÎÊý  | 
|                   'FightPower':dbPlayer.FightPower,  #Õ½¶·Á¦  | 
|                   'VIPLV':dbPlayer.VIPLv,  # vipµÈ¼¶  | 
|                   'TotalExp':dbPlayer.TotalExp,  # ×ܾÑéÖµ  | 
|                     | 
|                   'MapID':dbPlayer.MapID,  #µ±Ç°µØÍ¼id  | 
|                   'PosX':dbPlayer.PosX,   # µ±Ç°×ø±ê  | 
|                   'PosY':dbPlayer.PosY,    | 
|                   'Gold':dbPlayer.Gold,   # Ôª±¦  | 
|                   'GoldPaper':dbPlayer.GoldPaper,   # °ó×ê  | 
|                   'Silver':dbPlayer.Silver,  # ÒøÁ½  | 
|                     | 
|                   'ZhenQi':dbPlayer.ExAttr5,  # ÕæÆø  | 
|                   'FamilyName':dbPlayer.FamilyName,  # ¼Ò×åÃû³Æ  | 
|                     | 
|                   'STR':dbPlayer.STR, #Á¦Á¿  | 
|                   'PNE':dbPlayer.PNE, #ÕæÔª  | 
|                   'PHY':dbPlayer.PHY, #½î¹Ç  | 
|                   'CON':dbPlayer.CON, #ÌåÆÇ  | 
|                   'FreePoint':dbPlayer.FreePoint, # Ê£ÓàµãÊý   | 
|                                      | 
|                   'LogoffTime':dbPlayer.LogoffTime, #ÀëÏßʱ¼ä  | 
|                   'LoginTime':dbPlayer.LoginTime,  # ÉÏÏßʱ¼ä  | 
|                   'OnlineTime':dbPlayer.OnlineTime,  # ÀÛ¼ÆÉÏÏßʱ¼ä  | 
|                   'LoginIP':dbPlayer.LoginIP,  #µÇÈëIP  | 
|                     | 
|                   'WarehousePsw':dbPlayer.WarehousePsw, #²Ö¿âÃÜÂë  | 
|                   }  | 
|       | 
|     return GMCommon.Def_Success, playerInfo  | 
|   | 
|   | 
|   | 
|   |