Исправление не правильного кодирования сообщения

This commit is contained in:
2025-02-22 09:44:48 +03:00
parent c71585b100
commit 348947fb4c
3 changed files with 17 additions and 4 deletions
+2
View File
@@ -27,6 +27,8 @@ class Program
builder.Modules.Add(new BasicExecutionModule()); builder.Modules.Add(new BasicExecutionModule());
builder.Modules.Add(new CoCodegenMethodRepository()); builder.Modules.Add(new CoCodegenMethodRepository());
builder.UseCollectableContextRepository(); builder.UseCollectableContextRepository();
builder.Modules.Add(new CancellationRepository());
builder.Build(); builder.Build();
@@ -76,9 +76,20 @@ namespace mROA.Implementation.Frontend
var result = _executeModule.Execute(request, _contextRepository, _representationModule); var result = _executeModule.Execute(request, _contextRepository, _representationModule);
var resultType = result is FinalCommandExecution var resultType = MessageType.Unknown;
? MessageType.FinishedCommandExecution
: MessageType.ExceptionCommandExecution; switch (result)
{
case FinalCommandExecution:
resultType = MessageType.FinishedCommandExecution;
break;
case AsyncCommandExecution:
resultType = MessageType.AsyncCommandExecution;
break;
case ExceptionCommandExecution:
resultType = MessageType.ExceptionCommandExecution;
break;
}
_representationModule.PostCallMessage(request.Id, resultType, result, result.GetType()); _representationModule.PostCallMessage(request.Id, resultType, result, result.GetType());
} }
+1 -1
View File
@@ -15,6 +15,6 @@ namespace mROA.Implementation
public enum MessageType public enum MessageType
{ {
Unknown, FinishedCommandExecution, ExceptionCommandExecution, AsyncCancelCommandExecution, CallRequest, IdAssigning, CancelRequest Unknown, FinishedCommandExecution, ExceptionCommandExecution, AsyncCommandExecution, CallRequest, IdAssigning, CancelRequest
} }
} }