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

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

            GetAccountResponse.DeserializeLengthDelimited(stream, getAccountResponse);
            return(getAccountResponse);
        }
コード例 #3
0
        public static GetAccountResponse DeserializeLengthDelimited(Stream stream, GetAccountResponse instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(GetAccountResponse.Deserialize(stream, instance, position));
        }
コード例 #4
0
 public static void Serialize(Stream stream, GetAccountResponse instance)
 {
     if (instance.HasBlob)
     {
         stream.WriteByte(90);
         ProtocolParser.WriteUInt32(stream, instance.Blob.GetSerializedSize());
         AccountBlob.Serialize(stream, instance.Blob);
     }
     if (instance.HasId)
     {
         stream.WriteByte(98);
         ProtocolParser.WriteUInt32(stream, instance.Id.GetSerializedSize());
         AccountId.Serialize(stream, instance.Id);
     }
     if (instance.Email.get_Count() > 0)
     {
         using (List <string> .Enumerator enumerator = instance.Email.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 string current = enumerator.get_Current();
                 stream.WriteByte(106);
                 ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(current));
             }
         }
     }
     if (instance.HasBattleTag)
     {
         stream.WriteByte(114);
         ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.BattleTag));
     }
     if (instance.HasFullName)
     {
         stream.WriteByte(122);
         ProtocolParser.WriteBytes(stream, Encoding.get_UTF8().GetBytes(instance.FullName));
     }
     if (instance.Links.get_Count() > 0)
     {
         using (List <GameAccountLink> .Enumerator enumerator2 = instance.Links.GetEnumerator())
         {
             while (enumerator2.MoveNext())
             {
                 GameAccountLink current2 = enumerator2.get_Current();
                 stream.WriteByte(130);
                 stream.WriteByte(1);
                 ProtocolParser.WriteUInt32(stream, current2.GetSerializedSize());
                 GameAccountLink.Serialize(stream, current2);
             }
         }
     }
     if (instance.HasParentalControlInfo)
     {
         stream.WriteByte(138);
         stream.WriteByte(1);
         ProtocolParser.WriteUInt32(stream, instance.ParentalControlInfo.GetSerializedSize());
         ParentalControlInfo.Serialize(stream, instance.ParentalControlInfo);
     }
 }
コード例 #5
0
        public override bool Equals(object obj)
        {
            GetAccountResponse getAccountResponse = obj as GetAccountResponse;

            if (getAccountResponse == null)
            {
                return(false);
            }
            if (this.HasBlob != getAccountResponse.HasBlob || this.HasBlob && !this.Blob.Equals(getAccountResponse.Blob))
            {
                return(false);
            }
            if (this.HasId != getAccountResponse.HasId || this.HasId && !this.Id.Equals(getAccountResponse.Id))
            {
                return(false);
            }
            if (this.Email.Count != getAccountResponse.Email.Count)
            {
                return(false);
            }
            for (int i = 0; i < this.Email.Count; i++)
            {
                if (!this.Email[i].Equals(getAccountResponse.Email[i]))
                {
                    return(false);
                }
            }
            if (this.HasBattleTag != getAccountResponse.HasBattleTag || this.HasBattleTag && !this.BattleTag.Equals(getAccountResponse.BattleTag))
            {
                return(false);
            }
            if (this.HasFullName != getAccountResponse.HasFullName || this.HasFullName && !this.FullName.Equals(getAccountResponse.FullName))
            {
                return(false);
            }
            if (this.Links.Count != getAccountResponse.Links.Count)
            {
                return(false);
            }
            for (int j = 0; j < this.Links.Count; j++)
            {
                if (!this.Links[j].Equals(getAccountResponse.Links[j]))
                {
                    return(false);
                }
            }
            if (this.HasParentalControlInfo == getAccountResponse.HasParentalControlInfo && (!this.HasParentalControlInfo || this.ParentalControlInfo.Equals(getAccountResponse.ParentalControlInfo)))
            {
                return(true);
            }
            return(false);
        }
コード例 #6
0
 public static void Serialize(Stream stream, GetAccountResponse instance)
 {
     if (instance.HasBlob)
     {
         stream.WriteByte(90);
         ProtocolParser.WriteUInt32(stream, instance.Blob.GetSerializedSize());
         AccountBlob.Serialize(stream, instance.Blob);
     }
     if (instance.HasId)
     {
         stream.WriteByte(98);
         ProtocolParser.WriteUInt32(stream, instance.Id.GetSerializedSize());
         AccountId.Serialize(stream, instance.Id);
     }
     if (instance.Email.Count > 0)
     {
         foreach (string s in instance.Email)
         {
             stream.WriteByte(106);
             ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(s));
         }
     }
     if (instance.HasBattleTag)
     {
         stream.WriteByte(114);
         ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.BattleTag));
     }
     if (instance.HasFullName)
     {
         stream.WriteByte(122);
         ProtocolParser.WriteBytes(stream, Encoding.UTF8.GetBytes(instance.FullName));
     }
     if (instance.Links.Count > 0)
     {
         foreach (GameAccountLink gameAccountLink in instance.Links)
         {
             stream.WriteByte(130);
             stream.WriteByte(1);
             ProtocolParser.WriteUInt32(stream, gameAccountLink.GetSerializedSize());
             GameAccountLink.Serialize(stream, gameAccountLink);
         }
     }
     if (instance.HasParentalControlInfo)
     {
         stream.WriteByte(138);
         stream.WriteByte(1);
         ProtocolParser.WriteUInt32(stream, instance.ParentalControlInfo.GetSerializedSize());
         ParentalControlInfo.Serialize(stream, instance.ParentalControlInfo);
     }
 }
コード例 #7
0
 public void Serialize(Stream stream)
 {
     GetAccountResponse.Serialize(stream, this);
 }
コード例 #8
0
 public static GetAccountResponse Deserialize(Stream stream, GetAccountResponse instance, long limit)
 {
     if (instance.Email == null)
     {
         instance.Email = new List <string>();
     }
     if (instance.Links == null)
     {
         instance.Links = new List <GameAccountLink>();
     }
     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 != 90)
             {
                 if (num2 != 98)
                 {
                     if (num2 != 106)
                     {
                         if (num2 != 114)
                         {
                             if (num2 != 122)
                             {
                                 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.LengthDelimited)
                                     {
                                         if (instance.ParentalControlInfo == null)
                                         {
                                             instance.ParentalControlInfo = ParentalControlInfo.DeserializeLengthDelimited(stream);
                                         }
                                         else
                                         {
                                             ParentalControlInfo.DeserializeLengthDelimited(stream, instance.ParentalControlInfo);
                                         }
                                     }
                                 }
                                 else if (key.WireType == Wire.LengthDelimited)
                                 {
                                     instance.Links.Add(GameAccountLink.DeserializeLengthDelimited(stream));
                                 }
                             }
                             else
                             {
                                 instance.FullName = ProtocolParser.ReadString(stream);
                             }
                         }
                         else
                         {
                             instance.BattleTag = ProtocolParser.ReadString(stream);
                         }
                     }
                     else
                     {
                         instance.Email.Add(ProtocolParser.ReadString(stream));
                     }
                 }
                 else if (instance.Id == null)
                 {
                     instance.Id = AccountId.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     AccountId.DeserializeLengthDelimited(stream, instance.Id);
                 }
             }
             else if (instance.Blob == null)
             {
                 instance.Blob = AccountBlob.DeserializeLengthDelimited(stream);
             }
             else
             {
                 AccountBlob.DeserializeLengthDelimited(stream, instance.Blob);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
コード例 #9
0
 public static GetAccountResponse Deserialize(Stream stream, GetAccountResponse instance)
 {
     return(GetAccountResponse.Deserialize(stream, instance, -1L));
 }