| | |
| | | if (curPlayer.GetAccState() & pow(2, ChConfig.Def_PysForbidByPy)) <= 0:
|
| | | return True
|
| | |
|
| | | GameWorld.Log("玩家被封号禁止登录" , curPlayer.GetPlayerID())
|
| | | curPlayer.Kick(IPY_GameWorld.disGMKick)
|
| | | return
|
| | |
|
| | |
| | |
|
| | |
|
| | | def OnPlayerLogin(curPlayer):
|
| | | DoGMForbidenTalkOnLogin(curPlayer)
|
| | | #DoGMForbidenTalkOnLogin(curPlayer)
|
| | | curPlayer.SetDict(ChConfig.Def_PDict_DayOnlineCalcTime, int(time.time()))
|
| | | return
|
| | |
|
| | |
| | | GameWorld.DebugLog("SetPlayerAccState %s" % (accState), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | def DoGMForbidenTalkOnLogin(curPlayer):
|
| | | ## 离线时被禁言,此时DB的账号状态值为禁言状态,但是GMOper暂时没有禁言操作命令,故上线时检查设置下离线禁言状态
|
| | | ## 目前离线时被禁言的,暂时只处理AccState ExAttr17, GMOper命令暂不处理,所以为永久禁言
|
| | | |
| | | if curPlayer.GetAccState() & pow(2, ChConfig.Def_PysForbidTalkDevice):
|
| | | GameWorld.Log("上线时角色为被设备禁言状态!", curPlayer.GetPlayerID())
|
| | | __SetGMForbidenTalkValue(curPlayer, 2)
|
| | | __SetGMForbidenTalkValue(curPlayer, 1)
|
| | | elif curPlayer.GetAccState() & pow(2, ChConfig.Def_PysForbidTalk):
|
| | | GameWorld.Log("上线时角色为被禁言状态!", curPlayer.GetPlayerID())
|
| | | __SetGMForbidenTalkValue(curPlayer, 1)
|
| | | else:
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ForbidenTalk, 0)
|
| | | return
|
| | | #GM命令支持离线玩家上线后处理,且 PlayerGMOper 也有上线触发逻辑处理,故暂屏蔽
|
| | | #def DoGMForbidenTalkOnLogin(curPlayer):
|
| | | # ## 离线时被禁言,此时DB的账号状态值为禁言状态,但是GMOper暂时没有禁言操作命令,故上线时检查设置下离线禁言状态
|
| | | # ## 目前离线时被禁言的,暂时只处理AccState ExAttr17, GMOper命令暂不处理,所以为永久禁言
|
| | | # |
| | | # if curPlayer.GetAccState() & pow(2, ChConfig.Def_PysForbidTalkDevice):
|
| | | # GameWorld.Log("上线时角色为被设备禁言状态!", curPlayer.GetPlayerID())
|
| | | # __SetGMForbidenTalkValue(curPlayer, 2)
|
| | | # __SetGMForbidenTalkValue(curPlayer, 1)
|
| | | # elif curPlayer.GetAccState() & pow(2, ChConfig.Def_PysForbidTalk):
|
| | | # GameWorld.Log("上线时角色为被禁言状态!", curPlayer.GetPlayerID())
|
| | | # __SetGMForbidenTalkValue(curPlayer, 1)
|
| | | # else:
|
| | | # SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ForbidenTalk, 0)
|
| | | # return
|
| | |
|
| | | def IsMainLevelPass(curPlayer, lvID):
|
| | | ## 判断玩家是否过关某个主线关卡ID
|
| | |
| | | if checkGMForbidenTalk and GetGMToolForbidTalk(curPlayer):
|
| | | #GeRen_chenxin_921745 对不起,您已被GM禁言,发送信息失败
|
| | | #PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_921745")
|
| | | GameWorld.DebugLog("已被禁言!", curPlayer.GetPlayerID())
|
| | | return False
|
| | |
|
| | | #间隔时间
|
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #---------------------------------------------------------------------
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | ##@package GMT_UnForbidLogin.py
|
| | | # GM命令解锁玩家账号
|
| | | ##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_ForbidLogin
|
| | | #
|
| | | # @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
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | from Player import (PlayerControl)
|
| | | from Collections.CollectionDefine import *
|
| | | import IPY_GameWorld
|
| | | import DataRecordPack
|
| | | import PyGameData
|
| | | import ChConfig
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## 收到gm命令执行
|
| | | # @param gmCmdDict:gm命令字典
|
| | | # @return None |
| | | def OnExec(gmCmdDict):
|
| | | playerAccID = gmCmdDict.get(GMCommon.Def_GMKey_PlayerAccID, '')
|
| | | playerName = gmCmdDict.get(GMCommon.Def_GMKey_PlayerName, '')
|
| | | queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
|
| | | #playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '')
|
| | | if queryType == "IP":
|
| | | return __doForbidLoginByIP(gmCmdDict)
|
| | |
|
| | | if playerAccID != '':
|
| | | return GMCommon.Def_DoQueryLogDB, ''
|
| | | forbidType = gmCmdDict.get("forbidType", '')
|
| | |
|
| | | elif playerName != '': |
| | | return GMCommon.Def_DoQueryUserDB, '%s'%GMCommon.Def_GMKey_PlayerName
|
| | | # 回复
|
| | | return GMCommon.Def_ParamErr, ''
|
| | | errorMsg = "" |
| | | from GMToolLogicProcess import ProjSpecialProcess
|
| | | Result, curPlayer = ProjSpecialProcess.GMCmdPlayerValidation(gmCmdDict, False) # 不支持离线处理
|
| | | if Result == GMCommon.Def_PlayerOfLine:
|
| | | dbPlayer = curPlayer
|
| | | return __doForbidLoginByDBPlayer(dbPlayer, forbidType)
|
| | |
|
| | | if Result != GMCommon.Def_Success:
|
| | | 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 forbidType == "1":
|
| | | # 玩家在线,可处理
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | Result = GMCommon.Def_Unknow
|
| | | #GMT_Name = gmCmdDict.get(GMCommon.Def_GMKey_Type, '') |
| | |
|
| | | if playerAccID != '' and GMCommon.GetPlayerOnLineByAccID(logdb, playerAccID):
|
| | | return GMCommon.Def_SendToGameServer, ''
|
| | | PlayerControl.SetPlayerAccState(curPlayer, curPlayer.GetAccState() | pow(2, ChConfig.Def_PysForbidByPy))
|
| | | DataRecordPack.DR_ToolGMOperate(playerID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), "GMTFobidLogin")
|
| | | curPlayer.Kick(IPY_GameWorld.disGMKick)
|
| | |
|
| | | # 转换字符串
|
| | | if data != '' and GMCommon.GetPlayerOnLineByAccID(logdb, data): |
| | | return GMCommon.Def_SendToGameServer, ''
|
| | | else:
|
| | | return GMCommon.Def_NoNeed, "玩家正常在线"
|
| | |
|
| | | return GMCommon.Def_DoQueryUserDB, ''
|
| | | return GMCommon.Def_Success
|
| | |
|
| | | def __doForbidLoginByDBPlayer(dbPlayer, forbidType):
|
| | | ## 离线根据dbPlayer处理
|
| | |
|
| | | ## 查询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})
|
| | | col = PyGameData.g_usrCtrlDB.db[UCN_DBPlayer]
|
| | |
|
| | | if playerAccID == '':
|
| | | return GMCommon.Def_NoTag, ''
|
| | | playerID = dbPlayer.PlayerID
|
| | | playerName = dbPlayer.PlayerName
|
| | | accID = dbPlayer.AccID
|
| | |
|
| | | # 返回playerid,判断是否在线
|
| | | if data == '%s'%GMCommon.Def_GMKey_PlayerName: |
| | | return GMCommon.Def_DoQueryLogDB, playerAccID
|
| | | |
| | | collection = userdb[UCN_DBPlayer]
|
| | | dbPlayer = DataServerPlayerData.tagDBPlayer()
|
| | | dbPlayer.IsDeleted = 0
|
| | | |
| | | loadOK = dbPlayer.adoLoadCEx(collection, {'AccID':fix_incomingText(playerAccID),
|
| | | 'IsDeleted':dbPlayer.IsDeleted}) |
| | | if not loadOK:
|
| | | # 回复gm
|
| | | return GMCommon.Def_NoTag, ''
|
| | | |
| | | # 已是锁定状态
|
| | | if forbidType == "1":
|
| | | if (dbPlayer.AccState & pow(2, GMCommon.Def_PysForbidByPy)) > 0:
|
| | | return GMCommon.Def_NoNeed, ''
|
| | | return GMCommon.Def_NoNeed, "已经被封号了"
|
| | |
|
| | | # 设置玩家账号状态
|
| | | dbPlayer.AccState = dbPlayer.AccState|pow(2, GMCommon.Def_PysForbidByPy)
|
| | | dbPlayer.ExAttr17 = dbPlayer.AccState
|
| | | dbPlayer.adoUpdateC(collection)
|
| | | dbPlayer.adoUpdateC(col)
|
| | | |
| | | gmToolCmd = "GMTFobidLogin"
|
| | | else:
|
| | | if (dbPlayer.AccState & pow(2, GMCommon.Def_PysForbidByPy)) <= 0:
|
| | | return GMCommon.Def_NoNeed, "玩家账号正常"
|
| | | |
| | | # 设置玩家账号状态
|
| | | dbPlayer.AccState = dbPlayer.AccState ^ pow(2, GMCommon.Def_PysForbidByPy)
|
| | | dbPlayer.ExAttr17 = dbPlayer.AccState
|
| | | dbPlayer.adoUpdateC(col)
|
| | | |
| | | gmToolCmd = "GMTFobidLogin"
|
| | |
|
| | | # 记录流向
|
| | | dataDic = {"PlayerID":dbPlayer.PlayerID, 'AccID':playerAccID}
|
| | | GMCommon.SendEventPack(gmCmdDict.get(GMCommon.Def_GMKey_Type, ''), dataDic)
|
| | | return GMCommon.Def_Success, ''
|
| | | DataRecordPack.DR_ToolGMOperate(playerID, playerName, accID, gmToolCmd)
|
| | | return GMCommon.Def_Success
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | def __doForbidLoginByIP(gmCmdDict):
|
| | | Result = GMCommon.Def_Unknow
|
| | | # 暂不支持,后续扩展,需要处理全局管理
|
| | | return Result, "暂不支持"
|
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #---------------------------------------------------------------------
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | #---------------------------------------------------------------------
|
| | | ##@package GMT_ForbidTalk.py
|
| | | # GM命令玩家禁言
|
| | | ##@package PyMongoDB.GMToolLogicProcess.Commands.GMT_ForbidTalk
|
| | | #
|
| | | # @author wdb
|
| | | # @date 2012-6-14
|
| | | # @version 1.1
|
| | | # @todo:GM工具命令 - 禁言/解禁
|
| | | # @author hxp
|
| | | # @date 2026-03-06
|
| | | # @version 1.0
|
| | | #
|
| | | # @note
|
| | | # @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
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | import GameWorld
|
| | | from Player import (PlayerControl)
|
| | | import IPY_GameWorld
|
| | | import DataRecordPack
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## 收到gm命令执行
|
| | | # @param gmCmdDict:gm命令字典
|
| | | # @return None |
| | | def OnExec(gmCmdDict):
|
| | | loginIP = gmCmdDict.get(GMCommon.Def_GMKey_IP, '')
|
| | | playerAccID = gmCmdDict.get(GMCommon.Def_GMKey_PlayerAccID, '')
|
| | | playerName = gmCmdDict.get(GMCommon.Def_GMKey_PlayerName, '')
|
| | |
|
| | | if playerAccID != '':
|
| | | return GMCommon.Def_DoQueryLogDB, ''
|
| | | queryType = gmCmdDict.get(GMCommon.Def_GMKey_QueryType, '')
|
| | | #playerFind = gmCmdDict.get(GMCommon.Def_GMKey_PlayerFind, '')
|
| | | if queryType == "IP":
|
| | | return __doForbidTalkByIP(gmCmdDict)
|
| | |
|
| | | elif loginIP != '':
|
| | | return GMCommon.Def_SendToGameServer, ''
|
| | | errorMsg = "" |
| | | from GMToolLogicProcess import ProjSpecialProcess
|
| | | Result, curPlayer = ProjSpecialProcess.GMCmdPlayerValidation(gmCmdDict)
|
| | | if Result != GMCommon.Def_Success:
|
| | | return Result, errorMsg
|
| | | if not curPlayer:
|
| | | return Result, "玩家不在线,上线后自动处理"
|
| | |
|
| | | elif playerName != '': |
| | | return GMCommon.Def_DoQueryUserDB, '%s'%GMCommon.Def_GMKey_PlayerName
|
| | | # 回复
|
| | | return GMCommon.Def_ParamErr, ''
|
| | | # 玩家在线,可处理
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | Result = GMCommon.Def_Unknow
|
| | | #GMT_Name = gmCmdDict.get(GMCommon.Def_GMKey_Type, '') |
| | |
|
| | | forbidType = gmCmdDict.get("forbidType", '')
|
| | | isDevice = gmCmdDict.get("isDevice", '')
|
| | | forbitDay = GameWorld.ToIntDef(gmCmdDict.get("forbitDay", '0'))
|
| | | forbitHour = GameWorld.ToIntDef(gmCmdDict.get("forbitHour", '0'))
|
| | | forbitMinute = GameWorld.ToIntDef(gmCmdDict.get("forbitMinute", '0'))
|
| | |
|
| | | ## 查询logdb返回
|
| | | # @param logdb:logdb
|
| | | # @param data:传入的信息
|
| | | # @param gmCmdDict:gm命令字典
|
| | | # @return None |
| | | def LogDBResponse(logdb, data, gmCmdDict):
|
| | | playerAccID = gmCmdDict.get(GMCommon.Def_GMKey_PlayerAccID, '')
|
| | | # 禁言
|
| | | if forbidType == "1":
|
| | | if forbitDay <= 0 and forbitHour <= 0 and forbitMinute <= 0:
|
| | | return GMCommon.Def_ParamErr, "需设置禁言时长"
|
| | | forbitTotalMinute = forbitDay * 24 * 60 + forbitHour * 60 + forbitMinute # 禁言时长
|
| | |
|
| | | # 玩家在线
|
| | | if playerAccID != '' and GMCommon.GetPlayerOnLineByAccID(logdb, playerAccID):
|
| | | return GMCommon.Def_SendToGameServer, ''
|
| | | # accid查询
|
| | | if data != '' and GMCommon.GetPlayerOnLineByAccID(logdb, data): |
| | | return GMCommon.Def_SendToGameServer, ''
|
| | | curFindPlayer_GMOper = curPlayer.GetGMOperManager()
|
| | | gmOper = curFindPlayer_GMOper.AddGMOper(IPY_GameWorld.gmForbidTalk)
|
| | | gmOper.SetGMAccID(curPlayer.GetAccID())
|
| | | gmOper.SetLastTime(forbitTotalMinute)
|
| | | curFindPlayer_GMOper.Sync_SaveToDB()
|
| | |
|
| | | return GMCommon.Def_DoQueryUserDB, ''
|
| | | GameWorld.Log("禁言分钟=%s,isDevice=%s,endTime=%s" % (forbitTotalMinute, isDevice, str(gmOper.GetEndTime())), playerID)
|
| | | if isDevice:
|
| | | PlayerControl.SetGMForbidenTalk(curPlayer, 2)
|
| | | PlayerControl.SetGMForbidenTalk(curPlayer, 1)
|
| | | #PlayerControl.NotifyCode(curFindPlayer, "GeRen_chenxin_80731", [lastTime])
|
| | | DataRecordPack.DR_ToolGMOperate(playerID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), "GMTFobidTalk")
|
| | |
|
| | | # 解禁
|
| | | else:
|
| | | curFindPlayer_GMOper = curPlayer.GetGMOperManager()
|
| | | for index in range(curFindPlayer_GMOper.GetCount()):
|
| | | curOper = curFindPlayer_GMOper.GetAt(index)
|
| | | if curOper.GetOper() == IPY_GameWorld.gmForbidTalk:
|
| | | curFindPlayer_GMOper.DeleteOper(IPY_GameWorld.gmForbidTalk)
|
| | | curFindPlayer_GMOper.Sync_SaveToDB()
|
| | | break
|
| | |
|
| | | ## 查询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 isDevice:
|
| | | PlayerControl.SetGMForbidenTalk(curPlayer, 3)
|
| | | PlayerControl.SetGMForbidenTalk(curPlayer, 0)
|
| | | #PlayerControl.NotifyCode(curFindPlayer, "GeRen_liubo_97211")
|
| | | #流向
|
| | | DataRecordPack.DR_ToolGMOperate(playerID, curPlayer.GetPlayerName(), curPlayer.GetAccID(), "GMTUnForbidTalk")
|
| | |
|
| | | if playerAccID == '':
|
| | | return GMCommon.Def_NoTag, ''
|
| | | return GMCommon.Def_Success
|
| | |
|
| | | # 返回playerid,判断是否在线
|
| | | if data == '%s'%GMCommon.Def_GMKey_PlayerName: |
| | | return GMCommon.Def_DoQueryLogDB, playerAccID
|
| | |
|
| | | collection = userdb[UCN_DBPlayer] |
| | | dbPlayer = DataServerPlayerData.tagDBPlayer()
|
| | | dbPlayer.IsDeleted = 0
|
| | |
|
| | | loadOK = dbPlayer.adoLoadCEx(collection, {'AccID':fix_incomingText(playerAccID),
|
| | | 'IsDeleted':dbPlayer.IsDeleted}) |
| | | if not loadOK:
|
| | | return GMCommon.Def_NoTag, ''
|
| | | |
| | | forbidDevice = gmCmdDict.get("forbidDevice", '')
|
| | | forbidType = GMCommon.Def_PysForbidTalkDevice if forbidDevice else GMCommon.Def_PysForbidTalk
|
| | | # 玩家账号已禁
|
| | | if (dbPlayer.AccState & pow(2, forbidType)) > 0:
|
| | | return GMCommon.Def_NoNeed, ''
|
| | | |
| | | # 设置玩家账号状态
|
| | | dbPlayer.AccState = dbPlayer.AccState|pow(2, forbidType)
|
| | | if forbidType == GMCommon.Def_PysForbidTalkDevice:
|
| | | dbPlayer.AccState = dbPlayer.AccState|pow(2, GMCommon.Def_PysForbidTalk)
|
| | | dbPlayer.ExAttr17 = dbPlayer.AccState
|
| | | dbPlayer.adoUpdateC(collection)
|
| | | |
| | | # 记录流向
|
| | | dataDic = {"PlayerID":dbPlayer.PlayerID, 'AccID':playerAccID}
|
| | | GMCommon.SendEventPack(gmCmdDict.get(GMCommon.Def_GMKey_Type, ''), dataDic)
|
| | | mylog.info("GMT_ForbidTalk: playerAccID=%s,forbidType=%s,AccState=%s" % (playerAccID, forbidType, dbPlayer.AccState))
|
| | | return GMCommon.Def_Success, ''
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | def __doForbidTalkByIP(gmCmdDict):
|
| | | Result = GMCommon.Def_Unknow
|
| | | # 暂不支持,后续扩展,需要处理全局管理
|
| | | #gmOper = IPY_GameServer.gmForbidTalk
|
| | | #ipManager = GameWorld.GetGameWorld().GetAllDBIPManage()
|
| | | #根据IP筛选,直接禁言
|
| | | #PlayerControl.SetGMForbidenTalk(curFindPlayer, 1)
|
| | | return Result, "暂不支持"
|
| | |
| | | #!/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
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | #!/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
|