コード例 #1
0
        public static AcceptInvitationRequest DeserializeLengthDelimited(Stream stream, AcceptInvitationRequest instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(AcceptInvitationRequest.Deserialize(stream, instance, num));
        }
コード例 #2
0
        public static AcceptInvitationRequest DeserializeLengthDelimited(Stream stream)
        {
            AcceptInvitationRequest acceptInvitationRequest = new AcceptInvitationRequest();

            AcceptInvitationRequest.DeserializeLengthDelimited(stream, acceptInvitationRequest);
            return(acceptInvitationRequest);
        }
        public override bool Equals(object obj)
        {
            AcceptInvitationRequest acceptInvitationRequest = obj as AcceptInvitationRequest;

            if (acceptInvitationRequest == null)
            {
                return(false);
            }
            if (this.HasAgentId != acceptInvitationRequest.HasAgentId || this.HasAgentId && !this.AgentId.Equals(acceptInvitationRequest.AgentId))
            {
                return(false);
            }
            if (this.HasMemberState != acceptInvitationRequest.HasMemberState || this.HasMemberState && !this.MemberState.Equals(acceptInvitationRequest.MemberState))
            {
                return(false);
            }
            if (!this.InvitationId.Equals(acceptInvitationRequest.InvitationId))
            {
                return(false);
            }
            if (!this.ObjectId.Equals(acceptInvitationRequest.ObjectId))
            {
                return(false);
            }
            if (this.HasChannelId != acceptInvitationRequest.HasChannelId || this.HasChannelId && !this.ChannelId.Equals(acceptInvitationRequest.ChannelId))
            {
                return(false);
            }
            if (this.HasServiceType != acceptInvitationRequest.HasServiceType || this.HasServiceType && !this.ServiceType.Equals(acceptInvitationRequest.ServiceType))
            {
                return(false);
            }
            if (this.HasLocalSubscriber == acceptInvitationRequest.HasLocalSubscriber && (!this.HasLocalSubscriber || this.LocalSubscriber.Equals(acceptInvitationRequest.LocalSubscriber)))
            {
                return(true);
            }
            return(false);
        }
コード例 #4
0
        public static void Serialize(Stream stream, AcceptInvitationRequest instance)
        {
            BinaryWriter binaryWriter = new BinaryWriter(stream);

            if (instance.HasAgentId)
            {
                stream.WriteByte(10);
                ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize());
                EntityId.Serialize(stream, instance.AgentId);
            }
            if (instance.HasMemberState)
            {
                stream.WriteByte(18);
                ProtocolParser.WriteUInt32(stream, instance.MemberState.GetSerializedSize());
                MemberState.Serialize(stream, instance.MemberState);
            }
            stream.WriteByte(25);
            binaryWriter.Write(instance.InvitationId);
            stream.WriteByte(32);
            ProtocolParser.WriteUInt64(stream, instance.ObjectId);
            if (instance.HasChannelId)
            {
                stream.WriteByte(42);
                ProtocolParser.WriteUInt32(stream, instance.ChannelId.GetSerializedSize());
                EntityId.Serialize(stream, instance.ChannelId);
            }
            if (instance.HasServiceType)
            {
                stream.WriteByte(48);
                ProtocolParser.WriteUInt32(stream, instance.ServiceType);
            }
            if (instance.HasLocalSubscriber)
            {
                stream.WriteByte(56);
                ProtocolParser.WriteBool(stream, instance.LocalSubscriber);
            }
        }
コード例 #5
0
 public void Serialize(Stream stream)
 {
     AcceptInvitationRequest.Serialize(stream, this);
 }
コード例 #6
0
        public static AcceptInvitationRequest Deserialize(Stream stream, AcceptInvitationRequest instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            instance.LocalSubscriber = true;
            while (limit < 0L || stream.Position < limit)
            {
                int num = stream.ReadByte();
                if (num == -1)
                {
                    if (limit >= 0L)
                    {
                        throw new EndOfStreamException();
                    }
                    return(instance);
                }
                else if (num != 10)
                {
                    if (num != 18)
                    {
                        if (num != 25)
                        {
                            if (num != 32)
                            {
                                if (num != 42)
                                {
                                    if (num != 48)
                                    {
                                        if (num != 56)
                                        {
                                            Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                                            uint field = key.Field;
                                            if (field == 0u)
                                            {
                                                throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                                            }
                                            ProtocolParser.SkipKey(stream, key);
                                        }
                                        else
                                        {
                                            instance.LocalSubscriber = ProtocolParser.ReadBool(stream);
                                        }
                                    }
                                    else
                                    {
                                        instance.ServiceType = ProtocolParser.ReadUInt32(stream);
                                    }
                                }
                                else if (instance.ChannelId == null)
                                {
                                    instance.ChannelId = EntityId.DeserializeLengthDelimited(stream);
                                }
                                else
                                {
                                    EntityId.DeserializeLengthDelimited(stream, instance.ChannelId);
                                }
                            }
                            else
                            {
                                instance.ObjectId = ProtocolParser.ReadUInt64(stream);
                            }
                        }
                        else
                        {
                            instance.InvitationId = binaryReader.ReadUInt64();
                        }
                    }
                    else if (instance.MemberState == null)
                    {
                        instance.MemberState = MemberState.DeserializeLengthDelimited(stream);
                    }
                    else
                    {
                        MemberState.DeserializeLengthDelimited(stream, instance.MemberState);
                    }
                }
                else if (instance.AgentId == null)
                {
                    instance.AgentId = EntityId.DeserializeLengthDelimited(stream);
                }
                else
                {
                    EntityId.DeserializeLengthDelimited(stream, instance.AgentId);
                }
            }
            if (stream.Position == limit)
            {
                return(instance);
            }
            throw new ProtocolBufferException("Read past max limit");
        }
コード例 #7
0
 public static AcceptInvitationRequest Deserialize(Stream stream, AcceptInvitationRequest instance)
 {
     return(AcceptInvitationRequest.Deserialize(stream, instance, -1L));
 }
コード例 #8
0
        public override bool Equals(object obj)
        {
            AcceptInvitationRequest acceptInvitationRequest = obj as AcceptInvitationRequest;

            return(acceptInvitationRequest != null && this.HasAgentId == acceptInvitationRequest.HasAgentId && (!this.HasAgentId || this.AgentId.Equals(acceptInvitationRequest.AgentId)) && this.HasMemberState == acceptInvitationRequest.HasMemberState && (!this.HasMemberState || this.MemberState.Equals(acceptInvitationRequest.MemberState)) && this.InvitationId.Equals(acceptInvitationRequest.InvitationId) && this.ObjectId.Equals(acceptInvitationRequest.ObjectId) && this.HasChannelId == acceptInvitationRequest.HasChannelId && (!this.HasChannelId || this.ChannelId.Equals(acceptInvitationRequest.ChannelId)) && this.HasServiceType == acceptInvitationRequest.HasServiceType && (!this.HasServiceType || this.ServiceType.Equals(acceptInvitationRequest.ServiceType)) && this.HasLocalSubscriber == acceptInvitationRequest.HasLocalSubscriber && (!this.HasLocalSubscriber || this.LocalSubscriber.Equals(acceptInvitationRequest.LocalSubscriber)));
        }