yyl
2026-01-23 b125ed00e7e0db3e5851bf535cf19aae46d4cc37
125 战斗 战报检测+旧代码删除
4个文件已删除
6个文件已修改
355 ■■■■■ 已修改文件
Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB427_tagSCUseSkill.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB430_tagSCTurnFightReport.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/RecordActions/SkillRecordAction.cs 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/RecordActions/SkillTestAction.cs 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/RecordActions/SkillTestAction.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/RecordActions/TestAction.cs 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/BattleField/RecordActions/TestAction.cs.meta 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/Motion/MotionBase.cs 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/System/Battle/RecordPlayer/RecordAction.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Main/Core/NetworkPackage/CustomServerPack/CustomHB426CombinePack.cs
@@ -18,6 +18,11 @@
    public List<GameNetPackBasic> packList = new List<GameNetPackBasic>();
#if UNITY_EDITOR
    // 编辑器下保存packList的副本,避免distribute过程中remove导致查看器显示不全
    public List<GameNetPackBasic> copiedPackList = new List<GameNetPackBasic>();
#endif
    private bool isCreated = false;
    public override void ReadFromBytes(byte[] vBytes)
@@ -47,7 +52,6 @@
        }
        fromIndex = _fromIndex;
        startTag = tag;
        
    }
@@ -79,6 +83,11 @@
        }
        packList.Add(pack);
#if UNITY_EDITOR
        copiedPackList.Add(pack);
#endif
    }
    public bool IsEndPack(HB426_tagSCTurnFightTag tag)
@@ -297,6 +306,7 @@
        BattleObject _caster = battleField.battleObjMgr.GetBattleObject((int)skill.ObjID);
        SkillRecordAction skillAction = new SkillRecordAction(battleField, _caster, skill, _packList);
        skillAction.tracePackUID = skill.packUID;
        return skillAction;
    }
@@ -331,6 +341,8 @@
            else if (pack is CustomHB426CombinePack)
            {
                Debug.LogError("无法找到Skill包,先发现了嵌套包 " + startTag.Tag);
                //  保持原样 不去动他
                packList.Insert(0, pack);
                return null;
            }
            else
@@ -352,40 +364,24 @@
                return null;
            }
            HB427_tagSCUseSkill skill = packList[0] as HB427_tagSCUseSkill;
            packList.RemoveAt(0);
            if (null == skill)
            {
                Debug.LogError("No HB427_tagSCUseSkill found in packList.");
                return null;
            }
            packList.RemoveAt(0);
            BattleObject _caster = battleField.battleObjMgr.GetBattleObject((int)skill.ObjID);
            // BattleDebug.LogError("_caster == null : " + (_caster == null) + " skill.ObjID : " + skill.ObjID);
            isCreated = true;
            SkillRecordAction skillAction = new SkillRecordAction(battleField, _caster, skill, packList);
            skillAction.tracePackUID = packUID;
            return skillAction;
        }
        return null;
    }
#if UNITY_EDITOR
    public static CustomHB426CombinePack CreateCustomPack(string _guid, HB427_tagSCUseSkill skill)
    {
        CustomHB426CombinePack pack = new CustomHB426CombinePack();
        pack.guid = string.Empty;
        pack.startTag = new HB426_tagSCTurnFightTag
        {
            Tag = "Skill_Start",
            Sign = 0
        };
        pack.packList.Add(skill);
        return pack;
    }
    public bool NeedWaiting()
@@ -424,5 +420,4 @@
        return needWaiting;
    }
#endif
}
Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB427_tagSCUseSkill.cs
@@ -27,6 +27,7 @@
            }
            SkillRecordAction skillRecord = new SkillRecordAction(battleField, caster, vNetData, new System.Collections.Generic.List<GameNetPackBasic>());
            skillRecord.tracePackUID = vNetData.packUID;
            battleField.PlayRecord(skillRecord);
        }
Main/Core/NetworkPackage/DTCFile/ServerPack/HB4_FightDefine/DTCB430_tagSCTurnFightReport.cs
@@ -4,6 +4,7 @@
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
/// <summary>
/// B4 30 战报结果处理类
@@ -168,6 +169,45 @@
                Debug.LogError("保存包详细分析失败: " + e.Message);
            }
        }
        // 将包数据添加到战斗包查看器(使用反射调用Editor程序集)
        try
        {
            // 查找包含BattleReportChecker的Editor程序集
            Assembly editorAssembly = System.AppDomain.CurrentDomain.GetAssemblies()
                .FirstOrDefault(a => a.GetName().Name == "Assembly-CSharp-Editor");
            if (editorAssembly != null)
            {
                var checkerType = editorAssembly.GetType("BattleReportChecker");
                if (checkerType != null)
                {
                    var method = checkerType.GetMethod("AddBattlePackages",
                        System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
                    if (method != null)
                    {
                        method.Invoke(null, new object[] { guid, vPackList });
                        Debug.Log($"战斗包数据已添加到BattleReportChecker,包数量: {vPackList.Count}");
                    }
                    else
                    {
                        Debug.LogWarning("未找到BattleReportChecker.AddBattlePackages方法");
                    }
                }
                else
                {
                    Debug.LogWarning("未找到BattleReportChecker类型");
                }
            }
            else
            {
                Debug.LogWarning("未找到Assembly-CSharp-Editor程序集(可能不在Editor环境)");
            }
        }
        catch (Exception e)
        {
            Debug.LogWarning("调用BattleReportChecker失败: " + e.Message);
        }
#endif
    }
Main/System/Battle/BattleField/RecordActions/SkillRecordAction.cs
@@ -1,5 +1,15 @@
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
#if UNITY_EDITOR
public enum SkillCastEnum
    {
        MainSkill,
        SubSkill,
    }
#endif
public class SkillRecordAction : RecordAction
{
@@ -8,7 +18,13 @@
#else
    protected 
#endif 
        SkillBase skillBase;
#if UNITY_EDITOR
    public SkillCastEnum skillCastEnum = SkillCastEnum.MainSkill;
#endif
    public HB427_tagSCUseSkill hB427_TagSCUseSkill;
@@ -77,6 +93,33 @@
        {
            skillBase.ForceFinished();
        }
#if UNITY_EDITOR
        // 标记包执行完成
        if (tracePackUID != 0 && !string.IsNullOrEmpty(GetBattleFieldGuid()))
        {
            try
            {
                var editorAssembly = System.AppDomain.CurrentDomain.GetAssemblies()
                    .FirstOrDefault(a => a.GetName().Name == "Assembly-CSharp-Editor");
                if (editorAssembly != null)
                {
                    var checkerType = editorAssembly.GetType("BattleReportChecker");
                    if (checkerType != null)
                    {
                        var method = checkerType.GetMethod("MarkPackageExecuted",
                            System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
                        if (method != null)
                        {
                            method.Invoke(null, new object[] { GetBattleFieldGuid(), tracePackUID });
                        }
                    }
                }
            }
            catch { }
        }
#endif
        base.ForceFinish();
    }
    
@@ -100,6 +143,32 @@
    {
        base.Run();
#if UNITY_EDITOR
        // 标记包开始执行
        if (tracePackUID != 0 && !string.IsNullOrEmpty(GetBattleFieldGuid()))
        {
            try
            {
                var editorAssembly = System.AppDomain.CurrentDomain.GetAssemblies()
                    .FirstOrDefault(a => a.GetName().Name == "Assembly-CSharp-Editor");
                if (editorAssembly != null)
                {
                    var checkerType = editorAssembly.GetType("BattleReportChecker");
                    if (checkerType != null)
                    {
                        var method = checkerType.GetMethod("MarkPackageExecuting",
                            System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
                        if (method != null)
                        {
                            method.Invoke(null, new object[] { GetBattleFieldGuid(), tracePackUID });
                        }
                    }
                }
            }
            catch { }
        }
#endif
        if (null == skillBase)
        {
            return;
Main/System/Battle/BattleField/RecordActions/SkillTestAction.cs
File was deleted
Main/System/Battle/BattleField/RecordActions/SkillTestAction.cs.meta
File was deleted
Main/System/Battle/BattleField/RecordActions/TestAction.cs
File was deleted
Main/System/Battle/BattleField/RecordActions/TestAction.cs.meta
File was deleted
Main/System/Battle/Motion/MotionBase.cs
@@ -16,7 +16,7 @@
    private Dictionary<Spine.TrackEntry, Action> trackEntryCallbacks = new Dictionary<Spine.TrackEntry, Action>();
    private Dictionary<int, SkillBase> skillTrackDict = new Dictionary<int, SkillBase>();
    // private Dictionary<int, SkillBase> skillTrackDict = new Dictionary<int, SkillBase>();
    public Action OnAttackAnimationComplete;
    public Action OnHitAnimationComplete;
    private List<Action> runningActions = new List<Action>();
@@ -91,7 +91,7 @@
        currentTrack = null;
        playingSkill = false;
        playingSkillWithAnim = false;
        skillTrackDict.Clear();
        // skillTrackDict.Clear();
    }
    public virtual Spine.TrackEntry PlayAnimation(MotionName motionName, bool loop, Action onComplete = null)
@@ -227,7 +227,7 @@
        if (hasAnim)
        {
            // 检查轨道是否已被占用(修复:原来检查 null != skillTrack 永远为 false)
            if (activeSkillTracks.ContainsKey(trackIndex) || skillTrackDict.ContainsKey(trackIndex))
            if (activeSkillTracks.ContainsKey(trackIndex) /*|| skillTrackDict.ContainsKey(trackIndex)*/)
            {
                //等待上一技能动画结束 暂时处理办法
                UniTaskExtension.DelayFrames((GameObject)null, 1, () =>
@@ -254,13 +254,13 @@
                return null;
            }
            if (skillTrackDict.ContainsKey(trackIndex))
            {
                skillBase.ForceFinished();
                skillTrackDict.Remove(trackIndex);
            }
            // if (skillTrackDict.ContainsKey(trackIndex))
            // {
            //     skillBase.ForceFinished();
            //     skillTrackDict.Remove(trackIndex);
            // }
            skillTrackDict[trackIndex] = skillBase;
            // skillTrackDict[trackIndex] = skillBase;
            
            // 只有主技能才更新 currentTrack
            if (!isSubSkill)
@@ -290,7 +290,7 @@
        {
            if (skillBase.IsFinished())
            {
                skillTrackDict.Remove(trackIndex);
                // skillTrackDict.Remove(trackIndex);
                // 清理并退出(保证状态一致)
                if (skillTrack != null && activeSkillTracks.ContainsKey(trackIndex))
                {
@@ -344,8 +344,8 @@
                // 检查当前轨道是否被新技能覆盖
                if (!activeSkillTracks.ContainsKey(trackIndex) || activeSkillTracks[trackIndex] != skillTrack)
                {
                    skillTrackDict[trackIndex].ForceFinished();
                    skillTrackDict.Remove(trackIndex);
                    // skillTrackDict[trackIndex].ForceFinished();
                    // skillTrackDict.Remove(trackIndex);
                    Debug.LogError("技能动画被打断,强制结束 " + skillConfig.SkillID);
                    skillBase.ForceFinished();
@@ -486,7 +486,7 @@
                        playingSkill = false;
                    }
                    skillTrackDict.Remove(trackIndex);
                    // skillTrackDict.Remove(trackIndex);
                    RemoveAction(frameHandler);
                    onComplete?.Invoke();
@@ -644,11 +644,7 @@
        activeSkillTracks.Clear();
        
        // 强制结束所有正在执行的技能
        foreach (var kv in skillTrackDict)
        {
            kv.Value?.ForceFinished();
        }
        skillTrackDict.Clear();
        // skillTrackDict.Clear();
        
        // 重置子技能轨道池
        if (availableSubTracks == null)
@@ -682,12 +678,8 @@
        
        activeSkillTracks.Clear();
        
        // 强制结束所有正在执行的技能(复活时需要清理所有技能状态)
        foreach (var kv in skillTrackDict)
        {
            kv.Value?.ForceFinished();
        }
        skillTrackDict.Clear();
        //  复活 不能清理正在执行的技能轨道 有可能是复活自己
        // skillTrackDict.Clear();
        
        // 3. 重置子技能轨道池
        if (availableSubTracks == null)
Main/System/Battle/RecordPlayer/RecordAction.cs
@@ -8,6 +8,8 @@
    public int actionID;
    public ulong tracePackUID = 0;
    private static int autoincreser = 0;
    protected BattleField battleField;