【优化】不允许两个自定义类型忽略大小写后同名,避免生成代码文件的平台兼容性问题(例如win下文件名大小写不敏感,如果允许,则会生成到同一个文件名,引起编译问题)

【优化】关闭Luban.Client生成结束后打印的Socket错误日志。
main
walon 2022-02-23 13:03:58 +08:00
parent 7901b7012b
commit 2335a82c11
2 changed files with 8 additions and 0 deletions

View File

@ -15,6 +15,7 @@ namespace Luban.Common.Utils
layout = NLog.Layouts.Layout.FromString("${longdate}|${message}${onexception:${newline}${exception:format=tostring}${exception:format=StackTrace}}");
}
logConfig.AddTarget("console", new NLog.Targets.ColoredConsoleTarget() { Layout = layout });
logConfig.AddRule(minConsoleLogLevel, NLog.LogLevel.Off, new NLog.Targets.NullTarget(), "Bright.Net.Channels.*", true);
logConfig.AddRule(minConsoleLogLevel, NLog.LogLevel.Fatal, "console");
NLog.LogManager.Configuration = logConfig;
}

View File

@ -34,6 +34,8 @@ namespace Luban.Job.Common.Defs
public Dictionary<string, DefTypeBase> Types { get; } = new Dictionary<string, DefTypeBase>();
private readonly Dictionary<string, DefTypeBase> _notCaseSenceTypes = new ();
public IAgent Agent { get; protected set; }
public string TopModule { get; protected set; }
@ -175,6 +177,11 @@ namespace Luban.Job.Common.Defs
{
throw new Exception($"type:'{fullName}' duplicate");
}
if (!_notCaseSenceTypes.TryAdd(fullName.ToLower(), type))
{
throw new Exception($"type:'{fullName}' 和 type:'{_notCaseSenceTypes[fullName.ToLower()].FullName}' 类名小写重复. 在win平台有问题");
}
Types.Add(fullName, type);
}