5071 【BT2】【主干】【gt_1.100.6】外网出现boss无法死亡。(添加死亡检查日志明细)
3个文件已修改
67 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_186.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AIType_186.py
@@ -107,10 +107,11 @@
    if dropOwnerType not in [ChConfig.DropOwnerType_MaxHurt]:
        return True
    npcControl = NPCCommon.NPCControl(curNPC)
    tagObj = npcControl.RefreshDropOwner(tick, 0)
    tagObj = npcControl.RefreshDropOwner(tick, 0, checkCanDead=True)
    if not atkObj or not tagObj:
        GameObj.SetHP(curNPC, 1)
        GameWorld.ErrLog("Boss当前状态下不可以死亡!npcID=%s" % curNPC.GetNPCID())
        skillID = 0 if not skill else skill.GetSkillID()
        GameWorld.ErrLog("Boss当前状态下不可以死亡!npcID=%s,skillID=%s,atkObj=%s,tagObj=%s" % (curNPC.GetNPCID(), skillID, atkObj, tagObj))
        return False
    return True
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -5208,7 +5208,7 @@
    
    ##----------------------------------------- 归属 -----------------------------------------------
    
    def RefreshDropOwner(self, tick, refreshInterval=3000, isDead=False):
    def RefreshDropOwner(self, tick, refreshInterval=3000, isDead=False, checkCanDead=False):
        ## 刷新boss掉落归属
        # @return: 可攻击的掉落归属目标玩家
        
@@ -5219,8 +5219,11 @@
        if isDead:
            GameWorld.Log("Boss死亡: lineID=%s,objID=%s,npcID=%s,dropOwnerType=%s" 
                          % (GameWorld.GetGameWorld().GetLineID(), curNPC.GetID(), curNPC.GetNPCID(), dropOwnerType))
        if checkCanDead:
            GameWorld.Log("检查Boss死亡: lineID=%s,objID=%s,npcID=%s,dropOwnerType=%s"
                          % (GameWorld.GetGameWorld().GetLineID(), curNPC.GetID(), curNPC.GetNPCID(), dropOwnerType))
        #if dropOwnerType == ChConfig.DropOwnerType_MaxHurt:
        maxHurtInfo = NPCHurtManager.RefreshHurtList(curNPC, tick, refreshInterval, isDead)
        maxHurtInfo = NPCHurtManager.RefreshHurtList(curNPC, tick, refreshInterval, isDead, checkCanDead)
        if not maxHurtInfo:
            maxHurtInfo = NPCHurtMgr.RefreshHurtList(curNPC, tick, refreshInterval, isDead)
            
@@ -5238,7 +5241,7 @@
            if tagObj:
                ownerType, ownerID = ChConfig.Def_NPCHurtTypePlayer, tagObj.GetPlayerID()
                
        if isDead:
        if isDead or checkCanDead:
            GameWorld.Log("ownerType=%s, ownerID=%s, tagObjID=%s" % (ownerType, ownerID, 0 if not tagObj else tagObj.GetPlayerID()))
                
        # 没有攻击目标,则刷新仇恨,支持主动怪
@@ -5251,6 +5254,8 @@
                angryObjType = maxAngry.GetObjType()
                #GameWorld.DebugLog("最大仇恨目标: ID=%s, Type=%s" % (angryID, angryObjType))
                maxAngryObj = GameWorld.GetObj(angryID, angryObjType)
                if isDead or checkCanDead:
                    GameWorld.Log("最大仇恨目标: ID=%s, Type=%s,maxAngryObj=%s" % (angryID, angryObjType, maxAngryObj))
                
            tagObj = maxAngryObj
            if angryObjType == IPY_GameWorld.gotPlayer and maxAngryObj and not ownerType:
@@ -5261,7 +5266,7 @@
                else:
                    ownerType, ownerID = ChConfig.Def_NPCHurtTypePlayer, maxAngryObj.GetPlayerID()
            
            if isDead:
            if isDead or checkCanDead:
                GameWorld.Log("angryObj, ownerType=%s, ownerID=%s" % (ownerType, ownerID))
                
        self.UpdateDropOwner(tick, ownerType, ownerID, isDead)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py
@@ -79,6 +79,7 @@
        
        self.__assistAwardItemID = 0 # 协助奖励礼盒ID
        self.__assistAwardResult = {} # {playerID:{assistPlayerID:{协助玩家信息数据字典}, ...}}
        self.logDetail = False # 是否输出日志明细
        return
    
    def Clear(self):
@@ -450,12 +451,13 @@
                
        return
    
    def RefreshHurtList(self, tick, refreshInterval=3000, isDead=False):
    def RefreshHurtList(self, tick, refreshInterval=3000, isDead=False, checkCanDead=False):
        ## 刷新伤血列表
        # @return: atkPlayer, hurtID, hurtType
        
        curNPC = self.curNPC
        self.logDetail = (isDead or checkCanDead)
        if not isDead:
            if refreshInterval and tick - curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_LastRefreshHurtTick) < refreshInterval:
                return self.__GetAtkObjByHurtList(isDead)
@@ -467,6 +469,9 @@
        for hurtKey in self.__hurtDict.keys():
            #获得伤血对象
            hurtID, hurtType = hurtKey
            if self.logDetail:
                GameWorld.Log("    hurtID=%s, hurtType=%s" % (hurtID, hurtType))
            if not hurtID:
                continue
            
@@ -483,6 +488,9 @@
                    if self.__UnAssistPlayerHurtValidLogic(teamPlayerID, refreshPoint, tick):
                        hurtPlayerDict[teamPlayerID] = teamID
                        
        if self.logDetail:
            GameWorld.Log("    hurtPlayerDict=%s" % str(hurtPlayerDict))
        mapID = GameWorld.GetMap().GetMapID()
        if NPCCommon.IsMapNeedBossShunt(mapID):
            self.__UpdBossShuntInfo(mapID, hurtPlayerDict, tick)
@@ -513,11 +521,15 @@
        ## 玩家伤血是否还有效
        
        if playerID not in self.__hurtPlayerDict:
            if self.logDetail:
                GameWorld.Log("        playerID=%s not in self.__hurtPlayerDict" % playerID)
            return False
        
        hurtPlayer = self.__GetHurtPlayer(playerID)
        hurtValue = hurtPlayer.GetHurtValue()
        if not hurtValue:
            if self.logDetail:
                GameWorld.Log("        playerID=%s not hurtValue" % playerID)
            return False
        
        player = GameWorld.GetMapCopyPlayerManager().FindPlayerByID(playerID)
@@ -525,20 +537,28 @@
            if playerID in self.__noAssitPlayerIDDict:
                if not AttackCommon.CheckKillNPCByCnt(player, self.curNPC, False):
                    GameWorld.DebugLog("非协助伤血玩家没有攻击boss次数,不计!playerID=%s" % playerID, self.npcID, self.lineID)
                    if self.logDetail:
                        GameWorld.Log("        非协助伤血玩家没有攻击boss次数,不计!playerID=%s" % playerID, self.npcID, self.lineID)
                    return False
                
            if player.GetInitOK() and (not player.GetVisible() or player.GetSightLevel() != self.curNPC.GetSightLevel()):
                GameWorld.DebugLog("伤血玩家不可见,不计!playerID=%s" % playerID, self.npcID, self.lineID)
                if self.logDetail:
                    GameWorld.Log("        伤血玩家不可见,不计!playerID=%s" % playerID, self.npcID, self.lineID)
                return False
            
            if GameObj.GetHP(player) <= 0 or player.GetPlayerAction() == IPY_GameWorld.paDie:
                deadTime = player.NomalDictGetProperty(ChConfig.Def_Player_Dict_DeadTime)
                if time.time() - deadTime >= IpyGameDataPY.GetFuncCfg("BossHurtValue", 1):
                    GameWorld.DebugLog("伤血玩家死亡超过伤血保护时长,不计!playerID=%s" % playerID, self.npcID, self.lineID)
                    if self.logDetail:
                        GameWorld.Log("        伤血玩家死亡超过伤血保护时长,不计!playerID=%s" % playerID, self.npcID, self.lineID)
                    return False
                
            if not self.__GetIsInRefreshPoint(player.GetPosX(), player.GetPosY(), refreshPoint):
                GameWorld.DebugLog("伤血玩家不在boss范围内,不计!playerID=%s" % playerID, self.npcID, self.lineID)
                if self.logDetail:
                    GameWorld.DebugLog("        伤血玩家不在boss范围内,不计!playerID=%s" % playerID, self.npcID, self.lineID)
                return False
            
            return True
@@ -550,14 +570,20 @@
            leavePos = PlayerControl.GetPlayerLeaveServerPos(playerID)
            if not leaveTick or not leavePos:
                GameWorld.DebugLog("伤血玩家不在本地图或已长久离线,不计!playerID=%s" % playerID, self.npcID, self.lineID)
                if self.logDetail:
                    GameWorld.DebugLog("        伤血玩家不在本地图或已长久离线,不计!playerID=%s" % playerID, self.npcID, self.lineID)
                return False
            
            if tick - leaveTick > ChConfig.Def_PlayerOfflineProtectTime:
                GameWorld.DebugLog("伤血离线玩家超过保护时长,不计!playerID=%s,tick=%s,leaveTick=%s" % (playerID, tick, leaveTick), self.npcID, self.lineID)
                if self.logDetail:
                    GameWorld.DebugLog("        伤血离线玩家超过保护时长,不计!playerID=%s,tick=%s,leaveTick=%s" % (playerID, tick, leaveTick), self.npcID, self.lineID)
                return False
            
            if not self.__GetIsInRefreshPoint(leavePos[0], leavePos[1], refreshPoint):
                GameWorld.DebugLog("伤血离线玩家不在保护区域内,不计!playerID=%s,leavePos=%s" % (playerID, leavePos), self.npcID, self.lineID)
                if self.logDetail:
                    GameWorld.DebugLog("        伤血离线玩家不在保护区域内,不计!playerID=%s,leavePos=%s" % (playerID, leavePos), self.npcID, self.lineID)
                return False
            
            return True
@@ -620,11 +646,18 @@
        atkPlayer, atkHurtType, atkHurtID = None, 0, 0
        curNPC = self.curNPC
        refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex())
        if self.logDetail:
            GameWorld.Log("__GetAtkObjByHurtList: %s" % len(self.__hurtSortList))
        for rank, hurtObj in enumerate(self.__hurtSortList, 1):
            
            hurtID = hurtObj.GetValueID()
            hurtType = hurtObj.GetValueType()
            
            if self.logDetail:
                GameWorld.Log("    hurtID=%s,hurtType=%s" % (hurtID, hurtType))
            playerIDList = []
            if hurtType == ChConfig.Def_NPCHurtTypePlayer:
                assistPlayerIDList = self.__noAssitPlayerIDDict.get(hurtID, [])
@@ -649,6 +682,7 @@
                
                player = GameWorld.GetObj(playerID, IPY_GameWorld.gotPlayer)
                if player == None:
                    playerDisableReason[playerID] = "none"
                    continue
                
                if GameObj.GetHP(player) <= 0 or player.GetPlayerAction() == IPY_GameWorld.paDie:
@@ -672,11 +706,18 @@
                    maxHurtValue = hurtValue
                    atkPlayer, atkHurtType, atkHurtID = player, hurtType, hurtID
                    
            if self.logDetail:
                GameWorld.Log("    atkHurtType=%s,atkHurtID=%s,playerDisableReason=%s" % (atkHurtType, atkHurtID, str(playerDisableReason)))
            if maxHurtValue:
                return atkPlayer, atkHurtType, atkHurtID
            
            if rank == 1 and isDead:
                GameWorld.Log("boss死亡时,第一名团队没有归属权! playerDisableReason=%s" % playerDisableReason)
            if self.logDetail:
                GameWorld.Log("    团队没有归属权! rank=%s,hurtID=%s,hurtType=%s,playerDisableReason=%s"
                              % (rank, hurtID, hurtType, playerDisableReason))
                
        return atkPlayer, atkHurtType, atkHurtID
    
@@ -1046,13 +1087,13 @@
    defendHurtList.AddPlayerHurtValue(atkPlayerID, atkPlayer.GetPlayerName(), value, atkPlayer.GetTeamID())
    return True
def RefreshHurtList(curNPC, tick, refreshInterval=3000, isDead=False):
def RefreshHurtList(curNPC, tick, refreshInterval=3000, isDead=False, checkCanDead=False):
    ## 刷新伤血列表
    # @return: atkPlayer, ownerType, ownerID
    defendHurtList = GetPlayerHurtList(curNPC)
    if not defendHurtList:
        return
    return defendHurtList.RefreshHurtList(tick, refreshInterval, isDead)
    return defendHurtList.RefreshHurtList(tick, refreshInterval, isDead, checkCanDead)
def IsAssistPlayer(playerID, defNPC):
    ## 是否协助中的玩家