#!/usr/bin/python # -*- coding: GBK -*- #--------------------------------------------------------------------- # #--------------------------------------------------------------------- ##@package GMT_CTG # GMÃüÁîCTG # # @author whx # @date 2012-08-27 13:59 # @version 1.0 # # @note #--------------------------------------------------------------------- """Version = 2012-08-27 13:59""" #--------------------------------------------------------------------- #µ¼Èë import GMCommon from MangoDBCommon import fix_incomingText #--------------------------------------------------------------------- #È«¾Ö±äÁ¿ #--------------------------------------------------------------------- ## ÊÕµ½gmÃüÁîÖ´ÐÐ # @param gmCmdDict:gmÃüÁî×Öµä # @return None def OnExec(gmCmdDict): queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '') playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '') #value = gmCmdDict.get('value', '') if queryType not in [GMCommon.Def_GMKey_PlayerAccID, GMCommon.Def_GMKey_PlayerName]: return GMCommon.Def_ParamErr, '' if len(playerFind) <= 0: return GMCommon.Def_ParamErr, '' return GMCommon.Def_DoQueryUserDB, '' ## ²éѯlogdb·µ»Ø # @param logdb:logdb # @param data:´«ÈëµÄÐÅÏ¢ # @param gmCmdDict:gmÃüÁî×Öµä # @return None def LogDBResponse(logdb, data, gmCmdDict): if data == "": return GMCommon.Def_DoQueryUserDB, '' # ÐÞ¸ÄΪÀëÏß¿ÉÓà return GMCommon.Def_SendToGameServer, '' # if GMCommon.GetPlayerOnLineByAccID(logdb, data): # return GMCommon.Def_SendToGameServer, '' # # return GMCommon.Def_PlayerOfLine, '' ## ²éѯuserdb·µ»Ø # @param userdb:userdb # @param data:´«ÈëµÄÐÅÏ¢ # @param gmCmdDict:gmÃüÁî×Öµä # @return None def UserDBResponse(userdb, data, gmCmdDict): queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '') playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '') playerAccID = "" # Íæ¼ÒÐÕÃû if queryType == GMCommon.Def_GMKey_PlayerName: playerAccID = GMCommon.GetPlayerAccID(userdb, {'PlayerName':fix_incomingText(playerFind), 'IsDeleted':0}) elif queryType == GMCommon.Def_GMKey_PlayerAccID: playerAccID = GMCommon.GetPlayerAccID(userdb, {'AccID':fix_incomingText(playerFind), 'IsDeleted':0}) if playerAccID == '': return GMCommon.Def_NoTag, '' return GMCommon.Def_DoQueryLogDB, playerAccID