diff --git a/mROA.Codegen/mROASourceGenerator.cs b/mROA.Codegen/mROASourceGenerator.cs index 4a32063..1fd6df4 100644 --- a/mROA.Codegen/mROASourceGenerator.cs +++ b/mROA.Codegen/mROASourceGenerator.cs @@ -481,7 +481,7 @@ namespace {classSymbol.ContainingNamespace.ToDisplayString()} {callFilter} var request = new DefaultCallRequest {{ - CommandId = {index}, ObjectId = index, Parameters = new object[] {{ {transferParameters} }} + CommandId = {index}, ObjectId = new UniversalObjectIdentifier(index, context.OwnerId), Parameters = new object[] {{ {transferParameters} }} }}; module.PostCallMessageAsync(request.Id, MessageType.EventRequest, request); }}; diff --git a/mROA/Implementation/RemoteObjectBase.cs b/mROA/Implementation/RemoteObjectBase.cs index e756d5a..b180099 100644 --- a/mROA/Implementation/RemoteObjectBase.cs +++ b/mROA/Implementation/RemoteObjectBase.cs @@ -26,7 +26,7 @@ namespace mROA.Implementation CancellationToken cancellationToken = default) { var request = new DefaultCallRequest - { CommandId = methodId, ObjectId = _identifier.ContextId, Parameters = parameters + { CommandId = methodId, ObjectId = _identifier, Parameters = parameters }; await _representationModule.PostCallMessageAsync(request.Id, MessageType.CallRequest, request); @@ -80,7 +80,7 @@ namespace mROA.Implementation CancellationToken cancellationToken = default) { var request = new DefaultCallRequest - { CommandId = methodId, ObjectId = _identifier.ContextId, Parameters = parameters + { CommandId = methodId, ObjectId = _identifier, Parameters = parameters }; await _representationModule.PostCallMessageAsync(request.Id, MessageType.CallRequest, request); diff --git a/mROA/Implementation/UniversalObjectIdentifier.cs b/mROA/Implementation/UniversalObjectIdentifier.cs index 781567e..cd78859 100644 --- a/mROA/Implementation/UniversalObjectIdentifier.cs +++ b/mROA/Implementation/UniversalObjectIdentifier.cs @@ -8,6 +8,12 @@ namespace mROA.Implementation public int ContextId; public int OwnerId; + public UniversalObjectIdentifier(int contextId, int ownerId) + { + ContextId = contextId; + OwnerId = ownerId; + } + public static UniversalObjectIdentifier Null = new UniversalObjectIdentifier { ContextId = -2, OwnerId = -1 }; public static UniversalObjectIdentifier FromFlat(ulong flat) => new() { Flat = flat };