예제 #1
0
        public static IsIgrAddressRequest DeserializeLengthDelimited(Stream stream)
        {
            IsIgrAddressRequest isIgrAddressRequest = new IsIgrAddressRequest();

            IsIgrAddressRequest.DeserializeLengthDelimited(stream, isIgrAddressRequest);
            return(isIgrAddressRequest);
        }
예제 #2
0
        public static IsIgrAddressRequest DeserializeLengthDelimited(Stream stream, IsIgrAddressRequest instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.Position;
            return(IsIgrAddressRequest.Deserialize(stream, instance, num));
        }
예제 #3
0
 public static void Serialize(Stream stream, IsIgrAddressRequest instance)
 {
     if (instance.HasClientAddress)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.ClientAddress));
     }
     if (instance.HasRegion)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt32(stream, instance.Region);
     }
 }
 public static IsIgrAddressRequest Deserialize(Stream stream, IsIgrAddressRequest instance, long limit)
 {
     while (limit < 0L || stream.get_Position() < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else
         {
             int num2 = num;
             if (num2 != 10)
             {
                 if (num2 != 16)
                 {
                     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.Region = ProtocolParser.ReadUInt32(stream);
                 }
             }
             else
             {
                 instance.ClientAddress = ProtocolParser.ReadString(stream);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
        public override bool Equals(object obj)
        {
            IsIgrAddressRequest isIgrAddressRequest = obj as IsIgrAddressRequest;

            if (isIgrAddressRequest == null)
            {
                return(false);
            }
            if (this.HasClientAddress != isIgrAddressRequest.HasClientAddress || this.HasClientAddress && !this.ClientAddress.Equals(isIgrAddressRequest.ClientAddress))
            {
                return(false);
            }
            if (this.HasRegion == isIgrAddressRequest.HasRegion && (!this.HasRegion || this.Region.Equals(isIgrAddressRequest.Region)))
            {
                return(true);
            }
            return(false);
        }
 public static IsIgrAddressRequest Deserialize(Stream stream, IsIgrAddressRequest instance, long limit)
 {
     while (true)
     {
         if (limit < (long)0 || stream.Position < limit)
         {
             int num = stream.ReadByte();
             if (num == -1)
             {
                 if (limit >= (long)0)
                 {
                     throw new EndOfStreamException();
                 }
                 break;
             }
             else if (num == 10)
             {
                 instance.ClientAddress = ProtocolParser.ReadString(stream);
             }
             else if (num == 16)
             {
                 instance.Region = ProtocolParser.ReadUInt32(stream);
             }
             else
             {
                 Key key = ProtocolParser.ReadKey((byte)num, stream);
                 if (key.Field == 0)
                 {
                     throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                 }
                 ProtocolParser.SkipKey(stream, key);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
예제 #7
0
 public static IsIgrAddressRequest Deserialize(Stream stream, IsIgrAddressRequest instance)
 {
     return(IsIgrAddressRequest.Deserialize(stream, instance, -1L));
 }
예제 #8
0
 public void Deserialize(Stream stream)
 {
     IsIgrAddressRequest.Deserialize(stream, this);
 }
예제 #9
0
        public override bool Equals(object obj)
        {
            IsIgrAddressRequest isIgrAddressRequest = obj as IsIgrAddressRequest;

            return(isIgrAddressRequest != null && this.HasClientAddress == isIgrAddressRequest.HasClientAddress && (!this.HasClientAddress || this.ClientAddress.Equals(isIgrAddressRequest.ClientAddress)) && this.HasRegion == isIgrAddressRequest.HasRegion && (!this.HasRegion || this.Region.Equals(isIgrAddressRequest.Region)));
        }