hxp
3 天以前 388823edfe6308cba6f76ca6dc4f20022c5cb2be
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
#!/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