public static void Serialize(Stream stream, GetAccountRequest instance)
 {
     if (instance.HasRef)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.Ref.GetSerializedSize());
         AccountReference.Serialize(stream, instance.Ref);
     }
     if (instance.HasFetchAll)
     {
         stream.WriteByte(80);
         ProtocolParser.WriteBool(stream, instance.FetchAll);
     }
     if (instance.HasFetchBlob)
     {
         stream.WriteByte(88);
         ProtocolParser.WriteBool(stream, instance.FetchBlob);
     }
     if (instance.HasFetchId)
     {
         stream.WriteByte(96);
         ProtocolParser.WriteBool(stream, instance.FetchId);
     }
     if (instance.HasFetchEmail)
     {
         stream.WriteByte(104);
         ProtocolParser.WriteBool(stream, instance.FetchEmail);
     }
     if (instance.HasFetchBattleTag)
     {
         stream.WriteByte(112);
         ProtocolParser.WriteBool(stream, instance.FetchBattleTag);
     }
     if (instance.HasFetchFullName)
     {
         stream.WriteByte(120);
         ProtocolParser.WriteBool(stream, instance.FetchFullName);
     }
     if (instance.HasFetchLinks)
     {
         stream.WriteByte(128);
         stream.WriteByte(1);
         ProtocolParser.WriteBool(stream, instance.FetchLinks);
     }
     if (instance.HasFetchParentalControls)
     {
         stream.WriteByte(136);
         stream.WriteByte(1);
         ProtocolParser.WriteBool(stream, instance.FetchParentalControls);
     }
 }
Beispiel #2
0
        public override bool Equals(object obj)
        {
            GetAccountRequest getAccountRequest = obj as GetAccountRequest;

            if (getAccountRequest == null)
            {
                return(false);
            }
            if (this.HasRef != getAccountRequest.HasRef || this.HasRef && !this.Ref.Equals(getAccountRequest.Ref))
            {
                return(false);
            }
            if (this.HasFetchAll != getAccountRequest.HasFetchAll || this.HasFetchAll && !this.FetchAll.Equals(getAccountRequest.FetchAll))
            {
                return(false);
            }
            if (this.HasFetchBlob != getAccountRequest.HasFetchBlob || this.HasFetchBlob && !this.FetchBlob.Equals(getAccountRequest.FetchBlob))
            {
                return(false);
            }
            if (this.HasFetchId != getAccountRequest.HasFetchId || this.HasFetchId && !this.FetchId.Equals(getAccountRequest.FetchId))
            {
                return(false);
            }
            if (this.HasFetchEmail != getAccountRequest.HasFetchEmail || this.HasFetchEmail && !this.FetchEmail.Equals(getAccountRequest.FetchEmail))
            {
                return(false);
            }
            if (this.HasFetchBattleTag != getAccountRequest.HasFetchBattleTag || this.HasFetchBattleTag && !this.FetchBattleTag.Equals(getAccountRequest.FetchBattleTag))
            {
                return(false);
            }
            if (this.HasFetchFullName != getAccountRequest.HasFetchFullName || this.HasFetchFullName && !this.FetchFullName.Equals(getAccountRequest.FetchFullName))
            {
                return(false);
            }
            if (this.HasFetchLinks != getAccountRequest.HasFetchLinks || this.HasFetchLinks && !this.FetchLinks.Equals(getAccountRequest.FetchLinks))
            {
                return(false);
            }
            if (this.HasFetchParentalControls == getAccountRequest.HasFetchParentalControls && (!this.HasFetchParentalControls || this.FetchParentalControls.Equals(getAccountRequest.FetchParentalControls)))
            {
                return(true);
            }
            return(false);
        }
Beispiel #3
0
        public override bool Equals(object obj)
        {
            GetAccountRequest getAccountRequest = obj as GetAccountRequest;

            return(getAccountRequest != null && this.HasRef == getAccountRequest.HasRef && (!this.HasRef || this.Ref.Equals(getAccountRequest.Ref)) && this.HasFetchAll == getAccountRequest.HasFetchAll && (!this.HasFetchAll || this.FetchAll.Equals(getAccountRequest.FetchAll)) && this.HasFetchBlob == getAccountRequest.HasFetchBlob && (!this.HasFetchBlob || this.FetchBlob.Equals(getAccountRequest.FetchBlob)) && this.HasFetchId == getAccountRequest.HasFetchId && (!this.HasFetchId || this.FetchId.Equals(getAccountRequest.FetchId)) && this.HasFetchEmail == getAccountRequest.HasFetchEmail && (!this.HasFetchEmail || this.FetchEmail.Equals(getAccountRequest.FetchEmail)) && this.HasFetchBattleTag == getAccountRequest.HasFetchBattleTag && (!this.HasFetchBattleTag || this.FetchBattleTag.Equals(getAccountRequest.FetchBattleTag)) && this.HasFetchFullName == getAccountRequest.HasFetchFullName && (!this.HasFetchFullName || this.FetchFullName.Equals(getAccountRequest.FetchFullName)) && this.HasFetchLinks == getAccountRequest.HasFetchLinks && (!this.HasFetchLinks || this.FetchLinks.Equals(getAccountRequest.FetchLinks)) && this.HasFetchParentalControls == getAccountRequest.HasFetchParentalControls && (!this.HasFetchParentalControls || this.FetchParentalControls.Equals(getAccountRequest.FetchParentalControls)));
        }
Beispiel #4
0
 public void Serialize(Stream stream)
 {
     GetAccountRequest.Serialize(stream, this);
 }
Beispiel #5
0
 public static GetAccountRequest Deserialize(Stream stream, GetAccountRequest instance, long limit)
 {
     instance.FetchAll              = false;
     instance.FetchBlob             = false;
     instance.FetchId               = false;
     instance.FetchEmail            = false;
     instance.FetchBattleTag        = false;
     instance.FetchFullName         = false;
     instance.FetchLinks            = false;
     instance.FetchParentalControls = false;
     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 != 80)
                 {
                     if (num2 != 88)
                     {
                         if (num2 != 96)
                         {
                             if (num2 != 104)
                             {
                                 if (num2 != 112)
                                 {
                                     if (num2 != 120)
                                     {
                                         Key  key   = ProtocolParser.ReadKey((byte)num, stream);
                                         uint field = key.Field;
                                         if (field != 16u)
                                         {
                                             if (field != 17u)
                                             {
                                                 if (field == 0u)
                                                 {
                                                     throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream");
                                                 }
                                                 ProtocolParser.SkipKey(stream, key);
                                             }
                                             else if (key.WireType == Wire.Varint)
                                             {
                                                 instance.FetchParentalControls = ProtocolParser.ReadBool(stream);
                                             }
                                         }
                                         else if (key.WireType == Wire.Varint)
                                         {
                                             instance.FetchLinks = ProtocolParser.ReadBool(stream);
                                         }
                                     }
                                     else
                                     {
                                         instance.FetchFullName = ProtocolParser.ReadBool(stream);
                                     }
                                 }
                                 else
                                 {
                                     instance.FetchBattleTag = ProtocolParser.ReadBool(stream);
                                 }
                             }
                             else
                             {
                                 instance.FetchEmail = ProtocolParser.ReadBool(stream);
                             }
                         }
                         else
                         {
                             instance.FetchId = ProtocolParser.ReadBool(stream);
                         }
                     }
                     else
                     {
                         instance.FetchBlob = ProtocolParser.ReadBool(stream);
                     }
                 }
                 else
                 {
                     instance.FetchAll = ProtocolParser.ReadBool(stream);
                 }
             }
             else if (instance.Ref == null)
             {
                 instance.Ref = AccountReference.DeserializeLengthDelimited(stream);
             }
             else
             {
                 AccountReference.DeserializeLengthDelimited(stream, instance.Ref);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Beispiel #6
0
 public static GetAccountRequest Deserialize(Stream stream, GetAccountRequest instance)
 {
     return(GetAccountRequest.Deserialize(stream, instance, -1L));
 }