From 28afe465cc78357c07edc69d55e12ad65fb1921b Mon Sep 17 00:00:00 2001 From: Mikhail Mitrofanov Date: Tue, 18 Feb 2025 22:47:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D1=80=D0=B5=D1=82=D0=B8=D0=B9=20=D0=BF?= =?UTF-8?q?=D1=83=D0=BB=20=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mROA/Abstract/IExecuteModule.cs | 2 +- mROA/Implementation/Backend/BasicExecutionModule.cs | 8 ++++---- mROA/Implementation/Backend/HubRequestExtractor.cs | 3 +-- mROA/Implementation/Frontend/NetworkFrontendBridge.cs | 2 ++ .../Frontend/StreamBasedFrontendInteractionModule.cs | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/mROA/Abstract/IExecuteModule.cs b/mROA/Abstract/IExecuteModule.cs index cc5a843..7a9b0a1 100644 --- a/mROA/Abstract/IExecuteModule.cs +++ b/mROA/Abstract/IExecuteModule.cs @@ -4,5 +4,5 @@ namespace mROA.Abstract; public interface IExecuteModule : IInjectableModule { - ICommandExecution Execute(ICallRequest command, IContextRepository executionContextRepository); + ICommandExecution Execute(ICallRequest command, IContextRepository contextRepository); } \ No newline at end of file diff --git a/mROA/Implementation/Backend/BasicExecutionModule.cs b/mROA/Implementation/Backend/BasicExecutionModule.cs index eb5b96b..e3d9903 100644 --- a/mROA/Implementation/Backend/BasicExecutionModule.cs +++ b/mROA/Implementation/Backend/BasicExecutionModule.cs @@ -13,12 +13,12 @@ public class BasicExecutionModule : IExecuteModule if (dependency is IMethodRepository methodRepo) _methodRepo = methodRepo; } - public ICommandExecution Execute(ICallRequest command, IContextRepository _contextRepo) + public ICommandExecution Execute(ICallRequest command, IContextRepository contextRepository) { if (_methodRepo is null) throw new NullReferenceException("Method repository was not defined"); - if (_contextRepo is null) + if (contextRepository is null) throw new NullReferenceException("Context repository was not defined"); var currentCommand = _methodRepo.GetMethod(command.CommandId); @@ -26,8 +26,8 @@ public class BasicExecutionModule : IExecuteModule throw new Exception($"Command {command.CommandId} not found"); var context = command.ObjectId != -1 - ? _contextRepo.GetObject(command.ObjectId) - : _contextRepo.GetSingleObject(currentCommand.DeclaringType!); + ? contextRepository.GetObject(command.ObjectId) + : contextRepository.GetSingleObject(currentCommand.DeclaringType!); var parameter = command.Parameter; if (currentCommand.ReturnType.BaseType == typeof(Task) && diff --git a/mROA/Implementation/Backend/HubRequestExtractor.cs b/mROA/Implementation/Backend/HubRequestExtractor.cs index 572c4b0..ae29e29 100644 --- a/mROA/Implementation/Backend/HubRequestExtractor.cs +++ b/mROA/Implementation/Backend/HubRequestExtractor.cs @@ -1,11 +1,10 @@ using mROA.Abstract; -using mROA.Implementation.Frontend; namespace mROA.Implementation.Backend; public class HubRequestExtractor(Type extractoType) : IInjectableModule { - private IConnectionHub _hub; + private IConnectionHub? _hub; private IContextRepository? _contextRepository; private IMethodRepository? _methodRepository; diff --git a/mROA/Implementation/Frontend/NetworkFrontendBridge.cs b/mROA/Implementation/Frontend/NetworkFrontendBridge.cs index 650b42c..a5f4a16 100644 --- a/mROA/Implementation/Frontend/NetworkFrontendBridge.cs +++ b/mROA/Implementation/Frontend/NetworkFrontendBridge.cs @@ -27,6 +27,8 @@ public class NetworkFrontendBridge(IPEndPoint ipEndPoint) : IFrontendBridge { if (_interactionModule is null) throw new Exception("Interaction module was not injected"); + if (_serialization == null) + throw new NullReferenceException("Serialization toolkit is not initialized"); _tcpClient.Connect(ipEndPoint); _interactionModule.BaseStream = _tcpClient.GetStream(); diff --git a/mROA/Implementation/Frontend/StreamBasedFrontendInteractionModule.cs b/mROA/Implementation/Frontend/StreamBasedFrontendInteractionModule.cs index 21cbbfe..a94a374 100644 --- a/mROA/Implementation/Frontend/StreamBasedFrontendInteractionModule.cs +++ b/mROA/Implementation/Frontend/StreamBasedFrontendInteractionModule.cs @@ -1,4 +1,4 @@ -namespace mROA.Implementation.Frontend; + // public class StreamBasedFrontendInteractionModule : IInteractionModule.IFrontendInteractionModule // {