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; +