hxp
2026-03-06 e4a73fcd808bcf5e22099b73f2bc98e8b6ee84c6
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyMongoDB/GMToolLogicProcess/Commands/GMT_GetPlayerForbid.py
@@ -1,100 +1,39 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#---------------------------------------------------------------------
#-------------------------------------------------------------------------------
#
#---------------------------------------------------------------------
##@package GMT_GetPlayerForbid.py
# GM命令获得玩家处罚
##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_GetPlayerForbid
#
# @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"""
#---------------------------------------------------------------------
#导入
from MangoDBCommon import fix_incomingText
from Collections.CollectionDefine import *
from Common import (CommFuncEx, mylog)
from Collections import DataServerPlayerData
# 详细描述: GM工具命令 - 查看玩家禁言封禁状态
#
#-------------------------------------------------------------------------------
#"""Version = 2026-03-06 15:00"""
#-------------------------------------------------------------------------------
import GMCommon
#---------------------------------------------------------------------
#全局变量
#---------------------------------------------------------------------
## 收到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:
        dbPlayer = curPlayer
        accState = dbPlayer.AccState
    
    if playerAccID != '':
        return GMCommon.Def_DoQueryLogDB, ''
    elif Result == GMCommon.Def_Success:
        accState = curPlayer.GetAccState()
  
    elif playerName != '':
        return GMCommon.Def_DoQueryUserDB, '%s'%GMCommon.Def_GMKey_PlayerName
    # 回复
    return GMCommon.Def_ParamErr, ''
    else:
        return Result, errorMsg
    
## 查询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_DoQueryUserDB, ''
## 查询userdb返回
# @param userdb:userdb
# @param data:传入的信息
# @param gmCmdDict:gm命令字典
# @return None
def UserDBResponse(userdb, data, gmCmdDict):
    playerAccID = gmCmdDict.get(GMCommon.Def_GMKey_PlayerAccID, '')
    playerName = gmCmdDict.get(GMCommon.Def_GMKey_PlayerName, '')
    #  取得玩家accid
    if  playerName != '':
        playerAccID = GMCommon.GetPlayerAccID(userdb, {'PlayerName':fix_incomingText(playerName), 'IsDeleted':0})
        if playerAccID == '':
            return GMCommon.Def_NoTag, ''
    # 返回playerid,判断是否在线
    if data == '%s'%GMCommon.Def_GMKey_PlayerName:
        return GMCommon.Def_DoQueryLogDB, playerAccID
    collection = userdb[UCN_DBPlayer]
    findPlayer = collection.find({'AccID':fix_incomingText(playerAccID)})
    if findPlayer.count() <= 0:
        return GMCommon.Def_NoTag, ''
    accState = findPlayer[0].get('AccState', 0)
    forbidInfo = {
                  'forbidLogin':(accState & pow(2, GMCommon.Def_PysForbidByPy)) > 0,  #是否锁定
                  'forbidTalk': (accState & pow(2, GMCommon.Def_PysForbidTalk)) > 0 or (accState & pow(2, GMCommon.Def_PysForbidTalkDevice)) > 0,  #是否禁言
                  'forbidTalk': (accState & pow(2, GMCommon.Def_PysForbidTalk)) > 0,  #是否禁言
                  #'forbidTalk': (accState & pow(2, GMCommon.Def_PysForbidTalk)) > 0 or (accState & pow(2, GMCommon.Def_PysForbidTalkDevice)) > 0,  #是否禁言
                  }
    return GMCommon.Def_Success, forbidInfo