From b4349e3abe46398bf3d6eff4683497185de45576 Mon Sep 17 00:00:00 2001 From: Mikhail Mitrofanov Date: Tue, 14 Jan 2025 14:26:55 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=8B=D1=82=D0=BA=D0=B0=20?= =?UTF-8?q?=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=B0=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PrepairedExecutionModule.cs | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/mROA/Implementation/PrepairedExecutionModule.cs b/mROA/Implementation/PrepairedExecutionModule.cs index 4e4552e..2756bda 100644 --- a/mROA/Implementation/PrepairedExecutionModule.cs +++ b/mROA/Implementation/PrepairedExecutionModule.cs @@ -59,11 +59,13 @@ public class PrepairedExecutionModule : IExecuteModule result.ContinueWith(_ => { - _serialisationModule.PostResponse(new FinalCommandExecution - { - ExecutionId = exec.ExecutionId, Result = null, CommandId = command.CommandId, - ClientId = command.ClientId - }); + //_serialisationModule.PostResponse(new FinalCommandExecution + //{ + // ExecutionId = exec.ExecutionId, Result = null, CommandId = command.CommandId, + // ClientId = command.ClientId + //}); + PostFinalizedCallback(exec, null); + }, token); return exec; @@ -82,14 +84,26 @@ public class PrepairedExecutionModule : IExecuteModule result.ContinueWith(task => { - var result = task.GetType().GetProperty("Result").GetValue(task); - _serialisationModule.PostResponse(new FinalCommandExecution - { - ExecutionId = exec.ExecutionId, Result = result, CommandId = command.CommandId, - ClientId = command.ClientId - }); + var finalResult = task.GetType().GetProperty("Result").GetValue(task); + //_serialisationModule.PostResponse(new FinalCommandExecution + //{ + // ExecutionId = exec.ExecutionId, Result = result, CommandId = command.CommandId, + // ClientId = command.ClientId + //}); + PostFinalizedCallback(exec, finalResult); }, token); return exec; } + + private void PostFinalizedCallback(ICommandExecution request, object result) + { + _serialisationModule.PostResponse(new FinalCommandExecution + { + ExecutionId = request.ExecutionId, + Result = request, + CommandId = request.CommandId, + ClientId = request.ClientId + }); + } } \ No newline at end of file