Parcourir la source

将表达消息路径源码位置的Localtion由Type改为String使用随机生成的GUID字符串去除特殊对待的匿名位置

anycmd il y a 4 ans
Parent
commit
792d75d1d5

+ 1 - 1
src/AppModels/Vms/CoinKernelViewModel.cs

@@ -68,7 +68,7 @@ namespace NTMiner.Vms {
             _environmentVariables.AddRange(data.EnvironmentVariables.Select(a => new EnvironmentVariable(a)));
             // 复制,视为值对象,防止直接修改引用
             _inputSegments.AddRange(data.InputSegments.Select(a => new InputSegment(a)));
-            _inputSegmentVms.AddRange(_inputSegments.Select(a => new InputSegmentViewModel(a)));
+            _inputSegmentVms.AddRange(_inputSegments.OrderBy(a => a.Name).Select(a => new InputSegmentViewModel(a)));
             _gpuInputSegmentVms.AddRange(_inputSegmentVms.Where(a => a.TargetGpu.IsSupportedGpu(NTMinerContext.Instance.GpuSet.GpuType)));
             _fileWriterIds = data.FileWriterIds;
             _fragmentWriterIds = data.FragmentWriterIds;

+ 0 - 10
src/NTMinerHub/Anonymous.cs

@@ -1,10 +0,0 @@
-using System;
-
-namespace NTMiner {
-    public static class Anonymous {
-        /// <summary>
-        /// 路径通常在同一地点是不应重复的,但个别正常需求确实会在同一地点重复创建相同的路径,比如借助Per1SecondEvent实现的SecondsDelay方法。
-        /// </summary>
-        public static Type Location { get; } = typeof(Anonymous);
-    }
-}

+ 1 - 1
src/NTMinerHub/Hub/IMessagePathHub.cs

@@ -21,7 +21,7 @@ namespace NTMiner.Hub {
         /// <param name="viaTimesLimit"><see cref="IMessagePathId.ViaTimesLimit"/></param>
         /// <returns></returns>
         IMessagePathId AddPath<TMessage>(
-            Type location, 
+            string location, 
             string description, 
             LogEnum logType, 
             PathId pathId, 

+ 1 - 1
src/NTMinerHub/Hub/IMessagePathId.cs

@@ -22,7 +22,7 @@ namespace NTMiner.Hub {
         /// <summary>
         /// 该消息路径所处的位置(对程序员有意义的编码时源码位置,对运行时无意义)。
         /// </summary>
-        Type Location { get; }
+        string Location { get; }
         string PathName { get; }
         /// <summary>
         /// 日志类型,表示消息每通过一次是否记录日志以及记录什么日志,对程序员编程时有意义对运行时无意义。

+ 8 - 8
src/NTMinerHub/Hub/MessagePathHub.cs

@@ -69,14 +69,14 @@
                             switch (messagePath.LogType) {
                                 case LogEnum.DevConsole:
                                     if (DevMode.IsDevMode) {
-                                        NTMinerConsole.DevDebug(() => $"({typeof(TMessage).Name})->({messagePath.Location.Name}){messagePath.Description}");
+                                        NTMinerConsole.DevDebug(() => $"({typeof(TMessage).Name})->({messagePath.Location}){messagePath.Description}");
                                     }
                                     break;
                                 case LogEnum.UserConsole:
-                                    NTMinerConsole.UserInfo($"({typeof(TMessage).Name})->({messagePath.Location.Name}){messagePath.Description}");
+                                    NTMinerConsole.UserInfo($"({typeof(TMessage).Name})->({messagePath.Location}){messagePath.Description}");
                                     break;
                                 case LogEnum.Log:
-                                    Logger.InfoDebugLine($"({typeof(TMessage).Name})->({messagePath.Location.Name}){messagePath.Description}");
+                                    Logger.InfoDebugLine($"({typeof(TMessage).Name})->({messagePath.Location}){messagePath.Description}");
                                     break;
                                 case LogEnum.None:
                                 default:
@@ -92,7 +92,7 @@
             }
         }
 
-        public IMessagePathId AddPath<TMessage>(Type location, string description, LogEnum logType, PathId pathId, PathPriority priority, Action<TMessage> action, int viaTimesLimit = -1) {
+        public IMessagePathId AddPath<TMessage>(string location, string description, LogEnum logType, PathId pathId, PathPriority priority, Action<TMessage> action, int viaTimesLimit = -1) {
             if (action == null) {
                 throw new ArgumentNullException(nameof(action));
             }
@@ -147,7 +147,7 @@
                             throw new Exception($"一种命令只应被一个处理器处理:{typeof(TMessage).Name}");
                         }
                     }
-                    else if (messagePath.Location != Anonymous.Location) {
+                    else {
                         var paths = _messagePaths.Where(a => a.PathName == messagePath.PathName && a.PathId == messagePath.PathId && a.Priority == messagePath.Priority).ToArray();
                         if (paths.Length != 0) {
                             foreach (var path in paths) {
@@ -232,7 +232,7 @@
 
             public event PropertyChangedEventHandler PropertyChanged;
 
-            internal MessagePath(Type location, string description, LogEnum logType, Action<TMessage> action, PathId pathId, PathPriority priority, int viaTimesLimit) {
+            internal MessagePath(string location, string description, LogEnum logType, Action<TMessage> action, PathId pathId, PathPriority priority, int viaTimesLimit) {
                 if (viaTimesLimit == 0) {
                     throw new InvalidProgramException("消息路径的viaTimesLimit不能为0,可以为负数表示不限制通过次数或为正数表示限定通过次数,但不能为0");
                 }
@@ -240,7 +240,7 @@
                 _isEnabled = true;
                 _viaTimesLimit = viaTimesLimit;
                 var messageType = typeof(TMessage);
-                string path = $"{location.FullName}[{messageType.FullName}]";
+                string path = $"{location}[{messageType.FullName}]";
 
                 MessageType = messageType;
                 Location = location;
@@ -278,7 +278,7 @@
                     return MessageTypeAttribute.GetMessageTypeAttribute(this.MessageType);
                 }
             }
-            public Type Location { get; private set; }
+            public string Location { get; private set; }
             public string PathName { get; private set; }
             public LogEnum LogType { get; private set; }
             public string Description { get; private set; }

+ 0 - 1
src/NTMinerHub/NTMinerHub.csproj

@@ -37,7 +37,6 @@
     <Reference Include="System" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="Anonymous.cs" />
     <Compile Include="Hub\Cmd.cs" />
     <Compile Include="PathPriority.cs" />
     <Compile Include="Hub\SourcedEvent`1.cs" />

+ 1 - 1
src/NTMinerWpf/Views/Ucs/MessagePathIds.xaml

@@ -57,7 +57,7 @@
                 <DataGridTemplateColumn Width="340" Header="Location">
                     <DataGridTemplateColumn.CellTemplate>
                         <DataTemplate>
-                            <TextBox IsReadOnly="True" BorderThickness="0" Text="{Binding Location.FullName,Mode=OneWay}"></TextBox>
+                            <TextBox IsReadOnly="True" BorderThickness="0" Text="{Binding Location,Mode=OneWay}"></TextBox>
                         </DataTemplate>
                     </DataGridTemplateColumn.CellTemplate>
                 </DataGridTemplateColumn>

+ 1 - 1
src/NTMinerlib/VirtualRoot.partials.Common.cs

@@ -132,7 +132,7 @@ namespace NTMiner {
 
         public static Task SecondsDelay(this int n) {
             var tcs = new TaskCompletionSource<object>();
-            BuildViaTimesLimitPath<Per1SecondEvent>("倒计时", LogEnum.None, viaTimesLimit: n, Anonymous.Location, PathPriority.Normal, message => {
+            BuildViaTimesLimitPath<Per1SecondEvent>("倒计时", LogEnum.None, viaTimesLimit: n, location: Guid.NewGuid().ToString("N"), PathPriority.Normal, message => {
                 n--;
                 if (n == 0) {
                     tcs.SetResult(null);

+ 9 - 2
src/NTMinerlib/VirtualRoot.partials.Hub.cs

@@ -35,7 +35,7 @@ namespace NTMiner {
         /// 修建消息的运动路径
         /// </summary>
         public static IMessagePathId BuildMessagePath<TMessage>(string description, LogEnum logType, Type location, PathPriority priority, Action<TMessage> path) {
-            return MessageHub.AddPath(location, description, logType, pathId: PathId.Empty, priority, path);
+            return MessageHub.AddPath(location.FullName, description, logType, pathId: PathId.Empty, priority, path);
         }
 
         /// <summary>
@@ -43,13 +43,20 @@ namespace NTMiner {
         /// 注意该路径具有特定的路径标识pathId,pathId可以看作是路径的形状,只有和该路径的形状相同的消息才能通过路径。
         /// </summary>
         public static IMessagePathId BuildOnecePath<TMessage>(string description, LogEnum logType, PathId pathId, Type location, PathPriority priority, Action<TMessage> path) {
-            return MessageHub.AddPath(location, description, logType, pathId, priority, path, viaTimesLimit: 1);
+            return MessageHub.AddPath(location.FullName, description, logType, pathId, priority, path, viaTimesLimit: 1);
         }
 
         /// <summary>
         /// 消息通过路径指定的次数后路径即消失
         /// </summary>
         public static IMessagePathId BuildViaTimesLimitPath<TMessage>(string description, LogEnum logType, int viaTimesLimit, Type location, PathPriority priority, Action<TMessage> path) {
+            return MessageHub.AddPath(location.FullName, description, logType, pathId: PathId.Empty, priority, path, viaTimesLimit);
+        }
+
+        /// <summary>
+        /// 消息通过路径指定的次数后路径即消失
+        /// </summary>
+        public static IMessagePathId BuildViaTimesLimitPath<TMessage>(string description, LogEnum logType, int viaTimesLimit, string location, PathPriority priority, Action<TMessage> path) {
             return MessageHub.AddPath(location, description, logType, pathId: PathId.Empty, priority, path, viaTimesLimit);
         }
 

+ 12 - 12
src/WsServer/WsMessageFromMinerClientHandler.cs

@@ -17,11 +17,11 @@ namespace NTMiner {
                 [WsMessage.ConsoleOutLines] = (session, clientId, message) => {
                     if (message.TryGetData(out List<ConsoleOutLine> consoleOutLines) && consoleOutLines != null && consoleOutLines.Count != 0) {
                         if (MqBufferRoot.TryRemoveFastId(message.Id)) {
-                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"fast {nameof(WsMessage)}.{nameof(WsMessage.ConsoleOutLines)}");
+                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"fast {nameof(WsMessage)}.{message.Type}");
                             AppRoot.OperationMqSender.SendConsoleOutLines(session.LoginName, clientId, consoleOutLines);
                         }
                         else {
-                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{nameof(WsMessage.ConsoleOutLines)}");
+                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{message.Type}");
                             MqBufferRoot.ConsoleOutLines(new ConsoleOutLines {
                                 LoginName = session.LoginName,
                                 ClientId = clientId,
@@ -33,11 +33,11 @@ namespace NTMiner {
                 [WsMessage.LocalMessages] = (session, clientId, message) => {
                     if (message.TryGetData(out List<LocalMessageDto> localMessages) && localMessages != null && localMessages.Count != 0) {
                         if (MqBufferRoot.TryRemoveFastId(message.Id)) {
-                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"fast {nameof(WsMessage)}.{nameof(WsMessage.LocalMessages)}");
+                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"fast {nameof(WsMessage)}.{message.Type}");
                             AppRoot.OperationMqSender.SendLocalMessages(session.LoginName, clientId, localMessages);
                         }
                         else {
-                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{nameof(WsMessage.LocalMessages)}");
+                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{message.Type}");
                             MqBufferRoot.LocalMessages(new LocalMessages {
                                 LoginName = session.LoginName,
                                 ClientId = clientId,
@@ -49,11 +49,11 @@ namespace NTMiner {
                 [WsMessage.OperationResults] = (session, clientId, message) => {
                     if (message.TryGetData(out List<OperationResultData> operationResults) && operationResults != null && operationResults.Count != 0) {
                         if (MqBufferRoot.TryRemoveFastId(message.Id)) {
-                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"fast {nameof(WsMessage)}.{nameof(WsMessage.OperationResults)}");
+                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"fast {nameof(WsMessage)}.{message.Type}");
                             AppRoot.OperationMqSender.SendOperationResults(session.LoginName, clientId, operationResults);
                         }
                         else {
-                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{nameof(WsMessage.OperationResults)}");
+                            ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{message.Type}");
                             MqBufferRoot.OperationResults(new OperationResults {
                                 LoginName = session.LoginName,
                                 ClientId = clientId,
@@ -64,23 +64,23 @@ namespace NTMiner {
                 },
                 [WsMessage.Drives] = (session, clientId, message) => {
                     if (message.TryGetData(out List<DriveDto> drives)) {
-                        ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{nameof(WsMessage.Drives)}");
+                        ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendDrives(session.LoginName, clientId, drives);
                     }
                 },
                 [WsMessage.LocalIps] = (session, clientId, message) => {
                     if (message.TryGetData(out List<LocalIpDto> localIps)) {
-                        ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{nameof(WsMessage.LocalIps)}");
+                        ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendLocalIps(session.LoginName, clientId, localIps);
                     }
                 },
                 [WsMessage.OperationReceived] = (session, clientId, message) => {
-                    ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{nameof(WsMessage.OperationReceived)}");
+                    ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{message.Type}");
                     AppRoot.OperationMqSender.SendOperationReceived(session.LoginName, clientId);
                 },
                 [WsMessage.Speed] = (session, clientId, message) => {
                     if (message.TryGetData(out SpeedDto speedDto)) {
-                        ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{nameof(WsMessage.Speed)}");
+                        ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.SpeedDataRedis.SetAsync(new SpeedData(speedDto, DateTime.Now)).ContinueWith(t => {
                             MqBufferRoot.SendSpeed(new ClientIdIp(speedDto.ClientId, session.RemoteEndPoint.ToString()));
                         });
@@ -88,13 +88,13 @@ namespace NTMiner {
                 },
                 [WsMessage.SelfWorkLocalJson] = (session, clientId, message) => {
                     if (message.TryGetData(out string json)) {
-                        ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{nameof(WsMessage.SelfWorkLocalJson)}");
+                        ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendSelfWorkLocalJson(session.LoginName, clientId, json);
                     }
                 },
                 [WsMessage.GpuProfilesJson] = (session, clientId, message) => {
                     if (message.TryGetData(out string json)) {
-                        ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{nameof(WsMessage.GpuProfilesJson)}");
+                        ServerRoot.IfMinerClientTestIdLogElseNothing(clientId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendGpuProfilesJson(session.LoginName, clientId, json);
                     }
                 }

+ 26 - 26
src/WsServer/WsMessageFromMinerStudioHandler.cs

@@ -15,7 +15,7 @@ namespace NTMiner {
             _handlers = new Dictionary<string, Action<IMinerStudioSession, Guid, WsMessage>>(StringComparer.OrdinalIgnoreCase) {
                 [WsMessage.GetConsoleOutLines] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientIdData) && wrapperClientIdData.TryGetData(out long afterTime)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.GetConsoleOutLines)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         MqBufferRoot.GetConsoleOutLines(new AfterTimeRequest {
                             AfterTime = afterTime,
                             ClientId = wrapperClientIdData.ClientId,
@@ -25,13 +25,13 @@ namespace NTMiner {
                 },
                 [WsMessage.FastGetConsoleOutLines] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientIdData) && wrapperClientIdData.TryGetData(out long afterTime)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.FastGetConsoleOutLines)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendFastGetConsoleOutLines(session.LoginName, wrapperClientIdData.ClientId, studioId, afterTime);
                     }
                 },
                 [WsMessage.GetLocalMessages] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientIdData) && wrapperClientIdData.TryGetData(out long afterTime)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.GetLocalMessages)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         MqBufferRoot.GetLocalMessages(new AfterTimeRequest {
                             AfterTime = afterTime,
                             ClientId = wrapperClientIdData.ClientId,
@@ -41,13 +41,13 @@ namespace NTMiner {
                 },
                 [WsMessage.FastGetLocalMessages] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientIdData) && wrapperClientIdData.TryGetData(out long afterTime)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.FastGetLocalMessages)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendFastGetLocalMessages(session.LoginName, wrapperClientIdData.ClientId, studioId, afterTime);
                     }
                 },
                 [WsMessage.GetOperationResults] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientIdData) && wrapperClientIdData.TryGetData(out long afterTime)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.GetOperationResults)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         MqBufferRoot.GetOperationResults(new AfterTimeRequest {
                             AfterTime = afterTime,
                             ClientId = wrapperClientIdData.ClientId,
@@ -57,25 +57,25 @@ namespace NTMiner {
                 },
                 [WsMessage.FastGetOperationResults] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientIdData) && wrapperClientIdData.TryGetData(out long afterTime)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.FastGetOperationResults)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendFastGetOperationResults(session.LoginName, wrapperClientIdData.ClientId, studioId, afterTime);
                     }
                 },
                 [WsMessage.GetDrives] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientId wrapperClientId)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.GetDrives)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendGetDrives(session.LoginName, wrapperClientId.ClientId, studioId);
                     }
                 },
                 [WsMessage.GetLocalIps] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientId wrapperClientId)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.GetLocalIps)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendGetLocalIps(session.LoginName, wrapperClientId.ClientId, studioId);
                     }
                 },
                 [WsMessage.GetSpeed] = (session, studioId, message) => {
                     if (message.TryGetData(out List<Guid> clientIds)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.GetSpeed)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         MqBufferRoot.UserGetSpeed(new UserGetSpeedRequest {
                             StudioId = studioId,
                             LoginName = session.LoginName,
@@ -85,103 +85,103 @@ namespace NTMiner {
                 },
                 [WsMessage.EnableRemoteDesktop] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientId wrapperClientId)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.EnableRemoteDesktop)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendEnableRemoteDesktop(session.LoginName, wrapperClientId.ClientId, studioId);
                     }
                 },
                 [WsMessage.BlockWAU] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientId wrapperClientId)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.BlockWAU)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendBlockWAU(session.LoginName, wrapperClientId.ClientId, studioId);
                     }
                 },
                 [WsMessage.SetVirtualMemory] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientIdData) && wrapperClientIdData.TryGetData(out Dictionary<string, int> data)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.SetVirtualMemory)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendSetVirtualMemory(session.LoginName, wrapperClientIdData.ClientId, studioId, data);
                     }
                 },
                 [WsMessage.SetLocalIps] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientIdData) && wrapperClientIdData.TryGetData(out List<LocalIpInput> data)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.SetLocalIps)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendSetLocalIps(session.LoginName, wrapperClientIdData.ClientId, studioId, data);
                     }
                 },
                 [WsMessage.SwitchRadeonGpu] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientIdData) && wrapperClientIdData.TryGetData(out bool on)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.SwitchRadeonGpu)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendSwitchRadeonGpu(session.LoginName, wrapperClientIdData.ClientId, studioId, on);
                     }
                 },
                 [WsMessage.GetSelfWorkLocalJson] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientId wrapperClientId)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.GetSelfWorkLocalJson)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendGetSelfWorkLocalJson(session.LoginName, wrapperClientId.ClientId, studioId);
                     }
                 },
                 [WsMessage.SaveSelfWorkLocalJson] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientData) && wrapperClientData.TryGetData(out WorkRequest workRequest)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.SaveSelfWorkLocalJson)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendSaveSelfWorkLocalJson(session.LoginName, wrapperClientData.ClientId, studioId, workRequest);
                     }
                 },
                 [WsMessage.GetGpuProfilesJson] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientId wrapperClientId)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.GetGpuProfilesJson)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendGetGpuProfilesJson(session.LoginName, wrapperClientId.ClientId, studioId);
                     }
                 },
                 [WsMessage.SaveGpuProfilesJson] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientData) && wrapperClientData.TryGetData(out string json)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.SaveGpuProfilesJson)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendSaveGpuProfilesJson(session.LoginName, wrapperClientData.ClientId, studioId, json);
                     }
                 },
                 [WsMessage.SetAutoBootStart] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientData) && wrapperClientData.TryGetData(out SetAutoBootStartRequest body)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.SetAutoBootStart)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendSetAutoBootStart(session.LoginName, wrapperClientData.ClientId, studioId, body);
                     }
                 },
                 [WsMessage.RestartWindows] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientId wrapperClientId)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.RestartWindows)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendRestartWindows(session.LoginName, wrapperClientId.ClientId, studioId);
                     }
                 },
                 [WsMessage.ShutdownWindows] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientId wrapperClientId)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.ShutdownWindows)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendShutdownWindows(session.LoginName, wrapperClientId.ClientId, studioId);
                     }
                 },
                 [WsMessage.UpgradeNTMiner] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientData) && wrapperClientData.TryGetData(out string ntminerFileName)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.UpgradeNTMiner)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendUpgradeNTMiner(session.LoginName, wrapperClientData.ClientId, studioId, ntminerFileName);
                     }
                 },
                 [WsMessage.StartMine] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientIdData wrapperClientData) && wrapperClientData.TryGetData(out Guid workId)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.StartMine)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendStartMine(session.LoginName, wrapperClientData.ClientId, studioId, workId);
                     }
                 },
                 [WsMessage.StopMine] = (session, studioId, message) => {
                     if (message.TryGetData(out WrapperClientId wrapperClientId)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.StopMine)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.OperationMqSender.SendStopMine(session.LoginName, wrapperClientId.ClientId, studioId);
                     }
                 },
                 [WsMessage.QueryClientDatas] = (session, studioId, message) => {
                     if (message.TryGetData(out QueryClientsRequest query)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.QueryClientDatas)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         AppRoot.MinerClientMqSender.SendQueryClientsForWs(QueryClientsForWsRequest.Create(query, session.LoginName, studioId, session.WsSessionId));
                     }
                 },
                 [WsMessage.AutoQueryClientDatas] = (session, studioId, message) => {
                     if (message.TryGetData(out QueryClientsRequest query)) {
-                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{nameof(WsMessage.AutoQueryClientDatas)}");
+                        ServerRoot.IfStudioClientTestIdLogElseNothing(studioId, $"{nameof(WsMessage)}.{message.Type}");
                         MqBufferRoot.AutoQueryClientDatas(QueryClientsForWsRequest.Create(query, session.LoginName, studioId, session.WsSessionId));
                     }
                 }