From 2335a82c11f72711f18d0bd8074f149368912c0a Mon Sep 17 00:00:00 2001 From: walon Date: Wed, 23 Feb 2022 13:03:58 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91=E4=B8=8D?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E4=B8=A4=E4=B8=AA=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=BF=BD=E7=95=A5=E5=A4=A7=E5=B0=8F=E5=86=99?= =?UTF-8?q?=E5=90=8E=E5=90=8C=E5=90=8D=EF=BC=8C=E9=81=BF=E5=85=8D=E7=94=9F?= =?UTF-8?q?=E6=88=90=E4=BB=A3=E7=A0=81=E6=96=87=E4=BB=B6=E7=9A=84=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=85=BC=E5=AE=B9=E6=80=A7=E9=97=AE=E9=A2=98=EF=BC=88?= =?UTF-8?q?=E4=BE=8B=E5=A6=82win=E4=B8=8B=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=99=E4=B8=8D=E6=95=8F=E6=84=9F=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E5=85=81=E8=AE=B8=EF=BC=8C=E5=88=99=E4=BC=9A?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=88=B0=E5=90=8C=E4=B8=80=E4=B8=AA=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=90=8D=EF=BC=8C=E5=BC=95=E8=B5=B7=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=89=20=E3=80=90=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=E5=85=B3=E9=97=ADLuban.Client=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=BB=93=E6=9D=9F=E5=90=8E=E6=89=93=E5=8D=B0=E7=9A=84Socket?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Luban.Common/Source/Utils/LogUtil.cs | 1 + src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/Luban.Common/Source/Utils/LogUtil.cs b/src/Luban.Common/Source/Utils/LogUtil.cs index 13420b1..0464fd8 100644 --- a/src/Luban.Common/Source/Utils/LogUtil.cs +++ b/src/Luban.Common/Source/Utils/LogUtil.cs @@ -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; } diff --git a/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs b/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs index f3adf55..82886b5 100644 --- a/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs +++ b/src/Luban.Job.Common/Source/Defs/DefAssemblyBase.cs @@ -34,6 +34,8 @@ namespace Luban.Job.Common.Defs public Dictionary Types { get; } = new Dictionary(); + private readonly Dictionary _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); }