akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.73k stars 1.04k forks source link

Hyperion can't serialize custom type #3755

Open TheElan opened 5 years ago

TheElan commented 5 years ago

Info

Version: Akka.Cluster: 1.3.12, Akka.DistributedData: 1.3.12-beta Platform: Linux/Windows

Backstory

I am having a trouble making my distributed data replication work. I have described my domain in proto language and generated some grpc code. I use it to unify my model over different platforms (at least on boundaries) and I am also connecting to some external systems). I have an LWWMap with string key and my domain object as value which is currently taken from code protobuff generates for me.

Issue

When I connect to other node and system tries to replicate data I sent to ddreplicator I get an error:

[remoting] Failed to write message to the transport
Cause: Akka.Remote.EndpointException: Failed to write message to the transport ---> Hyperion.ValueSerializers.UnsupportedTypeException: Ambiguous match found.
   at Hyperion.ValueSerializers.UnsupportedTypeSerializer.WriteManifest(Stream stream, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at lambda_method(Closure , Stream , Object , SerializerSession )
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at lambda_method(Closure , Stream , Object , SerializerSession )
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at Hyperion.SerializerFactories.ImmutableCollectionsSerializerFactory.<>c__DisplayClass5_0.<BuildSerializer>b__1(Stream stream, Object o, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at lambda_method(Closure , Stream , Object , SerializerSession )
   at Akka.DistributedData.Serialization.ReplicatorMessageSerializer.Serialize(Object obj)
   at Akka.Remote.Serialization.WrappedPayloadSupport.PayloadToProto(Object payload)
   at Akka.Remote.Serialization.MessageContainerSerializer.ToBinary(Object obj)
   at Akka.Serialization.Serialization.SerializeWithTransport[T](ActorSystem system, Address address, Func`1 action)
   at Akka.Remote.MessageSerializer.Serialize(ActorSystem system, Address address, Object message)
   at Akka.Remote.EndpointWriter.WriteSend(Send send)
   --- End of inner exception stack trace ---
   at Akka.Remote.EndpointWriter.PublishAndThrow(Exception reason, LogLevel level, Boolean needToThrow)
   at Akka.Remote.EndpointWriter.WriteSend(Send send)
   at Akka.Remote.EndpointWriter.<Writing>b__27_0(Send s)
   at lambda_method(Closure , Object , Action`1 , Action`1 , Action`1 )
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction`1 partialAction)
   at Akka.Actor.ActorCell.<>c__DisplayClass106_0.<Akka.Actor.IUntypedActorContext.Become>b__0(Object m)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)
--- End of stack trace from previous location where exception was thrown ---
   at Akka.Actor.ActorCell.HandleFailed(Failed f)
   at Akka.Actor.ActorCell.SysMsgInvokeAll(EarliestFirstSystemMessageList messages, Int32 currentState)
[INFO][4/7/19 9:49:26 PM][Thread 0003][akka://dotnet-xr-world/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fdotnet-xr-world%400.0.0.0%3A2561-1/endpointWriter] Message AckIdleCheckTimer from akka://dotnet-xr-world/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fdotnet-xr-world%400.0.0.0%3A2561-1/endpointWriter to akka://dotnet-xr-world/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2Fdotnet-xr-world%400.0.0.0%3A2561-1/endpointWriter was not delivered. 1 dead letters encountered.
[INFO][4/7/19 9:49:26 PM][Thread 0003][akka://dotnet-xr-world/deadLetters] Message Heartbeat from akka://dotnet-xr-world/system/cluster/core/daemon/heartbeatSender to akka://dotnet-xr-world/deadLetters was not delivered. 2 dead letters encountered.
[ERROR][4/7/19 9:49:27 PM][Thread 0018][akka://dotnet-xr-world/user/ddataReplicator] Ambiguous match found.
Cause: Hyperion.ValueSerializers.UnsupportedTypeException: Ambiguous match found.
   at Hyperion.ValueSerializers.UnsupportedTypeSerializer.WriteManifest(Stream stream, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at Hyperion.SerializerFactories.ImmutableCollectionsSerializerFactory.<>c__DisplayClass5_0.<BuildSerializer>b__1(Stream stream, Object o, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at Hyperion.Extensions.StreamEx.WriteObject(Stream stream, Object value, Type valueType, ValueSerializer valueSerializer, Boolean preserveObjectReferences, SerializerSession session)
   at lambda_method(Closure , Stream , Object , SerializerSession )
   at Akka.DistributedData.Serialization.ReplicatorMessageSerializer.Serialize(Object obj)
   at Akka.DistributedData.Replicator.Digest(DataEnvelope envelope)
   at Akka.DistributedData.Replicator.GetDigest(String key)
   at Akka.DistributedData.Replicator.<GossipTo>b__73_0(KeyValuePair`2 x)
   at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
   at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 items, MutationInput origin, KeyCollisionBehavior collisionBehavior)
   at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs, Boolean avoidToHashMap)
   at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs)
   at System.Collections.Immutable.ImmutableDictionary.ToImmutableDictionary[TKey,TValue](IEnumerable`1 source, IEqualityComparer`1 keyComparer, IEqualityComparer`1 valueComparer)
   at Akka.DistributedData.Replicator.GossipTo(Address address)
   at lambda_method(Closure , Object , Action`1 , Action`1 , Action`1 , Action`1 , Action`1 , Action`1 , Action`1 , Action`1 , Action`1 , Action`1 , Action`1 , Action`1 , Action`1 , Action`1 , Object[] )
   at Akka.Tools.MatchHandler.PartialHandlerArgumentsCapture`16.Handle(T value)
   at Akka.Actor.ReceiveActor.ExecutePartialMessageHandler(Object message, PartialAction`1 partialAction)
   at Akka.Actor.UntypedActor.Receive(Object message)
   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)
   at Akka.Actor.ActorCell.ReceiveMessage(Object message)
   at Akka.Actor.ActorCell.Invoke(Envelope envelope)

I also tried to write custom protobuff serializer, but it didn't help, hyperion will still try to serialize my domain objects with it's serializer and will eventually fail.

Here is my configuration:

akka {
                    actor {
                      provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"

                      serializers {
                        my-proto-serializer = "MyProtobufModel.MyTypeSerializer, MyProtobufModel"
                      }
                      serialization-bindings {
                        "MyNamespace.MyType, MyProtobufModel" = my-proto-serializer
                      }
                      serialization-identifiers {
                        "MyProtobufModel.MyTypeSerializer, MyProtobufModel" = 130
                      }
                    }

                    remote {
                        log-remote-lifecycle-events = on
                        helios.tcp {
                            transport-class = "Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
                            applied-adapters = []
                            transport-protocol = tcp
                            hostname = "0.0.0.0"
                            port = 2562
                        }
                    }
                    cluster {
                        seed-nodes = [
                            "akka.tcp://my-system@0.0.0.0:2561",
                            "akka.tcp://my-system@0.0.0.0:2562"
                        ]
                    }
                }

Additional questions

Horusiath commented 5 years ago

@ElanHD could you show how your custom type looks like? It's pretty strange that hyperion was unable to serialize that type.

Currently DData uses Hyperion for all serialization purposes as temporary solution (and to keep things simple).

Ultimately it should be replaced by something like protobuf with customizable (like akka JVM does), but particular problem with that approach on .NET platform is that protobuf doesn't support generics, which .NET requires to exists at runtime (unlike the JVM, which erases them). There's a #3628 which tries to address the issue, but it's not trivial to solve.

TheElan commented 5 years ago

@Horusiath sorry for taking so long to answer.

This class is part of protobuff generated class by protobuff:

Domain.cs ```csharp // // Generated by the protocol buffer compiler. DO NOT EDIT! // source: xreality/domain.proto // #pragma warning disable 1591, 0612, 3021 #region Designer generated code using pb = global::Google.Protobuf; using pbc = global::Google.Protobuf.Collections; using pbr = global::Google.Protobuf.Reflection; using scg = global::System.Collections.Generic; namespace XReality { /// Holder for reflection information generated from xreality/domain.proto public static partial class DomainReflection { #region Descriptor /// File descriptor for xreality/domain.proto public static pbr::FileDescriptor Descriptor { get { return descriptor; } } private static pbr::FileDescriptor descriptor; static DomainReflection() { byte[] descriptorData = global::System.Convert.FromBase64String( string.Concat( "ChV4cmVhbGl0eS9kb21haW4ucHJvdG8i2gEKC0ludGVyYWN0aW9uEhIKCm9i", "amVjdFV1aWQYASABKAkSFQoNY29udGFpbmVyVXVpZBgCIAEoCRIRCglvd25l", "clV1aWQYAyABKAkSHwoEdHlwZRgEIAEoDjIRLkludGVyYWN0aW9uLlR5cGUi", "bAoEVHlwZRIHCgNBTlkQABIICgRHQVpFEAESCQoFVE9VQ0gQAhIOCgpIT0xE", "X0VOVEVSEAMSDQoJSE9MRF9FWElUEAQSEwoPQ09MTElTSU9OX0VOVEVSEAUS", "EgoOQ09MTElTSU9OX0VYSVQQBiK1AQoQUmVhbGl0eUNvbnRhaW5lchIMCgR1", "dWlkGAEgASgJEhEKCW93bmVyVXVpZBgCIAEoCRIZCgZvYmplY3QYBCADKAsy", "CS5PYmplY3QzRBIzCgl2YXJpYWJsZXMYBSADKAsyIC5SZWFsaXR5Q29udGFp", "bmVyLlZhcmlhYmxlc0VudHJ5GjAKDlZhcmlhYmxlc0VudHJ5EgsKA2tleRgB", "IAEoCRINCgV2YWx1ZRgCIAEoCToCOAEiRgoIT2JqZWN0M0QSDAoEdXVpZBgB", "IAEoCRIVCgVwaXZvdBgCIAEoCzIGLlBpdm90EhUKBW1vZGVsGAMgASgLMgYu", "TW9kZWwiegoFUGl2b3QSDAoEdXVpZBgBIAEoCRIlChFyZWxhdGl2ZVRyYW5z", "Zm9ybRgCIAEoCzIKLlRyYW5zZm9ybRIXCgVwaXZvdBgDIAEoCzIGLlBpdm90", "SAASGQoGYW5jaG9yGAQgASgLMgcuQW5jaG9ySABCCAoGcGFyZW50Il8KCVRy", "YW5zZm9ybRIbCghwb3NpdGlvbhgBIAEoCzIJLlZlY3RvcjNEEhsKCHJvdGF0", "aW9uGAIgASgLMgkuVmVjdG9yM0QSGAoFc2NhbGUYAyABKAsyCS5WZWN0b3Iz", "RCIrCghWZWN0b3IzRBIJCgF4GAEgASgCEgkKAXkYAiABKAISCQoBehgDIAEo", "AiIkCgZBbmNob3ISDAoEdHlwZRgBIAEoCRIMCgRkYXRhGAIgASgMIiMKBU1v", "ZGVsEgwKBHR5cGUYASABKAkSDAoEZGF0YRgCIAEoDEIoChluZXQuZWxlbngu", "eHJlYWxpdHkuZG9tYWluUAGqAghYUmVhbGl0eWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::XReality.Interaction), global::XReality.Interaction.Parser, new[]{ "ObjectUuid", "ContainerUuid", "OwnerUuid", "Type" }, null, new[]{ typeof(global::XReality.Interaction.Types.Type) }, null), new pbr::GeneratedClrTypeInfo(typeof(global::XReality.RealityContainer), global::XReality.RealityContainer.Parser, new[]{ "Uuid", "OwnerUuid", "Object", "Variables" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }), new pbr::GeneratedClrTypeInfo(typeof(global::XReality.Object3D), global::XReality.Object3D.Parser, new[]{ "Uuid", "Pivot", "Model" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::XReality.Pivot), global::XReality.Pivot.Parser, new[]{ "Uuid", "RelativeTransform", "Pivot_", "Anchor" }, new[]{ "Parent" }, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::XReality.Transform), global::XReality.Transform.Parser, new[]{ "Position", "Rotation", "Scale" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::XReality.Vector3D), global::XReality.Vector3D.Parser, new[]{ "X", "Y", "Z" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::XReality.Anchor), global::XReality.Anchor.Parser, new[]{ "Type", "Data" }, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::XReality.Model), global::XReality.Model.Parser, new[]{ "Type", "Data" }, null, null, null) })); } #endregion } #region Messages public sealed partial class Interaction : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Interaction()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::XReality.DomainReflection.Descriptor.MessageTypes[0]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Interaction() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Interaction(Interaction other) : this() { objectUuid_ = other.objectUuid_; containerUuid_ = other.containerUuid_; ownerUuid_ = other.ownerUuid_; type_ = other.type_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Interaction Clone() { return new Interaction(this); } /// Field number for the "objectUuid" field. public const int ObjectUuidFieldNumber = 1; private string objectUuid_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string ObjectUuid { get { return objectUuid_; } set { objectUuid_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Field number for the "containerUuid" field. public const int ContainerUuidFieldNumber = 2; private string containerUuid_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string ContainerUuid { get { return containerUuid_; } set { containerUuid_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Field number for the "ownerUuid" field. public const int OwnerUuidFieldNumber = 3; private string ownerUuid_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string OwnerUuid { get { return ownerUuid_; } set { ownerUuid_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Field number for the "type" field. public const int TypeFieldNumber = 4; private global::XReality.Interaction.Types.Type type_ = 0; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::XReality.Interaction.Types.Type Type { get { return type_; } set { type_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Interaction); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Interaction other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (ObjectUuid != other.ObjectUuid) return false; if (ContainerUuid != other.ContainerUuid) return false; if (OwnerUuid != other.OwnerUuid) return false; if (Type != other.Type) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (ObjectUuid.Length != 0) hash ^= ObjectUuid.GetHashCode(); if (ContainerUuid.Length != 0) hash ^= ContainerUuid.GetHashCode(); if (OwnerUuid.Length != 0) hash ^= OwnerUuid.GetHashCode(); if (Type != 0) hash ^= Type.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (ObjectUuid.Length != 0) { output.WriteRawTag(10); output.WriteString(ObjectUuid); } if (ContainerUuid.Length != 0) { output.WriteRawTag(18); output.WriteString(ContainerUuid); } if (OwnerUuid.Length != 0) { output.WriteRawTag(26); output.WriteString(OwnerUuid); } if (Type != 0) { output.WriteRawTag(32); output.WriteEnum((int) Type); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (ObjectUuid.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(ObjectUuid); } if (ContainerUuid.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(ContainerUuid); } if (OwnerUuid.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(OwnerUuid); } if (Type != 0) { size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Interaction other) { if (other == null) { return; } if (other.ObjectUuid.Length != 0) { ObjectUuid = other.ObjectUuid; } if (other.ContainerUuid.Length != 0) { ContainerUuid = other.ContainerUuid; } if (other.OwnerUuid.Length != 0) { OwnerUuid = other.OwnerUuid; } if (other.Type != 0) { Type = other.Type; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { ObjectUuid = input.ReadString(); break; } case 18: { ContainerUuid = input.ReadString(); break; } case 26: { OwnerUuid = input.ReadString(); break; } case 32: { type_ = (global::XReality.Interaction.Types.Type) input.ReadEnum(); break; } } } } #region Nested types /// Container for nested types declared in the Interaction message type. [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static partial class Types { public enum Type { [pbr::OriginalName("ANY")] Any = 0, [pbr::OriginalName("GAZE")] Gaze = 1, [pbr::OriginalName("TOUCH")] Touch = 2, [pbr::OriginalName("HOLD_ENTER")] HoldEnter = 3, [pbr::OriginalName("HOLD_EXIT")] HoldExit = 4, [pbr::OriginalName("COLLISION_ENTER")] CollisionEnter = 5, [pbr::OriginalName("COLLISION_EXIT")] CollisionExit = 6, } } #endregion } public sealed partial class RealityContainer : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new RealityContainer()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::XReality.DomainReflection.Descriptor.MessageTypes[1]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public RealityContainer() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public RealityContainer(RealityContainer other) : this() { uuid_ = other.uuid_; ownerUuid_ = other.ownerUuid_; object_ = other.object_.Clone(); variables_ = other.variables_.Clone(); _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public RealityContainer Clone() { return new RealityContainer(this); } /// Field number for the "uuid" field. public const int UuidFieldNumber = 1; private string uuid_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Uuid { get { return uuid_; } set { uuid_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Field number for the "ownerUuid" field. public const int OwnerUuidFieldNumber = 2; private string ownerUuid_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string OwnerUuid { get { return ownerUuid_; } set { ownerUuid_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Field number for the "object" field. public const int ObjectFieldNumber = 4; private static readonly pb::FieldCodec _repeated_object_codec = pb::FieldCodec.ForMessage(34, global::XReality.Object3D.Parser); private readonly pbc::RepeatedField object_ = new pbc::RepeatedField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Object { get { return object_; } } /// Field number for the "variables" field. public const int VariablesFieldNumber = 5; private static readonly pbc::MapField.Codec _map_variables_codec = new pbc::MapField.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 42); private readonly pbc::MapField variables_ = new pbc::MapField(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::MapField Variables { get { return variables_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as RealityContainer); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(RealityContainer other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (Uuid != other.Uuid) return false; if (OwnerUuid != other.OwnerUuid) return false; if(!object_.Equals(other.object_)) return false; if (!Variables.Equals(other.Variables)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Uuid.Length != 0) hash ^= Uuid.GetHashCode(); if (OwnerUuid.Length != 0) hash ^= OwnerUuid.GetHashCode(); hash ^= object_.GetHashCode(); hash ^= Variables.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Uuid.Length != 0) { output.WriteRawTag(10); output.WriteString(Uuid); } if (OwnerUuid.Length != 0) { output.WriteRawTag(18); output.WriteString(OwnerUuid); } object_.WriteTo(output, _repeated_object_codec); variables_.WriteTo(output, _map_variables_codec); if (_unknownFields != null) { _unknownFields.WriteTo(output); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Uuid.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Uuid); } if (OwnerUuid.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(OwnerUuid); } size += object_.CalculateSize(_repeated_object_codec); size += variables_.CalculateSize(_map_variables_codec); if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(RealityContainer other) { if (other == null) { return; } if (other.Uuid.Length != 0) { Uuid = other.Uuid; } if (other.OwnerUuid.Length != 0) { OwnerUuid = other.OwnerUuid; } object_.Add(other.object_); variables_.Add(other.variables_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Uuid = input.ReadString(); break; } case 18: { OwnerUuid = input.ReadString(); break; } case 34: { object_.AddEntriesFrom(input, _repeated_object_codec); break; } case 42: { variables_.AddEntriesFrom(input, _map_variables_codec); break; } } } } } public sealed partial class Object3D : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Object3D()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::XReality.DomainReflection.Descriptor.MessageTypes[2]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Object3D() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Object3D(Object3D other) : this() { uuid_ = other.uuid_; pivot_ = other.pivot_ != null ? other.pivot_.Clone() : null; model_ = other.model_ != null ? other.model_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Object3D Clone() { return new Object3D(this); } /// Field number for the "uuid" field. public const int UuidFieldNumber = 1; private string uuid_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Uuid { get { return uuid_; } set { uuid_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Field number for the "pivot" field. public const int PivotFieldNumber = 2; private global::XReality.Pivot pivot_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::XReality.Pivot Pivot { get { return pivot_; } set { pivot_ = value; } } /// Field number for the "model" field. public const int ModelFieldNumber = 3; private global::XReality.Model model_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::XReality.Model Model { get { return model_; } set { model_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Object3D); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Object3D other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (Uuid != other.Uuid) return false; if (!object.Equals(Pivot, other.Pivot)) return false; if (!object.Equals(Model, other.Model)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Uuid.Length != 0) hash ^= Uuid.GetHashCode(); if (pivot_ != null) hash ^= Pivot.GetHashCode(); if (model_ != null) hash ^= Model.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Uuid.Length != 0) { output.WriteRawTag(10); output.WriteString(Uuid); } if (pivot_ != null) { output.WriteRawTag(18); output.WriteMessage(Pivot); } if (model_ != null) { output.WriteRawTag(26); output.WriteMessage(Model); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Uuid.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Uuid); } if (pivot_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Pivot); } if (model_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Model); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Object3D other) { if (other == null) { return; } if (other.Uuid.Length != 0) { Uuid = other.Uuid; } if (other.pivot_ != null) { if (pivot_ == null) { pivot_ = new global::XReality.Pivot(); } Pivot.MergeFrom(other.Pivot); } if (other.model_ != null) { if (model_ == null) { model_ = new global::XReality.Model(); } Model.MergeFrom(other.Model); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Uuid = input.ReadString(); break; } case 18: { if (pivot_ == null) { pivot_ = new global::XReality.Pivot(); } input.ReadMessage(pivot_); break; } case 26: { if (model_ == null) { model_ = new global::XReality.Model(); } input.ReadMessage(model_); break; } } } } } public sealed partial class Pivot : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Pivot()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::XReality.DomainReflection.Descriptor.MessageTypes[3]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Pivot() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Pivot(Pivot other) : this() { uuid_ = other.uuid_; relativeTransform_ = other.relativeTransform_ != null ? other.relativeTransform_.Clone() : null; switch (other.ParentCase) { case ParentOneofCase.Pivot_: Pivot_ = other.Pivot_.Clone(); break; case ParentOneofCase.Anchor: Anchor = other.Anchor.Clone(); break; } _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Pivot Clone() { return new Pivot(this); } /// Field number for the "uuid" field. public const int UuidFieldNumber = 1; private string uuid_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Uuid { get { return uuid_; } set { uuid_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Field number for the "relativeTransform" field. public const int RelativeTransformFieldNumber = 2; private global::XReality.Transform relativeTransform_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::XReality.Transform RelativeTransform { get { return relativeTransform_; } set { relativeTransform_ = value; } } /// Field number for the "pivot" field. public const int Pivot_FieldNumber = 3; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::XReality.Pivot Pivot_ { get { return parentCase_ == ParentOneofCase.Pivot_ ? (global::XReality.Pivot) parent_ : null; } set { parent_ = value; parentCase_ = value == null ? ParentOneofCase.None : ParentOneofCase.Pivot_; } } /// Field number for the "anchor" field. public const int AnchorFieldNumber = 4; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::XReality.Anchor Anchor { get { return parentCase_ == ParentOneofCase.Anchor ? (global::XReality.Anchor) parent_ : null; } set { parent_ = value; parentCase_ = value == null ? ParentOneofCase.None : ParentOneofCase.Anchor; } } private object parent_; /// Enum of possible cases for the "parent" oneof. public enum ParentOneofCase { None = 0, Pivot_ = 3, Anchor = 4, } private ParentOneofCase parentCase_ = ParentOneofCase.None; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public ParentOneofCase ParentCase { get { return parentCase_; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void ClearParent() { parentCase_ = ParentOneofCase.None; parent_ = null; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Pivot); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Pivot other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (Uuid != other.Uuid) return false; if (!object.Equals(RelativeTransform, other.RelativeTransform)) return false; if (!object.Equals(Pivot_, other.Pivot_)) return false; if (!object.Equals(Anchor, other.Anchor)) return false; if (ParentCase != other.ParentCase) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Uuid.Length != 0) hash ^= Uuid.GetHashCode(); if (relativeTransform_ != null) hash ^= RelativeTransform.GetHashCode(); if (parentCase_ == ParentOneofCase.Pivot_) hash ^= Pivot_.GetHashCode(); if (parentCase_ == ParentOneofCase.Anchor) hash ^= Anchor.GetHashCode(); hash ^= (int) parentCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Uuid.Length != 0) { output.WriteRawTag(10); output.WriteString(Uuid); } if (relativeTransform_ != null) { output.WriteRawTag(18); output.WriteMessage(RelativeTransform); } if (parentCase_ == ParentOneofCase.Pivot_) { output.WriteRawTag(26); output.WriteMessage(Pivot_); } if (parentCase_ == ParentOneofCase.Anchor) { output.WriteRawTag(34); output.WriteMessage(Anchor); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Uuid.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Uuid); } if (relativeTransform_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(RelativeTransform); } if (parentCase_ == ParentOneofCase.Pivot_) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Pivot_); } if (parentCase_ == ParentOneofCase.Anchor) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Anchor); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Pivot other) { if (other == null) { return; } if (other.Uuid.Length != 0) { Uuid = other.Uuid; } if (other.relativeTransform_ != null) { if (relativeTransform_ == null) { relativeTransform_ = new global::XReality.Transform(); } RelativeTransform.MergeFrom(other.RelativeTransform); } switch (other.ParentCase) { case ParentOneofCase.Pivot_: if (Pivot_ == null) { Pivot_ = new global::XReality.Pivot(); } Pivot_.MergeFrom(other.Pivot_); break; case ParentOneofCase.Anchor: if (Anchor == null) { Anchor = new global::XReality.Anchor(); } Anchor.MergeFrom(other.Anchor); break; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Uuid = input.ReadString(); break; } case 18: { if (relativeTransform_ == null) { relativeTransform_ = new global::XReality.Transform(); } input.ReadMessage(relativeTransform_); break; } case 26: { global::XReality.Pivot subBuilder = new global::XReality.Pivot(); if (parentCase_ == ParentOneofCase.Pivot_) { subBuilder.MergeFrom(Pivot_); } input.ReadMessage(subBuilder); Pivot_ = subBuilder; break; } case 34: { global::XReality.Anchor subBuilder = new global::XReality.Anchor(); if (parentCase_ == ParentOneofCase.Anchor) { subBuilder.MergeFrom(Anchor); } input.ReadMessage(subBuilder); Anchor = subBuilder; break; } } } } } public sealed partial class Transform : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Transform()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::XReality.DomainReflection.Descriptor.MessageTypes[4]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Transform() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Transform(Transform other) : this() { position_ = other.position_ != null ? other.position_.Clone() : null; rotation_ = other.rotation_ != null ? other.rotation_.Clone() : null; scale_ = other.scale_ != null ? other.scale_.Clone() : null; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Transform Clone() { return new Transform(this); } /// Field number for the "position" field. public const int PositionFieldNumber = 1; private global::XReality.Vector3D position_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::XReality.Vector3D Position { get { return position_; } set { position_ = value; } } /// Field number for the "rotation" field. public const int RotationFieldNumber = 2; private global::XReality.Vector3D rotation_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::XReality.Vector3D Rotation { get { return rotation_; } set { rotation_ = value; } } /// Field number for the "scale" field. public const int ScaleFieldNumber = 3; private global::XReality.Vector3D scale_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public global::XReality.Vector3D Scale { get { return scale_; } set { scale_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Transform); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Transform other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (!object.Equals(Position, other.Position)) return false; if (!object.Equals(Rotation, other.Rotation)) return false; if (!object.Equals(Scale, other.Scale)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (position_ != null) hash ^= Position.GetHashCode(); if (rotation_ != null) hash ^= Rotation.GetHashCode(); if (scale_ != null) hash ^= Scale.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (position_ != null) { output.WriteRawTag(10); output.WriteMessage(Position); } if (rotation_ != null) { output.WriteRawTag(18); output.WriteMessage(Rotation); } if (scale_ != null) { output.WriteRawTag(26); output.WriteMessage(Scale); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (position_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Position); } if (rotation_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Rotation); } if (scale_ != null) { size += 1 + pb::CodedOutputStream.ComputeMessageSize(Scale); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Transform other) { if (other == null) { return; } if (other.position_ != null) { if (position_ == null) { position_ = new global::XReality.Vector3D(); } Position.MergeFrom(other.Position); } if (other.rotation_ != null) { if (rotation_ == null) { rotation_ = new global::XReality.Vector3D(); } Rotation.MergeFrom(other.Rotation); } if (other.scale_ != null) { if (scale_ == null) { scale_ = new global::XReality.Vector3D(); } Scale.MergeFrom(other.Scale); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { if (position_ == null) { position_ = new global::XReality.Vector3D(); } input.ReadMessage(position_); break; } case 18: { if (rotation_ == null) { rotation_ = new global::XReality.Vector3D(); } input.ReadMessage(rotation_); break; } case 26: { if (scale_ == null) { scale_ = new global::XReality.Vector3D(); } input.ReadMessage(scale_); break; } } } } } public sealed partial class Vector3D : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Vector3D()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::XReality.DomainReflection.Descriptor.MessageTypes[5]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Vector3D() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Vector3D(Vector3D other) : this() { x_ = other.x_; y_ = other.y_; z_ = other.z_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Vector3D Clone() { return new Vector3D(this); } /// Field number for the "x" field. public const int XFieldNumber = 1; private float x_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public float X { get { return x_; } set { x_ = value; } } /// Field number for the "y" field. public const int YFieldNumber = 2; private float y_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public float Y { get { return y_; } set { y_ = value; } } /// Field number for the "z" field. public const int ZFieldNumber = 3; private float z_; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public float Z { get { return z_; } set { z_ = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Vector3D); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Vector3D other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(X, other.X)) return false; if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Y, other.Y)) return false; if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Z, other.Z)) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (X != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(X); if (Y != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Y); if (Z != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Z); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (X != 0F) { output.WriteRawTag(13); output.WriteFloat(X); } if (Y != 0F) { output.WriteRawTag(21); output.WriteFloat(Y); } if (Z != 0F) { output.WriteRawTag(29); output.WriteFloat(Z); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (X != 0F) { size += 1 + 4; } if (Y != 0F) { size += 1 + 4; } if (Z != 0F) { size += 1 + 4; } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Vector3D other) { if (other == null) { return; } if (other.X != 0F) { X = other.X; } if (other.Y != 0F) { Y = other.Y; } if (other.Z != 0F) { Z = other.Z; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 13: { X = input.ReadFloat(); break; } case 21: { Y = input.ReadFloat(); break; } case 29: { Z = input.ReadFloat(); break; } } } } } public sealed partial class Anchor : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Anchor()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::XReality.DomainReflection.Descriptor.MessageTypes[6]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Anchor() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Anchor(Anchor other) : this() { type_ = other.type_; data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Anchor Clone() { return new Anchor(this); } /// Field number for the "type" field. public const int TypeFieldNumber = 1; private string type_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Type { get { return type_; } set { type_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Field number for the "data" field. public const int DataFieldNumber = 2; private pb::ByteString data_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString Data { get { return data_; } set { data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Anchor); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Anchor other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (Type != other.Type) return false; if (Data != other.Data) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Type.Length != 0) hash ^= Type.GetHashCode(); if (Data.Length != 0) hash ^= Data.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Type.Length != 0) { output.WriteRawTag(10); output.WriteString(Type); } if (Data.Length != 0) { output.WriteRawTag(18); output.WriteBytes(Data); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Type.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Type); } if (Data.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Anchor other) { if (other == null) { return; } if (other.Type.Length != 0) { Type = other.Type; } if (other.Data.Length != 0) { Data = other.Data; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Type = input.ReadString(); break; } case 18: { Data = input.ReadBytes(); break; } } } } } public sealed partial class Model : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Model()); private pb::UnknownFieldSet _unknownFields; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pb::MessageParser Parser { get { return _parser; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public static pbr::MessageDescriptor Descriptor { get { return global::XReality.DomainReflection.Descriptor.MessageTypes[7]; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] pbr::MessageDescriptor pb::IMessage.Descriptor { get { return Descriptor; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Model() { OnConstruction(); } partial void OnConstruction(); [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Model(Model other) : this() { type_ = other.type_; data_ = other.data_; _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public Model Clone() { return new Model(this); } /// Field number for the "type" field. public const int TypeFieldNumber = 1; private string type_ = ""; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Type { get { return type_; } set { type_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } /// Field number for the "data" field. public const int DataFieldNumber = 2; private pb::ByteString data_ = pb::ByteString.Empty; [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pb::ByteString Data { get { return data_; } set { data_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override bool Equals(object other) { return Equals(other as Model); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public bool Equals(Model other) { if (ReferenceEquals(other, null)) { return false; } if (ReferenceEquals(other, this)) { return true; } if (Type != other.Type) return false; if (Data != other.Data) return false; return Equals(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; if (Type.Length != 0) hash ^= Type.GetHashCode(); if (Data.Length != 0) hash ^= Data.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return hash; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override string ToString() { return pb::JsonFormatter.ToDiagnosticString(this); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void WriteTo(pb::CodedOutputStream output) { if (Type.Length != 0) { output.WriteRawTag(10); output.WriteString(Type); } if (Data.Length != 0) { output.WriteRawTag(18); output.WriteBytes(Data); } if (_unknownFields != null) { _unknownFields.WriteTo(output); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public int CalculateSize() { int size = 0; if (Type.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeStringSize(Type); } if (Data.Length != 0) { size += 1 + pb::CodedOutputStream.ComputeBytesSize(Data); } if (_unknownFields != null) { size += _unknownFields.CalculateSize(); } return size; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(Model other) { if (other == null) { return; } if (other.Type.Length != 0) { Type = other.Type; } if (other.Data.Length != 0) { Data = other.Data; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public void MergeFrom(pb::CodedInputStream input) { uint tag; while ((tag = input.ReadTag()) != 0) { switch(tag) { default: _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); break; case 10: { Type = input.ReadString(); break; } case 18: { Data = input.ReadBytes(); break; } } } } } #endregion } ```

Here is proto definition:

domain.proto ```proto syntax = "proto3"; option csharp_namespace = "XReality"; option java_package = "net.elenx.xreality.domain"; option java_multiple_files = true; message Interaction { string objectUuid = 1; string containerUuid = 2; string ownerUuid = 3; Type type = 4; enum Type { ANY = 0; GAZE = 1; TOUCH = 2; HOLD_ENTER = 3; HOLD_EXIT = 4; COLLISION_ENTER = 5; COLLISION_EXIT = 6; } } message RealityContainer { string uuid = 1; string ownerUuid = 2; repeated Object3D object = 4; map variables = 5; } message Object3D { string uuid = 1; Pivot pivot = 2; Model model = 3; } message Pivot { string uuid = 1; Transform relativeTransform = 2; oneof parent { Pivot pivot = 3; Anchor anchor = 4; } } message Transform { Vector3D position = 1; Vector3D rotation = 2; Vector3D scale = 3; } message Vector3D { float x = 1; float y = 2; float z = 3; } message Anchor { string type = 1; bytes data = 2; } message Model { string type = 1; bytes data = 2; } ```

I am able to convert it to text or bytes, but I don't know how to plugin my custom serializer (if it is even possible).

TheElan commented 5 years ago

@Aaronontheweb, any clues on how I can solve this or work around?