10263 【越南】【英文】【BT】【砍树】后端支持NPC仿真实玩家战斗和快速战斗(优化不创建战斗PK时玩家自身镜像数据同步;)
5个文件已修改
44 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MirrorBattle.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/BaseAttack.py
@@ -1017,6 +1017,9 @@
    if skillMatrix == None:
        #作用范围 作用矩阵
        attackDis = curSkill.GetAtkRadius()
        if not attackDis:
            return resultList
        skillMatrix = ChConfig.MatrixDict.get(attackDis, None)
        if skillMatrix == None and attackDis not in [Def_SearchMap_Player, Def_SearchMap_NPC]:
            GameWorld.ErrLog("CheckAreaObj skillId=%s, attakDis=%s not in matrixDict=%s" 
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/MirrorAttack.py
@@ -558,6 +558,11 @@
        sendMsg["isChangeMap"] = 1
        PlayerControl.PlayerEnterFB(curPlayer, mapID, funcLineID, reqInfoEx=sendMsg)
        return True
    # 玩家自身需要用镜像的情况
    if isSysbg and playerID and playerID in mirrorIDList:
        PlayerViewCacheTube.NormalSyncPackData(curPlayer)
    sendMsg = str(sendMsg)
    GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "ReuestPlayerPackData", sendMsg, len(sendMsg))
    GameWorld.DebugLog("请求创建镜像战斗: %s" % sendMsg, playerID)
@@ -1018,9 +1023,10 @@
        realPlayerID = player.GetRealPlayerID()
        hp = GameObj.GetHP(player)
        hpMax = GameObj.GetMaxHP(player)
        fightPower = PlayerControl.GetFightPower(player)
        
        GameWorld.DebugLog("剩余血量: %s/%s, 护盾:%s/%s,playerID=%s,realPlayerID=%s,faction=%s"
                           % (hp, hpMax, PlayerControl.GetProDef(player), PlayerControl.GetMaxProDef(player), playerID, realPlayerID, faction), battleID)
        GameWorld.DebugLog("剩余血量: %s/%s, 护盾:%s/%s,playerID=%s,realPlayerID=%s,faction=%s,fightPower=%s"
                           % (hp, hpMax, PlayerControl.GetProDef(player), PlayerControl.GetMaxProDef(player), playerID, realPlayerID, faction, fightPower), battleID)
        if faction == 1:
            battle.curHP += hp
            battle.curHPMax += hpMax
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -2749,6 +2749,10 @@
                   [0,0],[-1,0],[-1,-1],[0,-1],[1,-1],[1,0],[1,1],[0,1],[-1,1],[-2,1],[-2,0],[-2,-1],[-2,-2],[-1,-2],[0,-2],[1,-2],[2,-2],[2,-1],[2,0],[2,1],[2,2],[1,2],[0,2],[-1,2],[-2,2],[-3,2],[-3,1],[-3,0],[-3,-1],[-3,-2],[-3,-3],[-2,-3],[-1,-3],[0,-3],[1,-3],[2,-3],[3,-3],[3,-2],[3,-1],[3,0],[3,1],[3,2],[3,3],[2,3],[1,3],[0,3],[-1,3],[-2,3],[-3,3],[-4,3],[-4,2],[-4,1],[-4,0],[-4,-1],[-4,-2],[-4,-3],[-4,-4],[-3,-4],[-2,-4],[-1,-4],[0,-4],[1,-4],[2,-4],[3,-4],[4,-4],[4,-3],[4,-2],[4,-1],[4,0],[4,1],[4,2],[4,3],[4,4],[3,4],[2,4],[1,4],[0,4],[-1,4],[-2,4],[-3,4],[-4,4],[-5,4],[-5,3],[-5,2],[-5,1],[-5,0],[-5,-1],[-5,-2],[-5,-3],[-5,-4],[-5,-5],[-4,-5],[-3,-5],[-2,-5],[-1,-5],[0,-5],[1,-5],[2,-5],[3,-5],[4,-5],[5,-5],[5,-4],[5,-3],[5,-2],[5,-1],[5,0],[5,1],[5,2],[5,3],[5,4],[5,5],[4,5],[3,5],[2,5],[1,5],[0,5],[-1,5],[-2,5],[-3,5],[-4,5],[-5,5],[-6,5],[-6,4],[-6,3],[-6,2],[-6,1],[-6,0],[-6,-1],[-6,-2],[-6,-3],[-6,-4],[-6,-5],[-6,-6],[-5,-6],[-4,-6],[-3,-6],[-2,-6],[-1,-6],[0,-6],[1,-6],[2,-6],[3,-6],[4,-6],[5,-6],[6,-6],[6,-5],[6,-4],[6,-3],[6,-2],[6,-1],[6,0],[6,1],[6,2],[6,3],[6,4],[6,5],[6,6],[5,6],[4,6],[3,6],[2,6],[1,6],[0,6],[-1,6],[-2,6],[-3,6],[-4,6],[-5,6],[-6,6],[-7,6],[-7,5],[-7,4],[-7,3],[-7,2],[-7,1],[-7,0],[-7,-1],[-7,-2],[-7,-3],[-7,-4],[-7,-5],[-7,-6],[-7,-7],[-6,-7],[-5,-7],[-4,-7],[-3,-7],[-2,-7],[-1,-7],[0,-7],[1,-7],[2,-7],[3,-7],[4,-7],[5,-7],[6,-7],[7,-7],[7,-6],[7,-5],[7,-4],[7,-3],[7,-2],[7,-1],[7,0],[7,1],[7,2],[7,3],[7,4],[7,5],[7,6],[7,7],[6,7],[5,7],[4,7],[3,7],[2,7],[1,7],[0,7],[-1,7],[-2,7],[-3,7],[-4,7],[-5,7],[-6,7],[-7,7],[-8,7],[-8,6],[-8,5],[-8,4],[-8,3],[-8,2],[-8,1],[-8,0],[-8,-1],[-8,-2],[-8,-3],[-8,-4],[-8,-5],[-8,-6],[-8,-7],[-8,-8],[-7,-8],[-6,-8],[-5,-8],[-4,-8],[-3,-8],[-2,-8],[-1,-8],[0,-8],[1,-8],[2,-8],[3,-8],[4,-8],[5,-8],[6,-8],[7,-8],[8,-8],[8,-7],[8,-6],[8,-5],[8,-4],[8,-3],[8,-2],[8,-1],[8,0],[8,1],[8,2],[8,3],[8,4],[8,5],[8,6],[8,7],[8,8],[7,8],[6,8],[5,8],[4,8],[3,8],[2,8],[1,8],[0,8],[-1,8],[-2,8],[-3,8],[-4,8],[-5,8],[-6,8],[-7,8],[-8,8],[-9,8],[-9,7],[-9,6],[-9,5],[-9,4],[-9,3],[-9,2],[-9,1],[-9,0],[-9,-1],[-9,-2],[-9,-3],[-9,-4],[-9,-5],[-9,-6],[-9,-7],[-9,-8],[-9,-9],[-8,-9],[-7,-9],[-6,-9],[-5,-9],[-4,-9],[-3,-9],[-2,-9],[-1,-9],[0,-9],[1,-9],[2,-9],[3,-9],[4,-9],[5,-9],[6,-9],[7,-9],[8,-9],[9,-9],[9,-8],[9,-7],[9,-6],[9,-5],[9,-4],[9,-3],[9,-2],[9,-1],[9,0],[9,1],[9,2],[9,3],[9,4],[9,5],[9,6],[9,7],[9,8],[9,9],[8,9],[7,9],[6,9],[5,9],[4,9],[3,9],[2,9],[1,9],[0,9],[-1,9],[-2,9],[-3,9],[-4,9],[-5,9],[-6,9],[-7,9],[-8,9],[-9,9]
                  ]
#通用数组(9*9)
Def_Matrix_Ten = [
                   [0,0],[-1,0],[-1,-1],[0,-1],[1,-1],[1,0],[1,1],[0,1],[-1,1],[-2,1],[-2,0],[-2,-1],[-2,-2],[-1,-2],[0,-2],[1,-2],[2,-2],[2,-1],[2,0],[2,1],[2,2],[1,2],[0,2],[-1,2],[-2,2],[-3,2],[-3,1],[-3,0],[-3,-1],[-3,-2],[-3,-3],[-2,-3],[-1,-3],[0,-3],[1,-3],[2,-3],[3,-3],[3,-2],[3,-1],[3,0],[3,1],[3,2],[3,3],[2,3],[1,3],[0,3],[-1,3],[-2,3],[-3,3],[-4,3],[-4,2],[-4,1],[-4,0],[-4,-1],[-4,-2],[-4,-3],[-4,-4],[-3,-4],[-2,-4],[-1,-4],[0,-4],[1,-4],[2,-4],[3,-4],[4,-4],[4,-3],[4,-2],[4,-1],[4,0],[4,1],[4,2],[4,3],[4,4],[3,4],[2,4],[1,4],[0,4],[-1,4],[-2,4],[-3,4],[-4,4],[-5,4],[-5,3],[-5,2],[-5,1],[-5,0],[-5,-1],[-5,-2],[-5,-3],[-5,-4],[-5,-5],[-4,-5],[-3,-5],[-2,-5],[-1,-5],[0,-5],[1,-5],[2,-5],[3,-5],[4,-5],[5,-5],[5,-4],[5,-3],[5,-2],[5,-1],[5,0],[5,1],[5,2],[5,3],[5,4],[5,5],[4,5],[3,5],[2,5],[1,5],[0,5],[-1,5],[-2,5],[-3,5],[-4,5],[-5,5],[-6,5],[-6,4],[-6,3],[-6,2],[-6,1],[-6,0],[-6,-1],[-6,-2],[-6,-3],[-6,-4],[-6,-5],[-6,-6],[-5,-6],[-4,-6],[-3,-6],[-2,-6],[-1,-6],[0,-6],[1,-6],[2,-6],[3,-6],[4,-6],[5,-6],[6,-6],[6,-5],[6,-4],[6,-3],[6,-2],[6,-1],[6,0],[6,1],[6,2],[6,3],[6,4],[6,5],[6,6],[5,6],[4,6],[3,6],[2,6],[1,6],[0,6],[-1,6],[-2,6],[-3,6],[-4,6],[-5,6],[-6,6],[-7,6],[-7,5],[-7,4],[-7,3],[-7,2],[-7,1],[-7,0],[-7,-1],[-7,-2],[-7,-3],[-7,-4],[-7,-5],[-7,-6],[-7,-7],[-6,-7],[-5,-7],[-4,-7],[-3,-7],[-2,-7],[-1,-7],[0,-7],[1,-7],[2,-7],[3,-7],[4,-7],[5,-7],[6,-7],[7,-7],[7,-6],[7,-5],[7,-4],[7,-3],[7,-2],[7,-1],[7,0],[7,1],[7,2],[7,3],[7,4],[7,5],[7,6],[7,7],[6,7],[5,7],[4,7],[3,7],[2,7],[1,7],[0,7],[-1,7],[-2,7],[-3,7],[-4,7],[-5,7],[-6,7],[-7,7],[-8,7],[-8,6],[-8,5],[-8,4],[-8,3],[-8,2],[-8,1],[-8,0],[-8,-1],[-8,-2],[-8,-3],[-8,-4],[-8,-5],[-8,-6],[-8,-7],[-8,-8],[-7,-8],[-6,-8],[-5,-8],[-4,-8],[-3,-8],[-2,-8],[-1,-8],[0,-8],[1,-8],[2,-8],[3,-8],[4,-8],[5,-8],[6,-8],[7,-8],[8,-8],[8,-7],[8,-6],[8,-5],[8,-4],[8,-3],[8,-2],[8,-1],[8,0],[8,1],[8,2],[8,3],[8,4],[8,5],[8,6],[8,7],[8,8],[7,8],[6,8],[5,8],[4,8],[3,8],[2,8],[1,8],[0,8],[-1,8],[-2,8],[-3,8],[-4,8],[-5,8],[-6,8],[-7,8],[-8,8],[-9,8],[-9,7],[-9,6],[-9,5],[-9,4],[-9,3],[-9,2],[-9,1],[-9,0],[-9,-1],[-9,-2],[-9,-3],[-9,-4],[-9,-5],[-9,-6],[-9,-7],[-9,-8],[-9,-9],[-8,-9],[-7,-9],[-6,-9],[-5,-9],[-4,-9],[-3,-9],[-2,-9],[-1,-9],[0,-9],[1,-9],[2,-9],[3,-9],[4,-9],[5,-9],[6,-9],[7,-9],[8,-9],[9,-9],[9,-8],[9,-7],[9,-6],[9,-5],[9,-4],[9,-3],[9,-2],[9,-1],[9,0],[9,1],[9,2],[9,3],[9,4],[9,5],[9,6],[9,7],[9,8],[9,9],[8,9],[7,9],[6,9],[5,9],[4,9],[3,9],[2,9],[1,9],[0,9],[-1,9],[-2,9],[-3,9],[-4,9],[-5,9],[-6,9],[-7,9],[-8,9],[-9,9]
                  ]
#通用数组(13*13)
Def_Circle_Three =  [
@@ -2767,6 +2771,7 @@
              7:Def_Matrix_Seven,
              8:Def_Matrix_Eight,
              9:Def_Matrix_Nine,
              10:Def_Matrix_Ten,
              13:Def_Circle_Three,
              }
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_MirrorBattle.py
@@ -117,6 +117,7 @@
    
    battle = MirrorAttack.GetMirrorBattleByID(battleID)
    if not battle:
        GameWorld.DebugLog("镜像战斗结算时战场数据不存在!", battleID)
        return
    mapID = battle.mapID
    funcLineID = battle.funcLineID
@@ -124,7 +125,11 @@
    curPlayerID = battle.playerID # 副本所属玩家ID,该玩家不一定参与实际战斗
    tagPlayerID = battle.GetTagPlayerID()
    curPlayer = GameWorld.GetMapCopyPlayerManager().FindPlayerByID(curPlayerID)            
    if not curPlayer: # 防范GetMapCopyPlayerManager找不到的情况,不在1线,系统后台战斗默认在1线,非1线玩家请求的情况
        curPlayer = GameWorld.GetPlayerManager().FindPlayerByID(curPlayerID)
    if not curPlayer:
        GameWorld.DebugLog("镜像战斗结算时所属玩家不在线! curPlayerID=%s" % curPlayerID, battleID)
        return
    
    if mapID == ChConfig.Def_FBMapID_ArenaBattle:
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerViewCacheTube.py
@@ -112,6 +112,27 @@
def SetPackDataCrossSyncState(curPlayer): UpdPackDataSyncState(curPlayer, {"PackDataCross":1})
def SetViewCacheCrossSyncState(curPlayer): UpdPackDataSyncState(curPlayer, {"ViewCacheCross":1})
def NormalSyncPackData(curPlayer):
    '''常规同步打包数据,仅作为补充同步用,不强制同步
    一般由需要打包数据的功能发起检查自动同步用,做战力验证,战力变更时主动同步一次
    防止短时间内强化了战力,导致镜像数据差异太大,影响镜像战斗结果
    '''
    syncFightPower = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PackDataSyncFightPower)
    if PlayerControl.GetFightPower(curPlayer) == syncFightPower:
        GameWorld.DebugLog("战力与打包数据相同,不同步!", curPlayer.GetPlayerID())
        return
    GameWorld.DebugLog("战力与打包数据不同,立即同步!", curPlayer.GetPlayerID())
    syncState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_PackDataSyncState)
    if not syncState:
        SetPackDataSyncState(curPlayer)
        SetPackDataCrossSyncState(curPlayer)
    tick = GameWorld.GetGameWorld().GetTick()
    UpdateGameServerPlayerCache(curPlayer, tick)
    return
##更新玩家当前详细信息到GameServer
#  @param curPlayer, tick
#  @return None