From 81a9698de4e9de0733b80331ab8d3132abcb54b5 Mon Sep 17 00:00:00 2001 From: Mikhail Mitrofanov Date: Mon, 10 Mar 2025 18:26:57 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B4=D0=B5=D0=BD=D1=82=D0=B8=D1=84?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BE=D0=B1=D1=8A=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=BE=D0=B2=20=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD=D0=B4=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B0=D0=BD=D0=B0=20=D0=BD=D0=B0=20UniversalObjectIdenti?= =?UTF-8?q?fier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mROA/Implementation/Backend/BasicExecutionModule.cs | 8 +++++--- mROA/Implementation/CallRequest.cs | 6 +++--- mROA/mROA.csproj | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/mROA/Implementation/Backend/BasicExecutionModule.cs b/mROA/Implementation/Backend/BasicExecutionModule.cs index aa5b3ba..28158f9 100644 --- a/mROA/Implementation/Backend/BasicExecutionModule.cs +++ b/mROA/Implementation/Backend/BasicExecutionModule.cs @@ -66,8 +66,10 @@ namespace mROA.Implementation.Backend if (invoker == null) throw new Exception($"Command {command.CommandId} not found"); - var context = command.ObjectId != -1 - ? contextRepository.GetObject(command.ObjectId) + IContextRepository repository; + + var context = command.ObjectId.ContextId != -1 + ? contextRepository.GetObject(command.ObjectId.ContextId) : contextRepository.GetSingleObject(invoker.SuitableType); if (context == null) @@ -102,7 +104,7 @@ namespace mROA.Implementation.Backend #if TRACE Console.WriteLine("Disposing object"); #endif - contextRepository.ClearObject(command.ObjectId); + contextRepository.ClearObject(command.ObjectId.ContextId); } return result; diff --git a/mROA/Implementation/CallRequest.cs b/mROA/Implementation/CallRequest.cs index 0549069..86d234f 100644 --- a/mROA/Implementation/CallRequest.cs +++ b/mROA/Implementation/CallRequest.cs @@ -9,7 +9,7 @@ namespace mROA.Implementation { Guid Id { get; } int CommandId { get; } - int ObjectId { get; } + UniversalObjectIdentifier ObjectId { get; } object?[]? Parameters { get; } } @@ -17,7 +17,7 @@ namespace mROA.Implementation { public Guid Id { get; set; } = Guid.NewGuid(); public int CommandId { get; set; } - public int ObjectId { get; set; } = -1; + public UniversalObjectIdentifier ObjectId { get; set; } = UniversalObjectIdentifier.Null; public object?[]? Parameters { get; set; } @@ -31,7 +31,7 @@ namespace mROA.Implementation { public Guid Id { get; set; } public int CommandId { get; set; } = -2; - public int ObjectId { get; set; } = -2; + public UniversalObjectIdentifier ObjectId { get; set; } = UniversalObjectIdentifier.Null; public object?[]? Parameters { get; set; } = null; public override string ToString() diff --git a/mROA/mROA.csproj b/mROA/mROA.csproj index 8723457..e62894c 100644 --- a/mROA/mROA.csproj +++ b/mROA/mROA.csproj @@ -21,7 +21,7 @@ - TRACE; +