parent
19656437cb
commit
1377eb828d
|
|
@ -157,6 +157,11 @@ namespace Luban.Job.Cfg.Defs
|
|||
return _recordsByTables[table.FullName];
|
||||
}
|
||||
|
||||
public List<DefTable> GetAllTables()
|
||||
{
|
||||
return Types.Values.Where(t => t is DefTable).Cast<DefTable>().ToList();
|
||||
}
|
||||
|
||||
public List<DefTable> GetExportTables()
|
||||
{
|
||||
return Types.Values.Where(t => t is DefTable ct && ct.NeedExport).Select(t => (DefTable)t).ToList();
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ namespace Luban.Job.Cfg
|
|||
|
||||
timer.StartPhase("validate");
|
||||
var validateCtx = new ValidatorContext(ass, args.ValidateRootDir);
|
||||
await validateCtx.ValidateTables(exportTables);
|
||||
await validateCtx.ValidateTables(ass.GetAllTables());
|
||||
timer.EndPhaseAndLog();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ namespace Luban.Job.Cfg.Utils
|
|||
public static async Task LoadCfgDataAsync(IAgent agent, DefAssembly ass, string dataDir, string patchName, string patchDataDir, string inputConvertDataDir)
|
||||
{
|
||||
var ctx = agent;
|
||||
List<DefTable> exportTables = ass.Types.Values.Where(t => t is DefTable ct && ct.NeedExport).Select(t => (DefTable)t).ToList();
|
||||
List<DefTable> exportTables = ass.Types.Values.Where(t => t is DefTable).Cast<DefTable>().ToList(); //&& ct.NeedExport.Select(t => (DefTable)t)
|
||||
var genDataTasks = new List<Task>();
|
||||
var outputDataFiles = new ConcurrentBag<FileInfo>();
|
||||
long genDataStartTime = Bright.Time.TimeUtil.NowMillis;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ namespace Luban.Job.Cfg.Validators
|
|||
case ETableMode.MAP:
|
||||
{
|
||||
var recordMap = assembly.GetTableDataInfo(ct).FinalRecordMap;
|
||||
if (/*recordMap != null &&*/ recordMap.ContainsKey(key))
|
||||
if (recordMap.ContainsKey(key))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -139,10 +139,10 @@ namespace Luban.Job.Cfg.Validators
|
|||
{
|
||||
throw new Exception($"结构:{hostTypeName} 字段:{fieldName} ref:{actualTable} 不存在");
|
||||
}
|
||||
if (!ct.NeedExport)
|
||||
{
|
||||
throw new Exception($"type:'{hostTypeName}' field:'{fieldName}' ref 引用的表:'{actualTable}' 没有导出");
|
||||
}
|
||||
//if (!ct.NeedExport)
|
||||
//{
|
||||
// throw new Exception($"type:'{hostTypeName}' field:'{fieldName}' ref 引用的表:'{actualTable}' 没有导出");
|
||||
//}
|
||||
if (ct.IsOneValueTable)
|
||||
{
|
||||
if (string.IsNullOrEmpty(fieldName))
|
||||
|
|
@ -167,8 +167,10 @@ namespace Luban.Job.Cfg.Validators
|
|||
}
|
||||
else if (ct.IsMapTable)
|
||||
{
|
||||
if (first && Tables.Count == 1)
|
||||
if (first && Tables.Count == 1 && ct.NeedExport)
|
||||
{
|
||||
// 只引用一个表时才生成ref代码。
|
||||
// 如果被引用的表没有导出,生成ref没有意义,还会产生编译错误
|
||||
GenRef = true;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(indexName))
|
||||
|
|
|
|||
Loading…
Reference in New Issue