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 // {