| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #---------------------------------------------------------------------
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | ##@package GMT_KickPlayer.py
|
| | | # GM命令踢玩家下线
|
| | | ##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_KickPlayer
|
| | | #
|
| | | # @author wdb
|
| | | # @date 2012-6-14
|
| | | # @version 1.2
|
| | | # @todo:GM工具命令 - 踢下线
|
| | | # @author hxp
|
| | | # @date 2026-03-06
|
| | | # @version 1.0
|
| | | #
|
| | | # @note
|
| | | # @change: "2012-06-21 15:30" wdb int修改到GMCommon开接口
|
| | | # @change: "2012-07-12 18:00" wdb 增加编码属性
|
| | | #---------------------------------------------------------------------
|
| | | """Version = 2012-07-12 18:00"""
|
| | | #---------------------------------------------------------------------
|
| | | #导入
|
| | | # 详细描述: GM工具命令 - 踢下线
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2026-03-06 15:00"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GMCommon
|
| | | from MangoDBCommon import fix_incomingText
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | import IPY_GameWorld
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## 收到gm命令执行
|
| | | # @param gmCmdDict:gm命令字典
|
| | | # @return None |
| | | def OnExec(gmCmdDict):
|
| | | playerAccID = gmCmdDict.get(GMCommon.Def_GMKey_PlayerAccID, '')
|
| | | playerName = gmCmdDict.get(GMCommon.Def_GMKey_PlayerName, '')
|
| | | errorMsg = "" |
| | | from GMToolLogicProcess import ProjSpecialProcess
|
| | | Result, curPlayer = ProjSpecialProcess.GMCmdPlayerValidation(gmCmdDict, False)
|
| | | if Result == GMCommon.Def_PlayerOfLine:
|
| | | return GMCommon.Def_NoNeed, "已离线"
|
| | |
|
| | | if playerAccID != '':
|
| | | return GMCommon.Def_DoQueryLogDB, ''
|
| | | elif Result == GMCommon.Def_Success:
|
| | | curPlayer.Kick(IPY_GameWorld.disGMKick)
|
| | | return Result
|
| | |
|
| | | 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
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | return Result, errorMsg
|