8854 子 【主干】【BT2】【GM】【后端】后台实现封禁玩家设备ID号后,聊天禁言
12个文件已修改
92 ■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_ForbidTalk.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_UnForbidTalk.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGMOper.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTForbidTalk.py 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTUnForbidTalk.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMCommon.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_ForbidTalk.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetForbidInfo.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerForbid.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_UnForbidTalk.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_ForbidTalk.py
@@ -41,6 +41,7 @@
    
    forbitHour = gmCmdDict.get("forbitHour", '')
    forbitMinute = gmCmdDict.get("forbitMinute", '')
    forbidDevice = gmCmdDict.get("forbidDevice", '')
    
    if not forbitHour or not forbitHour.isdigit() or not forbitMinute or not forbitMinute.isdigit():
        GMCommon.GMCommandResult(orderId, gmCmdDict, GMCommon.Def_ParamErr)
@@ -67,7 +68,7 @@
    # ֪ͨmap
    if playerFind != "":
        GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind,
                                         gmCmdDict, 'GMTForbidTalk', [forbitTotalMinute])
                                         gmCmdDict, 'GMTForbidTalk', [forbitTotalMinute, forbidDevice])
        return
    
ServerPython/CoreServerGroup/GameServer/Script/GM/Commands/GMT_UnForbidTalk.py
@@ -40,6 +40,7 @@
    # 获得并转换字符串
    playerName = gmCmdDict.get(GMCommon.Def_GMKey_PlayerName, '')
    playerAccID = gmCmdDict.get(GMCommon.Def_GMKey_PlayerAccID, '')
    unForbidDevice = gmCmdDict.get("unForbidDevice", '')
    
    playerFind = ''
    # 账号禁言
@@ -54,7 +55,7 @@
    # 通过账号锁定
    if playerFind != '':
        GMCommon.GMTool_MapServer_Query(queryType, orderId, playerFind,
                                         gmCmdDict, 'GMTUnForbidTalk', [])
                                         gmCmdDict, 'GMTUnForbidTalk', [unForbidDevice])
        return
    forbidAccIP = gmCmdDict.get(GMCommon.Def_GMKey_IP, '')
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -1596,7 +1596,8 @@
(
Def_PysForbidByPy,
Def_PysForbidTalk,
) = range(4, 4 + 2)
Def_PysForbidTalkDevice,
) = range(4, 4 + 3)
#---玩家生产系统-------------------------------------------
#生产采集状态枚举值
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -5982,17 +5982,41 @@
# 禁言 通知gameServer
def SetGMForbidenTalk(curPlayer, value):
    curPlayer.SetGMForbidenTalk(value)
    curPlayer.SendGameServerRefreshState(ShareDefine.CDBPlayerRefresh_ForbidenTalk, value)
    curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ForbidenTalk, value, False)
    ''' 设置是否禁言
    @param value: 0-解禁;1-禁言;2-禁设备;3-解设备
    禁设备流程
    1.先设置2通知前端写入禁设备记录(前端处理当为2时本地设备标记为禁设备)
    2.再设置1,此时前后端状态均为1,即角色禁言
    解禁设备流程
    1.先设置3通知前端删除禁设备记录
    2.再设置0,此时前后端状态均为1,即角色解禁
    '''
    __SetGMForbidenTalkValue(curPlayer, value)
    
    #同步设置离线DB玩家账号状态值
    accState = curPlayer.GetAccState()
    if value:
    if value == 2:
        accState = accState | pow(2, ChConfig.Def_PysForbidTalkDevice)
        accState = accState | pow(2, ChConfig.Def_PysForbidTalk)
    elif value == 1:
        accState = accState | pow(2, ChConfig.Def_PysForbidTalk)
    elif value == 3:
        if (accState & pow(2, ChConfig.Def_PysForbidTalkDevice)):
            accState = accState ^ pow(2, ChConfig.Def_PysForbidTalkDevice)
        if (accState & pow(2, ChConfig.Def_PysForbidTalk)):
            accState = accState ^ pow(2, ChConfig.Def_PysForbidTalk)
    elif (accState & pow(2, ChConfig.Def_PysForbidTalk)) > 0:
        accState = accState ^ pow(2, ChConfig.Def_PysForbidTalk)
    SetPlayerAccState(curPlayer, accState)
    return
def __SetGMForbidenTalkValue(curPlayer, value):
    curPlayer.SetGMForbidenTalk(value)
    curPlayer.SendGameServerRefreshState(ShareDefine.CDBPlayerRefresh_ForbidenTalk, value)
    curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ForbidenTalk, value, False)
    GameWorld.DebugLog("__SetGMForbidenTalkValue %s" % value, curPlayer.GetPlayerID())
    return
def SetPlayerAccState(curPlayer, accState):
@@ -6000,21 +6024,22 @@
    curPlayer.SetExAttr17(accState) # 同步设置该值 0309 封包登录时需要用到
    curPlayer.SendGameServerRefreshState(ShareDefine.CDBPlayerRefresh_ExAttr17, accState)
    curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ExAttr17, accState, False)
    GameWorld.DebugLog("SetPlayerAccState %s" % (accState))
    GameWorld.DebugLog("SetPlayerAccState %s" % (accState), curPlayer.GetPlayerID())
    return
def DoGMForbidenTalkOnLogin(curPlayer):
    ## 离线时被禁言,此时DB的账号状态值为禁言状态,但是GMOper暂时没有禁言操作命令,故上线时检查设置下离线禁言状态
    ## 目前离线时被禁言的,暂时只处理AccState ExAttr17, GMOper命令暂不处理,所以为永久禁言
    
    if not curPlayer.GetAccState() & pow(2, ChConfig.Def_PysForbidTalk):
        curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ForbidenTalk, 0, False)
        return
    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())
    value = 1
    curPlayer.SetGMForbidenTalk(value)
    curPlayer.SendGameServerRefreshState(ShareDefine.CDBPlayerRefresh_ForbidenTalk, value)
    curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ForbidenTalk, value, False)
        __SetGMForbidenTalkValue(curPlayer, 1)
    else:
        curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ForbidenTalk, 0, False)
    return
## 协助目标玩家ID
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGMOper.py
@@ -181,7 +181,7 @@
#  @remarks 函数详细说明.
def __Do_ForbidTalk(curPlayer):
    if not curPlayer.GetGMForbidenTalk():
        PlayerControl.SetGMForbidenTalk(curPlayer, True)
        PlayerControl.SetGMForbidenTalk(curPlayer, 1)
    
    return
@@ -191,7 +191,7 @@
#  @remarks 函数详细说明.
def __Cancel_ForbidTalk(curPlayer):
    if curPlayer.GetGMForbidenTalk():
        PlayerControl.SetGMForbidenTalk(curPlayer, False)
        PlayerControl.SetGMForbidenTalk(curPlayer, 0)
    
    return
#---------------------------------------------------------------------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTForbidTalk.py
@@ -47,13 +47,16 @@
    curFindPlayer_GMOper = curFindPlayer.GetGMOperManager()
    gmOper = curFindPlayer_GMOper.AddGMOper(IPY_GameWorld.gmForbidTalk)
    lastTime = int(packCMDList[0])
    forbidDevice = packCMDList[1] if len(packCMDList) > 1 else ""
    gmOper.SetGMAccID(curFindPlayer.GetAccID())
    gmOper.SetLastTime(lastTime)
    
    GameWorld.DebugLog("    解禁时间=%s" % str(gmOper.GetEndTime()))
    GameWorld.DebugLog("    forbidDevice=%s,解禁时间=%s" % (forbidDevice, str(gmOper.GetEndTime())))
    
    curFindPlayer_GMOper.Sync_SaveToDB()
    
    if forbidDevice:
        PlayerControl.SetGMForbidenTalk(curFindPlayer, 2)
    PlayerControl.SetGMForbidenTalk(curFindPlayer, 1)
    #PlayerControl.NotifyCode(curFindPlayer, "GeRen_chenxin_80731", [lastTime])
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_GMTUnForbidTalk.py
@@ -40,7 +40,7 @@
    if not curFindPlayer or curFindPlayer.IsEmpty():
        return ''
    unForbidDevice = packCMDList[0] if len(packCMDList) > 0 else ""
    curFindName = curFindPlayer.GetPlayerName()
    #流向
    DataRecordPack.DR_ToolGMOperate(query_ID, curFindName, curFindPlayer.GetAccID(), 'GMTUnForbidTalk')
@@ -54,6 +54,8 @@
            curFindPlayer_GMOper.Sync_SaveToDB()
            break
    
    if unForbidDevice:
        PlayerControl.SetGMForbidenTalk(curFindPlayer, 3)
    PlayerControl.SetGMForbidenTalk(curFindPlayer, 0)
    #PlayerControl.NotifyCode(curFindPlayer, "GeRen_liubo_97211")
    return ''
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMCommon.py
@@ -89,7 +89,8 @@
(
Def_PysForbidByPy,
Def_PysForbidTalk,
) = range(4, 4 + 2 )
Def_PysForbidTalkDevice,
) = range(4, 4 + 3)
Def_GMKey_Type = 'pack_type'
Def_GMKey_ResultType = 'ResultType'
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_ForbidTalk.py
@@ -92,11 +92,15 @@
    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, GMCommon.Def_PysForbidTalk)) > 0:
    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)
@@ -104,6 +108,7 @@
    # 记录流向
    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, ''
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetForbidInfo.py
@@ -96,7 +96,7 @@
            accID = player.get('AccID', "")
            forbidLoginList.append(accID)
        
        if (accState & pow(2, GMCommon.Def_PysForbidTalk)) > 0:
        if (accState & pow(2, GMCommon.Def_PysForbidTalk)) > 0 or (accState & pow(2, GMCommon.Def_PysForbidTalkDevice)) > 0:
            accID = player.get('AccID', "")
            forbidTalkList.append(accID)
    
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_GetPlayerForbid.py
@@ -90,7 +90,7 @@
    accState = findPlayer[0].get('AccState', 0)
    forbidInfo = {
                  'forbidLogin':(accState & pow(2, GMCommon.Def_PysForbidByPy)) > 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
ServerPython/db/PyMongoDataServer/GMToolLogicProcess/Commands/GMT_UnForbidTalk.py
@@ -94,11 +94,15 @@
    if not loadOK:
        return GMCommon.Def_NoTag, ''
    
    unForbidDevice = gmCmdDict.get("unForbidDevice", '')
    unForbidType = GMCommon.Def_PysForbidTalkDevice if unForbidDevice else GMCommon.Def_PysForbidTalk
    # 玩家账号正常
    if (dbPlayer.AccState & pow(2, GMCommon.Def_PysForbidTalk)) <= 0:
    if (dbPlayer.AccState & pow(2, unForbidType)) <= 0:
        return GMCommon.Def_NoNeed, ''
        
    # 设置玩家账号状态
    dbPlayer.AccState = dbPlayer.AccState ^ pow(2, unForbidType)
    if unForbidType == GMCommon.Def_PysForbidTalkDevice and (dbPlayer.AccState & pow(2, GMCommon.Def_PysForbidTalk)):
    dbPlayer.AccState = dbPlayer.AccState ^ pow(2, GMCommon.Def_PysForbidTalk)
    dbPlayer.ExAttr17 = dbPlayer.AccState
    dbPlayer.adoUpdateC(collection)
@@ -106,6 +110,7 @@
    # 记录流向
    dataDic = {"PlayerID":dbPlayer.PlayerID, 'AccID':playerAccID}
    GMCommon.SendEventPack(gmCmdDict.get(GMCommon.Def_GMKey_Type, ''), dataDic)
    mylog.info("GMT_UnForbidTalk: playerAccID=%s,unForbidType=%s,AccState=%s" % (playerAccID, unForbidType, dbPlayer.AccState))
    return GMCommon.Def_Success, ''