#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#---------------------------------------------------------------------
|
#
|
#---------------------------------------------------------------------
|
##@package GMT_KickPlayer.py
|
# GMÃüÁîÌßÍæ¼ÒÏÂÏß
|
#
|
# @author wdb
|
# @date 2012-6-14
|
# @version 1.2
|
#
|
# @note
|
# @change: "2012-06-21 15:30" wdb intÐ޸ĵ½GMCommon¿ª½Ó¿Ú
|
# @change: "2012-07-12 18:00" wdb Ôö¼Ó±àÂëÊôÐÔ
|
#---------------------------------------------------------------------
|
"""Version = 2012-07-12 18:00"""
|
#---------------------------------------------------------------------
|
#µ¼Èë
|
import GMCommon
|
from MangoDBCommon import fix_incomingText
|
#---------------------------------------------------------------------
|
#È«¾Ö±äÁ¿
|
|
#---------------------------------------------------------------------
|
|
## ÊÕµ½gmÃüÁîÖ´ÐÐ
|
# @param gmCmdDict:gmÃüÁî×Öµä
|
# @return None
|
def OnExec(gmCmdDict):
|
playerAccID = gmCmdDict.get(GMCommon.Def_GMKey_PlayerAccID, '')
|
playerName = gmCmdDict.get(GMCommon.Def_GMKey_PlayerName, '')
|
|
if playerAccID != '':
|
return GMCommon.Def_DoQueryLogDB, ''
|
|
elif playerName != '':
|
return GMCommon.Def_DoQueryUserDB, ''
|
|
# »Ø¸´gmÍæ¼Ò²»ÔÚÏß
|
return GMCommon.Def_ParamErr, ''
|
|
|
## ²éѯlogdb·µ»Ø
|
# @param logdb:logdb
|
# @param data:´«ÈëµÄÐÅÏ¢
|
# @param gmCmdDict:gmÃüÁî×Öµä
|
# @return None
|
def LogDBResponse(logdb, data, gmCmdDict):
|
playerAccID = gmCmdDict.get(GMCommon.Def_GMKey_PlayerAccID, '')
|
|
if playerAccID != '' and GMCommon.GetPlayerOnLineByAccID(logdb, playerAccID):
|
return GMCommon.Def_SendToGameServer, ''
|
|
# ת»»×Ö·û´®
|
if data != '' and 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):
|
|
playerName = gmCmdDict.get(GMCommon.Def_GMKey_PlayerName, '')
|
playerAccID = GMCommon.GetPlayerAccID(userdb, {'PlayerName':fix_incomingText(playerName), 'IsDeleted':0})
|
|
if playerAccID == '':
|
return GMCommon.Def_NoTag, ''
|
|
return GMCommon.Def_DoQueryLogDB, playerAccID
|
|
|
|
|
|