ntminer 5 년 전
부모
커밋
19b43fa8c0
42개의 변경된 파일195개의 추가작업 그리고 189개의 파일을 삭제
  1. 1 1
      src/AppModels/Vms/CoinViewModel.cs
  2. 2 2
      src/MinerClient/App.xaml.cs
  3. 3 4
      src/NTMinerBus/Bus/DomainEvent`1.cs
  4. 4 3
      src/NTMinerBus/Bus/EventBase.cs
  5. 1 0
      src/NTMinerBus/Bus/IEvent.cs
  6. 4 1
      src/NTMinerBus/Bus/MessageDispatcher.cs
  7. 1 1
      src/NTMinerClient/Core/Gpus/Impl/AMDGpuSet.cs
  8. 2 1
      src/NTMinerClient/Core/Gpus/Impl/GpuOverClock.cs
  9. 6 6
      src/NTMinerClient/Core/Gpus/Impl/GpusSpeed.cs
  10. 1 1
      src/NTMinerClient/Core/Gpus/Impl/NVIDIAGpuSet.cs
  11. 2 2
      src/NTMinerClient/Core/Impl/CoinGroupSet.cs
  12. 3 3
      src/NTMinerClient/Core/Impl/CoinSet.cs
  13. 1 1
      src/NTMinerClient/Core/Impl/CoinShareSet.cs
  14. 3 3
      src/NTMinerClient/Core/Impl/FileWriterSet.cs
  15. 3 3
      src/NTMinerClient/Core/Impl/FragmentWriterSet.cs
  16. 3 3
      src/NTMinerClient/Core/Impl/GroupSet.cs
  17. 3 3
      src/NTMinerClient/Core/Impl/PoolSet.cs
  18. 3 3
      src/NTMinerClient/Core/Impl/SysDicItemSet.cs
  19. 3 3
      src/NTMinerClient/Core/Impl/SysDicSet.cs
  20. 5 5
      src/NTMinerClient/Core/Kernels/Impl/CoinKernelSet.cs
  21. 3 3
      src/NTMinerClient/Core/Kernels/Impl/KernelInputSet.cs
  22. 3 3
      src/NTMinerClient/Core/Kernels/Impl/KernelOutputSet.cs
  23. 3 3
      src/NTMinerClient/Core/Kernels/Impl/KernelOutputTranslaterSet.cs
  24. 3 3
      src/NTMinerClient/Core/Kernels/Impl/KernelSet.cs
  25. 3 3
      src/NTMinerClient/Core/Kernels/Impl/PackageSet.cs
  26. 3 3
      src/NTMinerClient/Core/Kernels/Impl/PoolKernelSet.cs
  27. 73 73
      src/NTMinerClient/Core/Messages.cs
  28. 4 4
      src/NTMinerClient/Core/MinerServer/Impl/ColumnsShowSet.cs
  29. 4 4
      src/NTMinerClient/Core/MinerServer/Impl/MineWorkSet.cs
  30. 4 4
      src/NTMinerClient/Core/MinerServer/Impl/MinerGroupSet.cs
  31. 4 4
      src/NTMinerClient/Core/MinerServer/Impl/NTMinerWalletSet.cs
  32. 4 4
      src/NTMinerClient/Core/MinerServer/Impl/OverClockDataSet.cs
  33. 3 3
      src/NTMinerClient/Core/MinerServer/Impl/ServerAppSettingSet.cs
  34. 4 4
      src/NTMinerClient/Core/MinerServer/Impl/UserSet.cs
  35. 2 2
      src/NTMinerClient/Core/Profiles/Impl/GpuProfileSet.cs
  36. 3 3
      src/NTMinerClient/Core/Profiles/Impl/WalletSet.cs
  37. 3 3
      src/NTMinerRpcClient/KernelOutputKeyword/KernelOutputKeywordSet.cs
  38. 3 3
      src/NTMinerServices/Data/Impl/UserSet.cs
  39. 1 1
      src/NTMinerlib/AppSetting/LocalAppSettingSet.cs
  40. 1 1
      src/NTMinerlib/LocalMessage/LocalMessageSet.cs
  41. 6 6
      src/NTMinerlib/Messages.cs
  42. 4 3
      src/NTMinerlib/User/Messages.cs

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

@@ -399,7 +399,7 @@ namespace NTMiner.Vms {
             using (var webClient = VirtualRoot.CreateWebClient(10)) {
                 webClient.DownloadFileCompleted += (object sender, System.ComponentModel.AsyncCompletedEventArgs e) => {
                     if (!e.Cancelled && e.Error == null) {
-                        VirtualRoot.RaiseEvent(new CoinIconDownloadedEvent(this));
+                        VirtualRoot.RaiseEvent(new CoinIconDownloadedEvent(Guid.Empty, this));
                     }
                     else {
                         File.Delete(iconFileFullName);

+ 2 - 2
src/MinerClient/App.xaml.cs

@@ -162,10 +162,10 @@ namespace NTMiner {
                         return;
                     }
                     var coinShare = NTMinerRoot.Instance.CoinShareSet.GetOrCreate(mainCoin.GetId());
-                    VirtualRoot.RaiseEvent(new ShareChangedEvent(coinShare));
+                    VirtualRoot.RaiseEvent(new ShareChangedEvent(Guid.Empty, coinShare));
                     if ((NTMinerRoot.Instance.LockedMineContext is IDualMineContext dualMineContext) && dualMineContext.DualCoin != null) {
                         coinShare = NTMinerRoot.Instance.CoinShareSet.GetOrCreate(dualMineContext.DualCoin.GetId());
-                        VirtualRoot.RaiseEvent(new ShareChangedEvent(coinShare));
+                        VirtualRoot.RaiseEvent(new ShareChangedEvent(Guid.Empty, coinShare));
                     }
                     AppContext.Instance.GpuSpeedVms.Refresh();
                 }

+ 3 - 4
src/NTMinerBus/Bus/DomainEvent`1.cs

@@ -2,16 +2,15 @@
 
 namespace NTMiner.Bus {
     public abstract class DomainEvent<TEntity> : IEvent {
-        protected DomainEvent(TEntity source) {
+        protected DomainEvent(Guid pathId, TEntity source) {
             this.Id = Guid.NewGuid();
+            this.PathId = pathId;
             this.Source = source;
             this.Timestamp = DateTime.Now;
         }
-        public Guid GetId() {
-            return this.Id;
-        }
 
         public Guid Id { get; private set; }
+        public Guid PathId { get; private set; }
         public DateTime Timestamp { get; private set; }
         public TEntity Source { get; private set; }
     }

+ 4 - 3
src/NTMinerBus/Bus/EventBase.cs

@@ -7,13 +7,14 @@ namespace NTMiner.Bus {
             this.Timestamp = DateTime.Now;
         }
 
-        protected EventBase(Guid id) {
-            this.Id = id;
-            this.Timestamp = DateTime.Now;
+        protected EventBase(Guid pathId) : this() {
+            this.PathId = pathId;
         }
 
         public Guid Id { get; private set; }
 
+        public Guid PathId { get; private set; }
+
         public DateTime Timestamp { get; private set; }
     }
 }

+ 1 - 0
src/NTMinerBus/Bus/IEvent.cs

@@ -2,6 +2,7 @@
     using System;
 
     public interface IEvent : IMessage {
+        Guid PathId { get; }
         DateTime Timestamp { get; }
     }
 }

+ 4 - 1
src/NTMinerBus/Bus/MessageDispatcher.cs

@@ -30,7 +30,10 @@
                 var messageHandlers = _handlers[messageType].ToArray();
                 foreach (var messageHandler in messageHandlers) {
                     var tMessageHandler = (MessagePath<TMessage>)messageHandler;
-                    bool isMatch = tMessageHandler.PathId == Guid.Empty || tMessageHandler.PathId == message.Id;
+                    bool isMatch = tMessageHandler.PathId == Guid.Empty || message is ICmd;
+                    if (!isMatch && message is IEvent evt) {
+                        isMatch = tMessageHandler.PathId == evt.PathId;
+                    }
                     if (tMessageHandler.ViaLimit > 0) {
                         if (isMatch) {
                             lock (tMessageHandler) {

+ 1 - 1
src/NTMinerClient/Core/Gpus/Impl/AMDGpuSet.cs

@@ -112,7 +112,7 @@ namespace NTMiner.Core.Gpus.Impl {
             gpu.FanSpeed = speed;
 
             if (isChanged) {
-                VirtualRoot.RaiseEvent(new GpuStateChangedEvent(gpu));
+                VirtualRoot.RaiseEvent(new GpuStateChangedEvent(Guid.Empty, gpu));
             }
         }
 

+ 2 - 1
src/NTMinerClient/Core/Gpus/Impl/GpuOverClock.cs

@@ -1,4 +1,5 @@
 using NTMiner.Gpus;
+using System;
 
 namespace NTMiner.Core.Gpus.Impl {
     public class GpuOverClock : IOverClock {
@@ -18,7 +19,7 @@ namespace NTMiner.Core.Gpus.Impl {
             catch (System.Exception e) {
                 Logger.ErrorDebugLine(e);
             }
-            VirtualRoot.RaiseEvent(new GpuStateChangedEvent(gpu));
+            VirtualRoot.RaiseEvent(new GpuStateChangedEvent(Guid.Empty, gpu));
         }
 
         public void SetCoreClock(int gpuIndex, int value, int voltage) {

+ 6 - 6
src/NTMinerClient/Core/Gpus/Impl/GpusSpeed.cs

@@ -110,7 +110,7 @@ namespace NTMiner.Core.Gpus.Impl {
             }
             CheckReset();
             gpuSpeed.IncreaseMainCoinFoundShare();
-            VirtualRoot.RaiseEvent(new FoundShareIncreasedEvent(gpuSpeed: gpuSpeed));
+            VirtualRoot.RaiseEvent(new FoundShareIncreasedEvent(Guid.Empty, gpuSpeed: gpuSpeed));
         }
 
         public void IncreaseAcceptShare(int gpuIndex) {
@@ -120,7 +120,7 @@ namespace NTMiner.Core.Gpus.Impl {
             }
             CheckReset();
             gpuSpeed.IncreaseMainCoinAcceptShare();
-            VirtualRoot.RaiseEvent(new AcceptShareIncreasedEvent(gpuSpeed: gpuSpeed));
+            VirtualRoot.RaiseEvent(new AcceptShareIncreasedEvent(Guid.Empty, gpuSpeed: gpuSpeed));
         }
 
         public void IncreaseRejectShare(int gpuIndex) {
@@ -130,7 +130,7 @@ namespace NTMiner.Core.Gpus.Impl {
             }
             CheckReset();
             gpuSpeed.IncreaseMainCoinRejectShare();
-            VirtualRoot.RaiseEvent(new RejectShareIncreasedEvent(gpuSpeed: gpuSpeed));
+            VirtualRoot.RaiseEvent(new RejectShareIncreasedEvent(Guid.Empty, gpuSpeed: gpuSpeed));
         }
 
         public void IncreaseIncorrectShare(int gpuIndex) {
@@ -140,14 +140,14 @@ namespace NTMiner.Core.Gpus.Impl {
             }
             CheckReset();
             gpuSpeed.IncreaseMainCoinIncorrectShare();
-            VirtualRoot.RaiseEvent(new IncorrectShareIncreasedEvent(gpuSpeed: gpuSpeed));
+            VirtualRoot.RaiseEvent(new IncorrectShareIncreasedEvent(Guid.Empty, gpuSpeed: gpuSpeed));
         }
 
         public void ResetShare() {
             InitOnece();
             foreach (var gpuSpeed in _currentGpuSpeed.Values) {
                 gpuSpeed.ResetShare();
-                VirtualRoot.RaiseEvent(new GpuShareChangedEvent(gpuSpeed: gpuSpeed));
+                VirtualRoot.RaiseEvent(new GpuShareChangedEvent(Guid.Empty, gpuSpeed: gpuSpeed));
             }
         }
 
@@ -213,7 +213,7 @@ namespace NTMiner.Core.Gpus.Impl {
                 }
             }
             if (isChanged) {
-                VirtualRoot.RaiseEvent(new GpuSpeedChangedEvent(isDual: isDual, gpuSpeed: gpuSpeed));
+                VirtualRoot.RaiseEvent(new GpuSpeedChangedEvent(isDual: isDual, Guid.Empty, gpuSpeed: gpuSpeed));
             }
         }
 

+ 1 - 1
src/NTMinerClient/Core/Gpus/Impl/NVIDIAGpuSet.cs

@@ -89,7 +89,7 @@ namespace NTMiner.Core.Gpus.Impl {
             gpu.FanSpeed = fanSpeed;
 
             if (isChanged) {
-                VirtualRoot.RaiseEvent(new GpuStateChangedEvent(gpu));
+                VirtualRoot.RaiseEvent(new GpuStateChangedEvent(Guid.Empty, gpu));
             }
         }
 

+ 2 - 2
src/NTMinerClient/Core/Impl/CoinGroupSet.cs

@@ -24,7 +24,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<CoinGroupData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new CoinGroupAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new CoinGroupAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemoveCoinGroupCommand>("移除币组", LogEnum.DevConsole,
                 action: (message) => {
@@ -40,7 +40,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<CoinGroupData>();
                     repository.Remove(message.EntityId);
 
-                    VirtualRoot.RaiseEvent(new CoinGroupRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new CoinGroupRemovedEvent(message.Id, entity));
                 });
         }
 

+ 3 - 3
src/NTMinerClient/Core/Impl/CoinSet.cs

@@ -29,7 +29,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<CoinData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new CoinAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new CoinAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<UpdateCoinCommand>("更新币种", LogEnum.DevConsole,
                 action: message => {
@@ -51,7 +51,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<CoinData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new CoinUpdatedEvent(message.Input));
+                    VirtualRoot.RaiseEvent(new CoinUpdatedEvent(message.Id, message.Input));
                 });
             context.BuildCmdPath<RemoveCoinCommand>("移除币种", LogEnum.DevConsole,
                 action: message => {
@@ -86,7 +86,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<CoinData>();
                     repository.Remove(entity.Id);
 
-                    VirtualRoot.RaiseEvent(new CoinRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new CoinRemovedEvent(message.Id, entity));
                 });
         }
 

+ 1 - 1
src/NTMinerClient/Core/Impl/CoinShareSet.cs

@@ -56,7 +56,7 @@ namespace NTMiner.Core.Impl {
             }
             coinShare.ShareOn = now;
             if (isChanged) {
-                VirtualRoot.RaiseEvent(new ShareChangedEvent(coinShare));
+                VirtualRoot.RaiseEvent(new ShareChangedEvent(Guid.Empty, coinShare));
             }
         }
     }

+ 3 - 3
src/NTMinerClient/Core/Impl/FileWriterSet.cs

@@ -23,7 +23,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<FileWriterData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new FileWriterAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new FileWriterAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<UpdateFileWriterCommand>("更新文件书写器", LogEnum.DevConsole,
                 action: (message) => {
@@ -45,7 +45,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<FileWriterData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new FileWriterUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new FileWriterUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemoveFileWriterCommand>("移除文件书写器", LogEnum.DevConsole,
                 action: (message) => {
@@ -61,7 +61,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<FileWriterData>();
                     repository.Remove(message.EntityId);
 
-                    VirtualRoot.RaiseEvent(new FileWriterRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new FileWriterRemovedEvent(message.Id, entity));
                 });
         }
 

+ 3 - 3
src/NTMinerClient/Core/Impl/FragmentWriterSet.cs

@@ -23,7 +23,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<FragmentWriterData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new FragmentWriterAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new FragmentWriterAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<UpdateFragmentWriterCommand>("更新命令行片段书写器", LogEnum.DevConsole,
                 action: (message) => {
@@ -45,7 +45,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<FragmentWriterData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new FragmentWriterUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new FragmentWriterUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemoveFragmentWriterCommand>("移除组", LogEnum.DevConsole,
                 action: (message) => {
@@ -61,7 +61,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<FragmentWriterData>();
                     repository.Remove(message.EntityId);
 
-                    VirtualRoot.RaiseEvent(new FragmentWriterRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new FragmentWriterRemovedEvent(message.Id, entity));
                 });
         }
 

+ 3 - 3
src/NTMinerClient/Core/Impl/GroupSet.cs

@@ -23,7 +23,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<GroupData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new GroupAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new GroupAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<UpdateGroupCommand>("更新组", LogEnum.DevConsole,
                 action: (message) => {
@@ -45,7 +45,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<GroupData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new GroupUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new GroupUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemoveGroupCommand>("移除组", LogEnum.DevConsole,
                 action: (message) => {
@@ -65,7 +65,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<GroupData>();
                     repository.Remove(message.EntityId);
 
-                    VirtualRoot.RaiseEvent(new GroupRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new GroupRemovedEvent(message.Id, entity));
                 });
         }
 

+ 3 - 3
src/NTMinerClient/Core/Impl/PoolSet.cs

@@ -39,7 +39,7 @@ namespace NTMiner.Core.Impl {
                         repository.Add(entity);
                     }
 
-                    VirtualRoot.RaiseEvent(new PoolAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new PoolAddedEvent(message.Id, entity));
 
                     if (context.CoinSet.TryGetCoin(message.Input.CoinId, out ICoin coin)) {
                         ICoinKernel[] coinKernels = context.CoinKernelSet.AsEnumerable().Where(a => a.CoinId == coin.GetId()).ToArray();
@@ -86,7 +86,7 @@ namespace NTMiner.Core.Impl {
                         repository.Update(new PoolData().Update(message.Input));
                     }
 
-                    VirtualRoot.RaiseEvent(new PoolUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new PoolUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemovePoolCommand>("移除矿池", LogEnum.DevConsole,
                 action: (message) => {
@@ -107,7 +107,7 @@ namespace NTMiner.Core.Impl {
                         var repository = NTMinerRoot.CreateCompositeRepository<PoolData>();
                         repository.Remove(message.EntityId);
                     }
-                    VirtualRoot.RaiseEvent(new PoolRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new PoolRemovedEvent(message.Id, entity));
                     Guid[] toRemoves = context.PoolKernelSet.AsEnumerable().Where(a => a.PoolId == message.EntityId).Select(a => a.GetId()).ToArray();
                     foreach (Guid poolKernelId in toRemoves) {
                         VirtualRoot.Execute(new RemovePoolKernelCommand(poolKernelId));

+ 3 - 3
src/NTMinerClient/Core/Impl/SysDicItemSet.cs

@@ -34,7 +34,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateCompositeRepository<SysDicItemData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new SysDicItemAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new SysDicItemAddedEvent(message.Id, entity));
                 });
             _context.BuildCmdPath<UpdateSysDicItemCommand>("更新系统字典项", LogEnum.DevConsole,
                 action: (message) => {
@@ -62,7 +62,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateCompositeRepository<SysDicItemData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new SysDicItemUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new SysDicItemUpdatedEvent(message.Id, entity));
                 });
             _context.BuildCmdPath<RemoveSysDicItemCommand>("移除系统字典项", LogEnum.DevConsole,
                 action: (message) => {
@@ -83,7 +83,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateCompositeRepository<SysDicItemData>();
                     repository.Remove(entity.Id);
 
-                    VirtualRoot.RaiseEvent(new SysDicItemRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new SysDicItemRemovedEvent(message.Id, entity));
                 });
         }
 

+ 3 - 3
src/NTMinerClient/Core/Impl/SysDicSet.cs

@@ -29,7 +29,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<SysDicData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new SysDicAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new SysDicAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<UpdateSysDicCommand>("更新系统字典", LogEnum.DevConsole,
                 action: message => {
@@ -51,7 +51,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<SysDicData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new SysDicUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new SysDicUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemoveSysDicCommand>("移除系统字典", LogEnum.DevConsole,
                 action: message => {
@@ -74,7 +74,7 @@ namespace NTMiner.Core.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<SysDicData>();
                     repository.Remove(entity.Id);
 
-                    VirtualRoot.RaiseEvent(new SysDicRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new SysDicRemovedEvent(message.Id, entity));
                 });
         }
 

+ 5 - 5
src/NTMinerClient/Core/Kernels/Impl/CoinKernelSet.cs

@@ -27,7 +27,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<CoinKernelData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new CoinKernelAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new CoinKernelAddedEvent(message.Id, entity));
 
                     if (context.CoinSet.TryGetCoin(message.Input.CoinId, out ICoin coin)) {
                         IPool[] pools = context.PoolSet.AsEnumerable().Where(a => a.CoinId == coin.GetId()).ToArray();
@@ -63,7 +63,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<CoinKernelData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new CoinKernelUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new CoinKernelUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemoveCoinKernelCommand>("移除币种内核", LogEnum.DevConsole,
                 action: (message) => {
@@ -79,7 +79,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<CoinKernelData>();
                     repository.Remove(entity.Id);
 
-                    VirtualRoot.RaiseEvent(new CoinKernelRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new CoinKernelRemovedEvent(message.Id, entity));
                     if (context.CoinSet.TryGetCoin(entity.CoinId, out ICoin coin)) {
                         List<Guid> toRemoves = new List<Guid>();
                         IPool[] pools = context.PoolSet.AsEnumerable().Where(a => a.CoinId == coin.GetId()).ToArray();
@@ -100,7 +100,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     foreach (var entity in entities) {
                         entity.FileWriterIds = new List<Guid>(entity.FileWriterIds.Where(a => a != message.Source.GetId()));
                         repository.Update(entity);
-                        VirtualRoot.RaiseEvent(new CoinKernelUpdatedEvent(entity));
+                        VirtualRoot.RaiseEvent(new CoinKernelUpdatedEvent(message.Id, entity));
                     }
                 });
             context.BuildEventPath<FragmentWriterRemovedEvent>("移除命令行片段书写器后移除引用关系", LogEnum.DevConsole,
@@ -110,7 +110,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     foreach (var entity in entities) {
                         entity.FragmentWriterIds = new List<Guid>(entity.FragmentWriterIds.Where(a => a != message.Source.GetId()));
                         repository.Update(entity);
-                        VirtualRoot.RaiseEvent(new CoinKernelUpdatedEvent(entity));
+                        VirtualRoot.RaiseEvent(new CoinKernelUpdatedEvent(message.Id, entity));
                     }
                 });
         }

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/KernelInputSet.cs

@@ -21,7 +21,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelInputData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new KernelInputAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelInputAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<UpdateKernelInputCommand>("更新内核输入组", LogEnum.DevConsole,
                 action: (message) => {
@@ -43,7 +43,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelInputData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new KernelInputUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelInputUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemoveKernelInputCommand>("移除内核输入组", LogEnum.DevConsole,
                 action: (message) => {
@@ -59,7 +59,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelInputData>();
                     repository.Remove(message.EntityId);
 
-                    VirtualRoot.RaiseEvent(new KernelInputRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelInputRemovedEvent(message.Id, entity));
                 });
         }
 

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/KernelOutputSet.cs

@@ -24,7 +24,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelOutputData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new KernelOutputAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelOutputAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<UpdateKernelOutputCommand>("更新内核输出组", LogEnum.DevConsole,
                 action: (message) => {
@@ -46,7 +46,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelOutputData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new KernelOutputUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelOutputUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemoveKernelOutputCommand>("移除内核输出组", LogEnum.DevConsole,
                 action: (message) => {
@@ -70,7 +70,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelOutputData>();
                     repository.Remove(message.EntityId);
 
-                    VirtualRoot.RaiseEvent(new KernelOutputRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelOutputRemovedEvent(message.Id, entity));
                 });
             #endregion
         }

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/KernelOutputTranslaterSet.cs

@@ -38,7 +38,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelOutputTranslaterData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new KernelOutputTranslaterAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelOutputTranslaterAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<UpdateKernelOutputTranslaterCommand>("更新内核输出翻译器", LogEnum.DevConsole,
                 action: (message) => {
@@ -62,7 +62,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelOutputTranslaterData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new KernelOutputTranslaterUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelOutputTranslaterUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemoveKernelOutputTranslaterCommand>("移除内核输出翻译器", LogEnum.DevConsole,
                 action: (message) => {
@@ -80,7 +80,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelOutputTranslaterData>();
                     repository.Remove(entity.Id);
 
-                    VirtualRoot.RaiseEvent(new KernelOutputTranslaterRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelOutputTranslaterRemovedEvent(message.Id, entity));
                 });
         }
 

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/KernelSet.cs

@@ -24,7 +24,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new KernelAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<UpdateKernelCommand>("更新内核", LogEnum.DevConsole,
                 action: message => {
@@ -46,7 +46,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new KernelUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemoveKernelCommand>("移除内核", LogEnum.DevConsole,
                 action: message => {
@@ -66,7 +66,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<KernelData>();
                     repository.Remove(entity.Id);
 
-                    VirtualRoot.RaiseEvent(new KernelRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new KernelRemovedEvent(message.Id, entity));
                 });
         }
 

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/PackageSet.cs

@@ -27,7 +27,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<PackageData>();
                     repository.Add(entity);
 
-                    VirtualRoot.RaiseEvent(new PackageAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new PackageAddedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<UpdatePackageCommand>("更新包", LogEnum.DevConsole,
                 action: message => {
@@ -52,7 +52,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<PackageData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new PackageUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new PackageUpdatedEvent(message.Id, entity));
                 });
             context.BuildCmdPath<RemovePackageCommand>("移除包", LogEnum.DevConsole,
                 action: message => {
@@ -68,7 +68,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<PackageData>();
                     repository.Remove(entity.Id);
 
-                    VirtualRoot.RaiseEvent(new PackageRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new PackageRemovedEvent(message.Id, entity));
                 });
         }
 

+ 3 - 3
src/NTMinerClient/Core/Kernels/Impl/PoolKernelSet.cs

@@ -16,7 +16,7 @@ namespace NTMiner.Core.Kernels.Impl {
                         _dicById.Add(message.Input.GetId(), entity);
                         var repository = NTMinerRoot.CreateServerRepository<PoolKernelData>();
                         repository.Add(entity);
-                        VirtualRoot.RaiseEvent(new PoolKernelAddedEvent(message.Input));
+                        VirtualRoot.RaiseEvent(new PoolKernelAddedEvent(message.Id, message.Input));
                     }
                 });
             _context.BuildCmdPath<RemovePoolKernelCommand>("处理移除矿池级内核命令", LogEnum.DevConsole,
@@ -26,7 +26,7 @@ namespace NTMiner.Core.Kernels.Impl {
                         _dicById.Remove(message.EntityId);
                         var repository = NTMinerRoot.CreateServerRepository<PoolKernelData>();
                         repository.Remove(message.EntityId);
-                        VirtualRoot.RaiseEvent(new PoolKernelRemovedEvent(entity));
+                        VirtualRoot.RaiseEvent(new PoolKernelRemovedEvent(message.Id, entity));
                     }
                 });
             _context.BuildCmdPath<UpdatePoolKernelCommand>("更新矿池内核", LogEnum.DevConsole,
@@ -49,7 +49,7 @@ namespace NTMiner.Core.Kernels.Impl {
                     var repository = NTMinerRoot.CreateServerRepository<PoolKernelData>();
                     repository.Update(entity);
 
-                    VirtualRoot.RaiseEvent(new PoolKernelUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new PoolKernelUpdatedEvent(message.Id, entity));
                 });
         }
 

+ 73 - 73
src/NTMinerClient/Core/Messages.cs

@@ -164,19 +164,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加工作后")]
     public class MineWorkAddedEvent : DomainEvent<IMineWork> {
-        public MineWorkAddedEvent(IMineWork source) : base(source) {
+        public MineWorkAddedEvent(Guid pathId, IMineWork source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新工作后")]
     public class MineWorkUpdatedEvent : DomainEvent<IMineWork> {
-        public MineWorkUpdatedEvent(IMineWork source) : base(source) {
+        public MineWorkUpdatedEvent(Guid pathId, IMineWork source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "删除工作后")]
     public class MineWorkRemovedEvent : DomainEvent<IMineWork> {
-        public MineWorkRemovedEvent(IMineWork source) : base(source) {
+        public MineWorkRemovedEvent(Guid pathId, IMineWork source) : base(pathId, source) {
         }
     }
     #endregion
@@ -202,19 +202,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加矿机分组后")]
     public class MinerGroupAddedEvent : DomainEvent<IMinerGroup> {
-        public MinerGroupAddedEvent(IMinerGroup source) : base(source) {
+        public MinerGroupAddedEvent(Guid pathId, IMinerGroup source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新矿机分组后")]
     public class MinerGroupUpdatedEvent : DomainEvent<IMinerGroup> {
-        public MinerGroupUpdatedEvent(IMinerGroup source) : base(source) {
+        public MinerGroupUpdatedEvent(Guid pathId, IMinerGroup source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "删除矿机分组后")]
     public class MinerGroupRemovedEvent : DomainEvent<IMinerGroup> {
-        public MinerGroupRemovedEvent(IMinerGroup source) : base(source) {
+        public MinerGroupRemovedEvent(Guid pathId, IMinerGroup source) : base(pathId, source) {
         }
     }
     #endregion
@@ -240,19 +240,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加NTMiner钱包后")]
     public class NTMinerWalletAddedEvent : DomainEvent<INTMinerWallet> {
-        public NTMinerWalletAddedEvent(INTMinerWallet source) : base(source) {
+        public NTMinerWalletAddedEvent(Guid pathId, INTMinerWallet source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新NTMiner钱包后")]
     public class NTMinerWalletUpdatedEvent : DomainEvent<INTMinerWallet> {
-        public NTMinerWalletUpdatedEvent(INTMinerWallet source) : base(source) {
+        public NTMinerWalletUpdatedEvent(Guid pathId, INTMinerWallet source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "删除NTMiner钱包后")]
     public class NTMinerWalletRemovedEvent : DomainEvent<INTMinerWallet> {
-        public NTMinerWalletRemovedEvent(INTMinerWallet source) : base(source) {
+        public NTMinerWalletRemovedEvent(Guid pathId, INTMinerWallet source) : base(pathId, source) {
         }
     }
     #endregion
@@ -278,19 +278,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加超频建议后")]
     public class OverClockDataAddedEvent : DomainEvent<IOverClockData> {
-        public OverClockDataAddedEvent(IOverClockData source) : base(source) {
+        public OverClockDataAddedEvent(Guid pathId, IOverClockData source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新超频建议后")]
     public class OverClockDataUpdatedEvent : DomainEvent<IOverClockData> {
-        public OverClockDataUpdatedEvent(IOverClockData source) : base(source) {
+        public OverClockDataUpdatedEvent(Guid pathId, IOverClockData source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "删除超频建议后")]
     public class OverClockDataRemovedEvent : DomainEvent<IOverClockData> {
-        public OverClockDataRemovedEvent(IOverClockData source) : base(source) {
+        public OverClockDataRemovedEvent(Guid pathId, IOverClockData source) : base(pathId, source) {
         }
     }
 
@@ -328,19 +328,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加列显后")]
     public class ColumnsShowAddedEvent : DomainEvent<IColumnsShow> {
-        public ColumnsShowAddedEvent(IColumnsShow source) : base(source) {
+        public ColumnsShowAddedEvent(Guid pathId, IColumnsShow source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新列显后")]
     public class ColumnsShowUpdatedEvent : DomainEvent<IColumnsShow> {
-        public ColumnsShowUpdatedEvent(IColumnsShow source) : base(source) {
+        public ColumnsShowUpdatedEvent(Guid pathId, IColumnsShow source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "删除列显后")]
     public class ColumnsShowRemovedEvent : DomainEvent<IColumnsShow> {
-        public ColumnsShowRemovedEvent(IColumnsShow source) : base(source) {
+        public ColumnsShowRemovedEvent(Guid pathId, IColumnsShow source) : base(pathId, source) {
         }
     }
     #endregion
@@ -366,13 +366,13 @@ namespace NTMiner.Core {
     
     [MessageType(description: "币种超频完成后")]
     public class CoinOverClockDoneEvent : EventBase {
-        public CoinOverClockDoneEvent(Guid id) : base(id) {
+        public CoinOverClockDoneEvent(Guid pathId) : base(pathId) {
         }
     }
 
     [MessageType(description: "Gpu超频数据添加或更新后")]
     public class GpuProfileAddedOrUpdatedEvent : DomainEvent<IGpuProfile> {
-        public GpuProfileAddedOrUpdatedEvent(IGpuProfile source) : base(source) {
+        public GpuProfileAddedOrUpdatedEvent(Guid pathId, IGpuProfile source) : base(pathId, source) {
         }
     }
     #endregion
@@ -380,7 +380,7 @@ namespace NTMiner.Core {
     #region speed and share
     [MessageType(description: "显卡算力变更事件")]
     public class GpuSpeedChangedEvent : DomainEvent<IGpuSpeed> {
-        public GpuSpeedChangedEvent(bool isDual, IGpuSpeed gpuSpeed) : base(gpuSpeed) {
+        public GpuSpeedChangedEvent(bool isDual, Guid pathId, IGpuSpeed gpuSpeed) : base(pathId, gpuSpeed) {
             this.IsDual = isDual;
         }
 
@@ -389,37 +389,37 @@ namespace NTMiner.Core {
 
     [MessageType(description: "显卡份额变更事件")]
     public class GpuShareChangedEvent : DomainEvent<IGpuSpeed> {
-        public GpuShareChangedEvent(IGpuSpeed gpuSpeed) : base(gpuSpeed) {
+        public GpuShareChangedEvent(Guid pathId, IGpuSpeed gpuSpeed) : base(pathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "找到了一个份额")]
     public class FoundShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public FoundShareIncreasedEvent(IGpuSpeed gpuSpeed) : base(gpuSpeed) {
+        public FoundShareIncreasedEvent(Guid pathId, IGpuSpeed gpuSpeed) : base(pathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "接受了一个份额")]
     public class AcceptShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public AcceptShareIncreasedEvent(IGpuSpeed gpuSpeed) : base(gpuSpeed) {
+        public AcceptShareIncreasedEvent(Guid pathId, IGpuSpeed gpuSpeed) : base(pathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "拒绝了一个份额")]
     public class RejectShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public RejectShareIncreasedEvent(IGpuSpeed gpuSpeed) : base(gpuSpeed) {
+        public RejectShareIncreasedEvent(Guid pathId, IGpuSpeed gpuSpeed) : base(pathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "算错了一个份额")]
     public class IncorrectShareIncreasedEvent : DomainEvent<IGpuSpeed> {
-        public IncorrectShareIncreasedEvent(IGpuSpeed gpuSpeed) : base(gpuSpeed) {
+        public IncorrectShareIncreasedEvent(Guid pathId, IGpuSpeed gpuSpeed) : base(pathId, gpuSpeed) {
         }
     }
 
     [MessageType(description: "收益变更事件")]
     public class ShareChangedEvent : DomainEvent<ICoinShare> {
-        public ShareChangedEvent(ICoinShare share) : base(share) {
+        public ShareChangedEvent(Guid pathId, ICoinShare share) : base(pathId, share) {
         }
     }
     #endregion
@@ -427,7 +427,7 @@ namespace NTMiner.Core {
     #region Gpu Messages
     [MessageType(description: "显卡状态变更事件", isCanNoHandler: true)]
     public class GpuStateChangedEvent : DomainEvent<IGpu> {
-        public GpuStateChangedEvent(IGpu source) : base(source) {
+        public GpuStateChangedEvent(Guid pathId, IGpu source) : base(pathId, source) {
         }
     }
     #endregion
@@ -453,19 +453,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加系统字典后")]
     public class SysDicAddedEvent : DomainEvent<ISysDic> {
-        public SysDicAddedEvent(ISysDic source) : base(source) {
+        public SysDicAddedEvent(Guid pathId, ISysDic source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新系统字典后")]
     public class SysDicUpdatedEvent : DomainEvent<ISysDic> {
-        public SysDicUpdatedEvent(ISysDic source) : base(source) {
+        public SysDicUpdatedEvent(Guid pathId, ISysDic source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "删除系统字典后")]
     public class SysDicRemovedEvent : DomainEvent<ISysDic> {
-        public SysDicRemovedEvent(ISysDic source) : base(source) {
+        public SysDicRemovedEvent(Guid pathId, ISysDic source) : base(pathId, source) {
         }
     }
     #endregion
@@ -491,19 +491,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了系统字典项后")]
     public class SysDicItemAddedEvent : DomainEvent<ISysDicItem> {
-        public SysDicItemAddedEvent(ISysDicItem source) : base(source) {
+        public SysDicItemAddedEvent(Guid pathId, ISysDicItem source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了系统字典项后")]
     public class SysDicItemUpdatedEvent : DomainEvent<ISysDicItem> {
-        public SysDicItemUpdatedEvent(ISysDicItem source) : base(source) {
+        public SysDicItemUpdatedEvent(Guid pathId, ISysDicItem source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "删除了系统字典项后")]
     public class SysDicItemRemovedEvent : DomainEvent<ISysDicItem> {
-        public SysDicItemRemovedEvent(ISysDicItem source) : base(source) {
+        public SysDicItemRemovedEvent(Guid pathId, ISysDicItem source) : base(pathId, source) {
         }
     }
     #endregion
@@ -529,25 +529,25 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了币种后")]
     public class CoinAddedEvent : DomainEvent<ICoin> {
-        public CoinAddedEvent(ICoin source) : base(source) {
+        public CoinAddedEvent(Guid pathId, ICoin source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了币种后")]
     public class CoinUpdatedEvent : DomainEvent<ICoin> {
-        public CoinUpdatedEvent(ICoin source) : base(source) {
+        public CoinUpdatedEvent(Guid pathId, ICoin source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了币种后")]
     public class CoinRemovedEvent : DomainEvent<ICoin> {
-        public CoinRemovedEvent(ICoin source) : base(source) {
+        public CoinRemovedEvent(Guid pathId, ICoin source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "下载了币种图标后")]
     public class CoinIconDownloadedEvent : DomainEvent<ICoin> {
-        public CoinIconDownloadedEvent(ICoin source) : base(source) {
+        public CoinIconDownloadedEvent(Guid pathId, ICoin source) : base(pathId, source) {
         }
     }
     #endregion
@@ -573,19 +573,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了组后")]
     public class GroupAddedEvent : DomainEvent<IGroup> {
-        public GroupAddedEvent(IGroup source) : base(source) {
+        public GroupAddedEvent(Guid pathId, IGroup source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了组后")]
     public class GroupUpdatedEvent : DomainEvent<IGroup> {
-        public GroupUpdatedEvent(IGroup source) : base(source) {
+        public GroupUpdatedEvent(Guid pathId, IGroup source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了组后")]
     public class GroupRemovedEvent : DomainEvent<IGroup> {
-        public GroupRemovedEvent(IGroup source) : base(source) {
+        public GroupRemovedEvent(Guid pathId, IGroup source) : base(pathId, source) {
         }
     }
     #endregion
@@ -611,13 +611,13 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了币组后")]
     public class CoinGroupAddedEvent : DomainEvent<ICoinGroup> {
-        public CoinGroupAddedEvent(ICoinGroup source) : base(source) {
+        public CoinGroupAddedEvent(Guid pathId, ICoinGroup source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了币组后")]
     public class CoinGroupRemovedEvent : DomainEvent<ICoinGroup> {
-        public CoinGroupRemovedEvent(ICoinGroup source) : base(source) {
+        public CoinGroupRemovedEvent(Guid pathId, ICoinGroup source) : base(pathId, source) {
         }
     }
     #endregion
@@ -643,19 +643,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了文件书写器后")]
     public class FileWriterAddedEvent : DomainEvent<IFileWriter> {
-        public FileWriterAddedEvent(IFileWriter source) : base(source) {
+        public FileWriterAddedEvent(Guid pathId, IFileWriter source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了文件书写器后")]
     public class FileWriterUpdatedEvent : DomainEvent<IFileWriter> {
-        public FileWriterUpdatedEvent(IFileWriter source) : base(source) {
+        public FileWriterUpdatedEvent(Guid pathId, IFileWriter source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了文件书写器后")]
     public class FileWriterRemovedEvent : DomainEvent<IFileWriter> {
-        public FileWriterRemovedEvent(IFileWriter source) : base(source) {
+        public FileWriterRemovedEvent(Guid pathId, IFileWriter source) : base(pathId, source) {
         }
     }
     #endregion
@@ -681,19 +681,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了命令行片段书写器后")]
     public class FragmentWriterAddedEvent : DomainEvent<IFragmentWriter> {
-        public FragmentWriterAddedEvent(IFragmentWriter source) : base(source) {
+        public FragmentWriterAddedEvent(Guid pathId, IFragmentWriter source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了命令行片段书写器后")]
     public class FragmentWriterUpdatedEvent : DomainEvent<IFragmentWriter> {
-        public FragmentWriterUpdatedEvent(IFragmentWriter source) : base(source) {
+        public FragmentWriterUpdatedEvent(Guid pathId, IFragmentWriter source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了命令行片段书写器后")]
     public class FragmentWriterRemovedEvent : DomainEvent<IFragmentWriter> {
-        public FragmentWriterRemovedEvent(IFragmentWriter source) : base(source) {
+        public FragmentWriterRemovedEvent(Guid pathId, IFragmentWriter source) : base(pathId, source) {
         }
     }
     #endregion
@@ -719,19 +719,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了钱包后")]
     public class WalletAddedEvent : DomainEvent<IWallet> {
-        public WalletAddedEvent(IWallet source) : base(source) {
+        public WalletAddedEvent(Guid pathId, IWallet source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了钱包后")]
     public class WalletUpdatedEvent : DomainEvent<IWallet> {
-        public WalletUpdatedEvent(IWallet source) : base(source) {
+        public WalletUpdatedEvent(Guid pathId, IWallet source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了钱包后")]
     public class WalletRemovedEvent : DomainEvent<IWallet> {
-        public WalletRemovedEvent(IWallet source) : base(source) {
+        public WalletRemovedEvent(Guid pathId, IWallet source) : base(pathId, source) {
         }
     }
     #endregion
@@ -757,19 +757,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了矿池后")]
     public class PoolAddedEvent : DomainEvent<IPool> {
-        public PoolAddedEvent(IPool source) : base(source) {
+        public PoolAddedEvent(Guid pathId, IPool source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了矿池后")]
     public class PoolUpdatedEvent : DomainEvent<IPool> {
-        public PoolUpdatedEvent(IPool source) : base(source) {
+        public PoolUpdatedEvent(Guid pathId, IPool source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了矿池后")]
     public class PoolRemovedEvent : DomainEvent<IPool> {
-        public PoolRemovedEvent(IPool source) : base(source) {
+        public PoolRemovedEvent(Guid pathId, IPool source) : base(pathId, source) {
         }
     }
     #endregion
@@ -795,19 +795,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了币种级内核后")]
     public class CoinKernelAddedEvent : DomainEvent<ICoinKernel> {
-        public CoinKernelAddedEvent(ICoinKernel source) : base(source) {
+        public CoinKernelAddedEvent(Guid pathId, ICoinKernel source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了币种级内核后")]
     public class CoinKernelUpdatedEvent : DomainEvent<ICoinKernel> {
-        public CoinKernelUpdatedEvent(ICoinKernel source) : base(source) {
+        public CoinKernelUpdatedEvent(Guid pathId, ICoinKernel source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了币种级内核后")]
     public class CoinKernelRemovedEvent : DomainEvent<ICoinKernel> {
-        public CoinKernelRemovedEvent(ICoinKernel source) : base(source) {
+        public CoinKernelRemovedEvent(Guid pathId, ICoinKernel source) : base(pathId, source) {
         }
     }
     #endregion
@@ -833,19 +833,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了矿池级内核后")]
     public class PoolKernelAddedEvent : DomainEvent<IPoolKernel> {
-        public PoolKernelAddedEvent(IPoolKernel source) : base(source) {
+        public PoolKernelAddedEvent(Guid pathId, IPoolKernel source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了矿池级内核后")]
     public class PoolKernelUpdatedEvent : DomainEvent<IPoolKernel> {
-        public PoolKernelUpdatedEvent(IPoolKernel source) : base(source) {
+        public PoolKernelUpdatedEvent(Guid pathId, IPoolKernel source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了矿池级内核后")]
     public class PoolKernelRemovedEvent : DomainEvent<IPoolKernel> {
-        public PoolKernelRemovedEvent(IPoolKernel source) : base(source) {
+        public PoolKernelRemovedEvent(Guid pathId, IPoolKernel source) : base(pathId, source) {
         }
     }
     #endregion
@@ -871,19 +871,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了包后")]
     public class PackageAddedEvent : DomainEvent<IPackage> {
-        public PackageAddedEvent(IPackage source) : base(source) {
+        public PackageAddedEvent(Guid pathId, IPackage source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了包后")]
     public class PackageUpdatedEvent : DomainEvent<IPackage> {
-        public PackageUpdatedEvent(IPackage source) : base(source) {
+        public PackageUpdatedEvent(Guid pathId, IPackage source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "删除了包后")]
     public class PackageRemovedEvent : DomainEvent<IPackage> {
-        public PackageRemovedEvent(IPackage source) : base(source) {
+        public PackageRemovedEvent(Guid pathId, IPackage source) : base(pathId, source) {
         }
     }
     #endregion
@@ -909,19 +909,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核后")]
     public class KernelAddedEvent : DomainEvent<IKernel> {
-        public KernelAddedEvent(IKernel source) : base(source) {
+        public KernelAddedEvent(Guid pathId, IKernel source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核后")]
     public class KernelUpdatedEvent : DomainEvent<IKernel> {
-        public KernelUpdatedEvent(IKernel source) : base(source) {
+        public KernelUpdatedEvent(Guid pathId, IKernel source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "删除了内核后")]
     public class KernelRemovedEvent : DomainEvent<IKernel> {
-        public KernelRemovedEvent(IKernel source) : base(source) {
+        public KernelRemovedEvent(Guid pathId, IKernel source) : base(pathId, source) {
         }
     }
     #endregion
@@ -947,19 +947,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核输入组后")]
     public class KernelInputAddedEvent : DomainEvent<IKernelInput> {
-        public KernelInputAddedEvent(IKernelInput source) : base(source) {
+        public KernelInputAddedEvent(Guid pathId, IKernelInput source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核输入组后")]
     public class KernelInputUpdatedEvent : DomainEvent<IKernelInput> {
-        public KernelInputUpdatedEvent(IKernelInput source) : base(source) {
+        public KernelInputUpdatedEvent(Guid pathId, IKernelInput source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了内核输入组后")]
     public class KernelInputRemovedEvent : DomainEvent<IKernelInput> {
-        public KernelInputRemovedEvent(IKernelInput source) : base(source) {
+        public KernelInputRemovedEvent(Guid pathId, IKernelInput source) : base(pathId, source) {
         }
     }
     #endregion
@@ -985,19 +985,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核输出组后")]
     public class KernelOutputAddedEvent : DomainEvent<IKernelOutput> {
-        public KernelOutputAddedEvent(IKernelOutput source) : base(source) {
+        public KernelOutputAddedEvent(Guid pathId, IKernelOutput source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核输出组后")]
     public class KernelOutputUpdatedEvent : DomainEvent<IKernelOutput> {
-        public KernelOutputUpdatedEvent(IKernelOutput source) : base(source) {
+        public KernelOutputUpdatedEvent(Guid pathId, IKernelOutput source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了内核输出组后")]
     public class KernelOutputRemovedEvent : DomainEvent<IKernelOutput> {
-        public KernelOutputRemovedEvent(IKernelOutput source) : base(source) {
+        public KernelOutputRemovedEvent(Guid pathId, IKernelOutput source) : base(pathId, source) {
         }
     }
     #endregion
@@ -1023,19 +1023,19 @@ namespace NTMiner.Core {
 
     [MessageType(description: "添加了内核输出翻译器后")]
     public class KernelOutputTranslaterAddedEvent : DomainEvent<IKernelOutputTranslater> {
-        public KernelOutputTranslaterAddedEvent(IKernelOutputTranslater source) : base(source) {
+        public KernelOutputTranslaterAddedEvent(Guid pathId, IKernelOutputTranslater source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了内核输出翻译器后")]
     public class KernelOutputTranslaterUpdatedEvent : DomainEvent<IKernelOutputTranslater> {
-        public KernelOutputTranslaterUpdatedEvent(IKernelOutputTranslater source) : base(source) {
+        public KernelOutputTranslaterUpdatedEvent(Guid pathId, IKernelOutputTranslater source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了内核输出翻译器后")]
     public class KernelOutputTranslaterRemovedEvent : DomainEvent<IKernelOutputTranslater> {
-        public KernelOutputTranslaterRemovedEvent(IKernelOutputTranslater source) : base(source) {
+        public KernelOutputTranslaterRemovedEvent(Guid pathId, IKernelOutputTranslater source) : base(pathId, source) {
         }
     }
     #endregion

+ 4 - 4
src/NTMinerClient/Core/MinerServer/Impl/ColumnsShowSet.cs

@@ -19,7 +19,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 Server.ColumnsShowService.AddOrUpdateColumnsShowAsync(entity, (response, exception) => {
                     if (response.IsSuccess()) {
                         _dicById.Add(entity.Id, entity);
-                        VirtualRoot.RaiseEvent(new ColumnsShowAddedEvent(entity));
+                        VirtualRoot.RaiseEvent(new ColumnsShowAddedEvent(message.Id, entity));
                     }
                     else {
                         Write.UserFail(response.ReadMessage(exception));
@@ -40,11 +40,11 @@ namespace NTMiner.Core.MinerServer.Impl {
                 Server.ColumnsShowService.AddOrUpdateColumnsShowAsync(entity, (response, exception) => {
                     if (!response.IsSuccess()) {
                         entity.Update(oldValue);
-                        VirtualRoot.RaiseEvent(new ColumnsShowUpdatedEvent(entity));
+                        VirtualRoot.RaiseEvent(new ColumnsShowUpdatedEvent(message.Id, entity));
                         Write.UserFail(response.ReadMessage(exception));
                     }
                 });
-                VirtualRoot.RaiseEvent(new ColumnsShowUpdatedEvent(entity));
+                VirtualRoot.RaiseEvent(new ColumnsShowUpdatedEvent(message.Id, entity));
             });
             VirtualRoot.BuildCmdPath<RemoveColumnsShowCommand>(action: (message) => {
                 InitOnece();
@@ -58,7 +58,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 Server.ColumnsShowService.RemoveColumnsShowAsync(entity.Id, (response, exception) => {
                     if (response.IsSuccess()) {
                         _dicById.Remove(entity.Id);
-                        VirtualRoot.RaiseEvent(new ColumnsShowRemovedEvent(entity));
+                        VirtualRoot.RaiseEvent(new ColumnsShowRemovedEvent(message.Id, entity));
                     }
                     else {
                         Write.UserFail(response.ReadMessage(exception));

+ 4 - 4
src/NTMinerClient/Core/MinerServer/Impl/MineWorkSet.cs

@@ -19,7 +19,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 var response = Server.MineWorkService.AddOrUpdateMineWork(entity);
                 if (response.IsSuccess()) {
                     _dicById.Add(entity.Id, entity);
-                    VirtualRoot.RaiseEvent(new MineWorkAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new MineWorkAddedEvent(message.Id, entity));
                 }
                 else {
                     Write.UserFail(response?.Description);
@@ -39,11 +39,11 @@ namespace NTMiner.Core.MinerServer.Impl {
                 Server.MineWorkService.AddOrUpdateMineWorkAsync(entity, (response, exception) => {
                     if (!response.IsSuccess()) {
                         entity.Update(oldValue);
-                        VirtualRoot.RaiseEvent(new MineWorkUpdatedEvent(entity));
+                        VirtualRoot.RaiseEvent(new MineWorkUpdatedEvent(message.Id, entity));
                         Write.UserFail(response.ReadMessage(exception));
                     }
                 });
-                VirtualRoot.RaiseEvent(new MineWorkUpdatedEvent(entity));
+                VirtualRoot.RaiseEvent(new MineWorkUpdatedEvent(message.Id, entity));
             });
             VirtualRoot.BuildCmdPath<RemoveMineWorkCommand>(action: (message) => {
                 InitOnece();
@@ -57,7 +57,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 Server.MineWorkService.RemoveMineWorkAsync(entity.Id, (response, exception) => {
                     if (response.IsSuccess()) {
                         _dicById.Remove(entity.Id);
-                        VirtualRoot.RaiseEvent(new MineWorkRemovedEvent(entity));
+                        VirtualRoot.RaiseEvent(new MineWorkRemovedEvent(message.Id, entity));
                     }
                     else {
                         Write.UserFail(response.ReadMessage(exception));

+ 4 - 4
src/NTMinerClient/Core/MinerServer/Impl/MinerGroupSet.cs

@@ -22,7 +22,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 Server.MinerGroupService.AddOrUpdateMinerGroupAsync(entity, (response, exception) => {
                     if (response.IsSuccess()) {
                         _dicById.Add(entity.Id, entity);
-                        VirtualRoot.RaiseEvent(new MinerGroupAddedEvent(entity));
+                        VirtualRoot.RaiseEvent(new MinerGroupAddedEvent(message.Id, entity));
                     }
                     else {
                         Write.UserFail(response.ReadMessage(exception));
@@ -46,11 +46,11 @@ namespace NTMiner.Core.MinerServer.Impl {
                 Server.MinerGroupService.AddOrUpdateMinerGroupAsync(entity, (response, exception) => {
                     if (!response.IsSuccess()) {
                         entity.Update(oldValue);
-                        VirtualRoot.RaiseEvent(new MinerGroupUpdatedEvent(entity));
+                        VirtualRoot.RaiseEvent(new MinerGroupUpdatedEvent(message.Id, entity));
                         Write.UserFail(response.ReadMessage(exception));
                     }
                 });
-                VirtualRoot.RaiseEvent(new MinerGroupUpdatedEvent(entity));
+                VirtualRoot.RaiseEvent(new MinerGroupUpdatedEvent(message.Id, entity));
             });
             VirtualRoot.BuildCmdPath<RemoveMinerGroupCommand>(action: (message) => {
                 InitOnece();
@@ -64,7 +64,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 Server.MinerGroupService.RemoveMinerGroupAsync(entity.Id, (response, exception) => {
                     if (response.IsSuccess()) {
                         _dicById.Remove(entity.Id);
-                        VirtualRoot.RaiseEvent(new MinerGroupRemovedEvent(entity));
+                        VirtualRoot.RaiseEvent(new MinerGroupRemovedEvent(message.Id, entity));
                     }
                     else {
                         Write.UserFail(response.ReadMessage(exception));

+ 4 - 4
src/NTMinerClient/Core/MinerServer/Impl/NTMinerWalletSet.cs

@@ -21,7 +21,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 OfficialServer.NTMinerWalletService.AddOrUpdateNTMinerWalletAsync(entity, (response, e) => {
                     if (response.IsSuccess()) {
                         _dicById.Add(entity.Id, entity);
-                        VirtualRoot.RaiseEvent(new NTMinerWalletAddedEvent(entity));
+                        VirtualRoot.RaiseEvent(new NTMinerWalletAddedEvent(message.Id, entity));
                     }
                     else {
                         Write.UserFail(response.ReadMessage(e));
@@ -44,11 +44,11 @@ namespace NTMiner.Core.MinerServer.Impl {
                 OfficialServer.NTMinerWalletService.AddOrUpdateNTMinerWalletAsync(entity, (response, e) => {
                     if (!response.IsSuccess()) {
                         entity.Update(oldValue);
-                        VirtualRoot.RaiseEvent(new NTMinerWalletUpdatedEvent(entity));
+                        VirtualRoot.RaiseEvent(new NTMinerWalletUpdatedEvent(message.Id, entity));
                         Write.UserFail(response.ReadMessage(e));
                     }
                 });
-                VirtualRoot.RaiseEvent(new NTMinerWalletUpdatedEvent(entity));
+                VirtualRoot.RaiseEvent(new NTMinerWalletUpdatedEvent(message.Id, entity));
             });
             VirtualRoot.BuildCmdPath<RemoveNTMinerWalletCommand>(action: (message) => {
                 if (message == null || message.EntityId == Guid.Empty) {
@@ -61,7 +61,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 OfficialServer.NTMinerWalletService.RemoveNTMinerWalletAsync(entity.Id, (response, e) => {
                     if (response.IsSuccess()) {
                         _dicById.Remove(entity.Id);
-                        VirtualRoot.RaiseEvent(new NTMinerWalletRemovedEvent(entity));
+                        VirtualRoot.RaiseEvent(new NTMinerWalletRemovedEvent(message.Id, entity));
                     }
                     else {
                         Write.UserFail(response.ReadMessage(e));

+ 4 - 4
src/NTMinerClient/Core/MinerServer/Impl/OverClockDataSet.cs

@@ -24,7 +24,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 OfficialServer.OverClockDataService.AddOrUpdateOverClockDataAsync(entity, (response, e) => {
                     if (response.IsSuccess()) {
                         _dicById.Add(entity.Id, entity);
-                        VirtualRoot.RaiseEvent(new OverClockDataAddedEvent(entity));
+                        VirtualRoot.RaiseEvent(new OverClockDataAddedEvent(message.Id, entity));
                     }
                     else {
                         Write.UserFail(response.ReadMessage(e));
@@ -47,11 +47,11 @@ namespace NTMiner.Core.MinerServer.Impl {
                 OfficialServer.OverClockDataService.AddOrUpdateOverClockDataAsync(entity, (response, e) => {
                     if (!response.IsSuccess()) {
                         entity.Update(oldValue);
-                        VirtualRoot.RaiseEvent(new OverClockDataUpdatedEvent(entity));
+                        VirtualRoot.RaiseEvent(new OverClockDataUpdatedEvent(message.Id, entity));
                         Write.UserFail(response.ReadMessage(e));
                     }
                 });
-                VirtualRoot.RaiseEvent(new OverClockDataUpdatedEvent(entity));
+                VirtualRoot.RaiseEvent(new OverClockDataUpdatedEvent(message.Id, entity));
             });
             VirtualRoot.BuildCmdPath<RemoveOverClockDataCommand>(action: (message) => {
                 if (message == null || message.EntityId == Guid.Empty) {
@@ -64,7 +64,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                 OfficialServer.OverClockDataService.RemoveOverClockDataAsync(entity.Id, (response, e) => {
                     if (response.IsSuccess()) {
                         _dicById.Remove(entity.Id);
-                        VirtualRoot.RaiseEvent(new OverClockDataRemovedEvent(entity));
+                        VirtualRoot.RaiseEvent(new OverClockDataRemovedEvent(message.Id, entity));
                     }
                     else {
                         Write.UserFail(response.ReadMessage(e));

+ 3 - 3
src/NTMinerClient/Core/MinerServer/Impl/ServerAppSettingSet.cs

@@ -34,10 +34,10 @@ namespace NTMiner.Core.MinerServer.Impl {
                             entity.Value = oldValue.Value;
                         }
                         Write.UserFail(response.ReadMessage(exception));
-                        VirtualRoot.RaiseEvent(new ServerAppSettingSetedEvent(entity));
+                        VirtualRoot.RaiseEvent(new ServerAppSettingSetedEvent(message.Id, entity));
                     }
                 });
-                VirtualRoot.RaiseEvent(new ServerAppSettingSetedEvent(entity));
+                VirtualRoot.RaiseEvent(new ServerAppSettingSetedEvent(message.Id, entity));
             });
             VirtualRoot.BuildCmdPath<SetServerAppSettingsCommand>(action: message => {
                 if (message.AppSettings == null) {
@@ -57,7 +57,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         oldValue = null;
                         _dicByKey.Add(item.Key, entity);
                     }
-                    VirtualRoot.RaiseEvent(new ServerAppSettingSetedEvent(entity));
+                    VirtualRoot.RaiseEvent(new ServerAppSettingSetedEvent(message.Id, entity));
                 }
                 Server.AppSettingService.SetAppSettingsAsync(message.AppSettings.Select(a => AppSettingData.Create(a)).ToList(), (response, exception) => {
                 });

+ 4 - 4
src/NTMinerClient/Core/MinerServer/Impl/UserSet.cs

@@ -20,7 +20,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                         if (response.IsSuccess()) {
                             UserData entity = new UserData(message.User);
                             _dicByLoginName.Add(message.User.LoginName, entity);
-                            VirtualRoot.RaiseEvent(new UserAddedEvent(entity));
+                            VirtualRoot.RaiseEvent(new UserAddedEvent(message.Id, entity));
                         }
                         else {
                             Write.UserFail(response.ReadMessage(exception));
@@ -41,11 +41,11 @@ namespace NTMiner.Core.MinerServer.Impl {
                     }, (response, exception) => {
                         if (!response.IsSuccess()) {
                             entity.Update(oldValue);
-                            VirtualRoot.RaiseEvent(new UserUpdatedEvent(entity));
+                            VirtualRoot.RaiseEvent(new UserUpdatedEvent(message.Id, entity));
                             Write.UserFail(response.ReadMessage(exception));
                         }
                     });
-                    VirtualRoot.RaiseEvent(new UserUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new UserUpdatedEvent(message.Id, entity));
                 }
             });
             VirtualRoot.BuildCmdPath<RemoveUserCommand>(action: message => {
@@ -54,7 +54,7 @@ namespace NTMiner.Core.MinerServer.Impl {
                     Server.UserService.RemoveUserAsync(message.LoginName, (response, exception) => {
                         if (response.IsSuccess()) {
                             _dicByLoginName.Remove(entity.LoginName);
-                            VirtualRoot.RaiseEvent(new UserRemovedEvent(entity));
+                            VirtualRoot.RaiseEvent(new UserRemovedEvent(message.Id, entity));
                         }
                         else {
                             Write.UserFail(response.ReadMessage(exception));

+ 2 - 2
src/NTMinerClient/Core/Profiles/Impl/GpuProfileSet.cs

@@ -23,12 +23,12 @@ namespace NTMiner.Core.Profiles.Impl {
                     _data.GpuProfiles.Add(data);
                     Save();
                 }
-                VirtualRoot.RaiseEvent(new GpuProfileAddedOrUpdatedEvent(data));
+                VirtualRoot.RaiseEvent(new GpuProfileAddedOrUpdatedEvent(message.Id, data));
             });
             VirtualRoot.BuildCmdPath<CoinOverClockCommand>(action: message => {
                 Task.Factory.StartNew(() => {
                     CoinOverClock(root, message.CoinId);
-                    VirtualRoot.RaiseEvent(new CoinOverClockDoneEvent(message.Id));
+                    VirtualRoot.RaiseEvent(new CoinOverClockDoneEvent(pathId: message.Id));
                 });
             });
         }

+ 3 - 3
src/NTMinerClient/Core/Profiles/Impl/WalletSet.cs

@@ -26,7 +26,7 @@ namespace NTMiner.Core.Profiles.Impl {
                 _dicById.Add(entity.Id, entity);
                 AddWallet(entity);
 
-                VirtualRoot.RaiseEvent(new WalletAddedEvent(entity));
+                VirtualRoot.RaiseEvent(new WalletAddedEvent(message.Id, entity));
             });
             VirtualRoot.BuildCmdPath<UpdateWalletCommand>(action: message => {
                 InitOnece();
@@ -49,7 +49,7 @@ namespace NTMiner.Core.Profiles.Impl {
                 entity.Update(message.Input);
                 UpdateWallet(entity);
 
-                VirtualRoot.RaiseEvent(new WalletUpdatedEvent(entity));
+                VirtualRoot.RaiseEvent(new WalletUpdatedEvent(message.Id, entity));
             });
             VirtualRoot.BuildCmdPath<RemoveWalletCommand>(action: (message) => {
                 InitOnece();
@@ -63,7 +63,7 @@ namespace NTMiner.Core.Profiles.Impl {
                 _dicById.Remove(entity.GetId());
                 RemoveWallet(entity.Id);
 
-                VirtualRoot.RaiseEvent(new WalletRemovedEvent(entity));
+                VirtualRoot.RaiseEvent(new WalletRemovedEvent(message.Id, entity));
             });
         }
 

+ 3 - 3
src/NTMinerRpcClient/KernelOutputKeyword/KernelOutputKeywordSet.cs

@@ -67,7 +67,7 @@ namespace NTMiner.KernelOutputKeyword {
                             col.Update(exist);
                         }
                         if (!isServer) {
-                            VirtualRoot.RaiseEvent(new UserKernelOutputKeywordUpdatedEvent(exist));
+                            VirtualRoot.RaiseEvent(new UserKernelOutputKeywordUpdatedEvent(message.Id, exist));
                         }
                     }
                     else {
@@ -84,7 +84,7 @@ namespace NTMiner.KernelOutputKeyword {
                             col.Insert(entity);
                         }
                         if (!isServer) {
-                            VirtualRoot.RaiseEvent(new UserKernelOutputKeywordAddedEvent(entity));
+                            VirtualRoot.RaiseEvent(new UserKernelOutputKeywordAddedEvent(message.Id, entity));
                         }
                     }
                 }
@@ -115,7 +115,7 @@ namespace NTMiner.KernelOutputKeyword {
                         col.Delete(message.EntityId);
                     }
                     if (!isServer) {
-                        VirtualRoot.RaiseEvent(new UserKernelOutputKeywordRemovedEvent(entity));
+                        VirtualRoot.RaiseEvent(new UserKernelOutputKeywordRemovedEvent(message.Id, entity));
                     }
                 }
                 else if (DevMode.IsDevMode) {

+ 3 - 3
src/NTMinerServices/Data/Impl/UserSet.cs

@@ -19,7 +19,7 @@ namespace NTMiner.Data.Impl {
                         var col = db.GetCollection<UserData>();
                         col.Insert(entity);
                     }
-                    VirtualRoot.RaiseEvent(new UserAddedEvent(entity));
+                    VirtualRoot.RaiseEvent(new UserAddedEvent(message.Id, entity));
                 }
             });
             VirtualRoot.BuildCmdPath<UpdateUserCommand>(action: message => {
@@ -30,7 +30,7 @@ namespace NTMiner.Data.Impl {
                         var col = db.GetCollection<UserData>();
                         col.Update(entity);
                     }
-                    VirtualRoot.RaiseEvent(new UserUpdatedEvent(entity));
+                    VirtualRoot.RaiseEvent(new UserUpdatedEvent(message.Id, entity));
                 }
             });
             VirtualRoot.BuildCmdPath<RemoveUserCommand>(action: message => {
@@ -41,7 +41,7 @@ namespace NTMiner.Data.Impl {
                         var col = db.GetCollection<UserData>();
                         col.Delete(message.LoginName);
                     }
-                    VirtualRoot.RaiseEvent(new UserRemovedEvent(entity));
+                    VirtualRoot.RaiseEvent(new UserRemovedEvent(message.Id, entity));
                 }
             });
         }

+ 1 - 1
src/NTMinerlib/AppSetting/LocalAppSettingSet.cs

@@ -25,7 +25,7 @@ namespace NTMiner.AppSetting {
                     var col = db.GetCollection<AppSettingData>();
                     col.Upsert(entity);
                 }
-                VirtualRoot.RaiseEvent(new LocalAppSettingChangedEvent(entity));
+                VirtualRoot.RaiseEvent(new LocalAppSettingChangedEvent(message.Id, entity));
             });
         }
 

+ 1 - 1
src/NTMinerlib/LocalMessage/LocalMessageSet.cs

@@ -36,7 +36,7 @@ namespace NTMiner.LocalMessage {
                     var col = db.GetCollection<LocalMessageData>();
                     col.Insert(data);
                 }
-                VirtualRoot.RaiseEvent(new LocalMessageAddedEvent(data, removes));
+                VirtualRoot.RaiseEvent(new LocalMessageAddedEvent(message.Id, data, removes));
             });
             VirtualRoot.BuildCmdPath<ClearLocalMessageSetCommand>(action: message => {
                 if (string.IsNullOrEmpty(_connectionString)) {

+ 6 - 6
src/NTMinerlib/Messages.cs

@@ -66,7 +66,7 @@ namespace NTMiner {
 
     [MessageType(description: "ServerAppSetting变更后")]
     public class ServerAppSettingSetedEvent : DomainEvent<IAppSetting> {
-        public ServerAppSettingSetedEvent(IAppSetting source) : base(source) {
+        public ServerAppSettingSetedEvent(Guid pathId, IAppSetting source) : base(pathId, source) {
         }
     }
 
@@ -99,7 +99,7 @@ namespace NTMiner {
 
     [MessageType(description: "LocalAppSetting变更后")]
     public class LocalAppSettingChangedEvent : DomainEvent<IAppSetting> {
-        public LocalAppSettingChangedEvent(IAppSetting source) : base(source) {
+        public LocalAppSettingChangedEvent(Guid pathId, IAppSetting source) : base(pathId, source) {
         }
     }
 
@@ -132,13 +132,13 @@ namespace NTMiner {
 
     [MessageType(description: "添加了用户自定义内核输出关键字后")]
     public class UserKernelOutputKeywordAddedEvent : DomainEvent<IKernelOutputKeyword> {
-        public UserKernelOutputKeywordAddedEvent(IKernelOutputKeyword source) : base(source) {
+        public UserKernelOutputKeywordAddedEvent(Guid pathId, IKernelOutputKeyword source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "更新了用户自定义内核输出关键字后")]
     public class UserKernelOutputKeywordUpdatedEvent : DomainEvent<IKernelOutputKeyword> {
-        public UserKernelOutputKeywordUpdatedEvent(IKernelOutputKeyword source) : base(source) {
+        public UserKernelOutputKeywordUpdatedEvent(Guid pathId, IKernelOutputKeyword source) : base(pathId, source) {
         }
     }
 
@@ -150,7 +150,7 @@ namespace NTMiner {
 
     [MessageType(description: "移除了用户自定义内核输出关键字后")]
     public class UserKernelOutputKeywordRemovedEvent : DomainEvent<IKernelOutputKeyword> {
-        public UserKernelOutputKeywordRemovedEvent(IKernelOutputKeyword source) : base(source) {
+        public UserKernelOutputKeywordRemovedEvent(Guid pathId, IKernelOutputKeyword source) : base(pathId, source) {
 
         }
     }
@@ -164,7 +164,7 @@ namespace NTMiner {
 
     [MessageType(description: "记录了本地事件后")]
     public class LocalMessageAddedEvent : DomainEvent<ILocalMessage> {
-        public LocalMessageAddedEvent(ILocalMessage source, List<ILocalMessage> removes) : base(source) {
+        public LocalMessageAddedEvent(Guid pathId, ILocalMessage source, List<ILocalMessage> removes) : base(pathId, source) {
             this.Removes = removes ?? new List<ILocalMessage>();
         }
 

+ 4 - 3
src/NTMinerlib/User/Messages.cs

@@ -1,4 +1,5 @@
 using NTMiner.Bus;
+using System;
 
 namespace NTMiner.User {
     [MessageType(description: "添加用户")]
@@ -54,19 +55,19 @@ namespace NTMiner.User {
 
     [MessageType(description: "添加了新用户后")]
     public class UserAddedEvent : DomainEvent<IUser> {
-        public UserAddedEvent(IUser source) : base(source) {
+        public UserAddedEvent(Guid pathId, IUser source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "修改了用户后")]
     public class UserUpdatedEvent : DomainEvent<IUser> {
-        public UserUpdatedEvent(IUser source) : base(source) {
+        public UserUpdatedEvent(Guid pathId, IUser source) : base(pathId, source) {
         }
     }
 
     [MessageType(description: "移除了用户后")]
     public class UserRemovedEvent : DomainEvent<IUser> {
-        public UserRemovedEvent(IUser source) : base(source) {
+        public UserRemovedEvent(Guid pathId, IUser source) : base(pathId, source) {
         }
     }
 }