[fix] 修复ref引用了被过滤的记录却未报告引用错误的bug
parent
c738b4dcad
commit
412a400471
|
|
@ -24,6 +24,7 @@ namespace Luban.Job.Cfg.Defs
|
|||
public Service CfgTargetService { get; private set; }
|
||||
|
||||
private readonly string _patchName;
|
||||
|
||||
private readonly List<string> _excludeTags;
|
||||
|
||||
public Patch TargetPatch { get; private set; }
|
||||
|
|
@ -34,6 +35,8 @@ namespace Luban.Job.Cfg.Defs
|
|||
|
||||
public string TableManagerName => CfgTargetService.Manager;
|
||||
|
||||
public List<string> ExcludeTags => _excludeTags;
|
||||
|
||||
public DefAssembly(string patchName, TimeZoneInfo timezone, List<string> excludeTags, IAgent agent)
|
||||
{
|
||||
this._patchName = patchName;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Luban.Job.Cfg.Datas;
|
||||
using Luban.Job.Cfg.DataSources;
|
||||
using Luban.Job.Cfg.DataVisitors;
|
||||
using Luban.Job.Cfg.Defs;
|
||||
using Luban.Job.Cfg.RawDefs;
|
||||
|
|
@ -58,8 +59,14 @@ namespace Luban.Job.Cfg.Validators
|
|||
case ETableMode.MAP:
|
||||
{
|
||||
var recordMap = assembly.GetTableDataInfo(defTable).FinalRecordMap;
|
||||
if (recordMap.ContainsKey(key))
|
||||
if (recordMap.TryGetValue(key, out Record rec))
|
||||
{
|
||||
if (!rec.IsNotFiltered(assembly.ExcludeTags))
|
||||
{
|
||||
string locationFile = ValidatorContext.CurrentVisitor.CurrentValidateRecord.Source;
|
||||
assembly.Agent.Error("记录 {0} = {1} (来自文件:{2}) 在引用表:{3} 中存在,但导出时被过滤了",
|
||||
ValidatorContext.CurrentRecordPath, key, locationFile, defTable.FullName);
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
|
@ -67,8 +74,14 @@ namespace Luban.Job.Cfg.Validators
|
|||
case ETableMode.LIST:
|
||||
{
|
||||
var recordMap = assembly.GetTableDataInfo(defTable).FinalRecordMapByIndexs[field];
|
||||
if (recordMap.ContainsKey(key))
|
||||
if (recordMap.TryGetValue(key, out Record rec))
|
||||
{
|
||||
if (!rec.IsNotFiltered(assembly.ExcludeTags))
|
||||
{
|
||||
string locationFile = ValidatorContext.CurrentVisitor.CurrentValidateRecord.Source;
|
||||
assembly.Agent.Error("记录 {0} = {1} (来自文件:{2}) 在引用表:{3} 中存在,但导出时被过滤了",
|
||||
ValidatorContext.CurrentRecordPath, key, locationFile, defTable.FullName);
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in New Issue