public void Serialize(Stream stream)
 {
     AccountReference.Serialize(stream, this);
 }
        public static AccountReference Deserialize(Stream stream, AccountReference instance, long limit)
        {
            BinaryReader binaryReader = new BinaryReader(stream);

            instance.Region = 0;
            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 == 13)
                    {
                        instance.Id = binaryReader.ReadUInt32();
                    }
                    else if (num == 18)
                    {
                        instance.Email = ProtocolParser.ReadString(stream);
                    }
                    else if (num == 26)
                    {
                        if (instance.Handle != null)
                        {
                            GameAccountHandle.DeserializeLengthDelimited(stream, instance.Handle);
                        }
                        else
                        {
                            instance.Handle = GameAccountHandle.DeserializeLengthDelimited(stream);
                        }
                    }
                    else if (num == 34)
                    {
                        instance.BattleTag = ProtocolParser.ReadString(stream);
                    }
                    else if (num == 80)
                    {
                        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);
        }
 public static AccountReference Deserialize(Stream stream, AccountReference instance)
 {
     return(AccountReference.Deserialize(stream, instance, (long)-1));
 }
 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.Position < limit)
     {
         int num = stream.ReadByte();
         if (num == -1)
         {
             if (limit >= 0L)
             {
                 throw new EndOfStreamException();
             }
             return(instance);
         }
         else if (num != 10)
         {
             if (num != 80)
             {
                 if (num != 88)
                 {
                     if (num != 96)
                     {
                         if (num != 104)
                         {
                             if (num != 112)
                             {
                                 if (num != 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.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public void SetRef(AccountReference val)
 {
     this.Ref = val;
 }
Beispiel #6
0
        public override bool Equals(object obj)
        {
            AccountReference accountReference = obj as AccountReference;

            return(accountReference != null && this.HasId == accountReference.HasId && (!this.HasId || this.Id.Equals(accountReference.Id)) && this.HasEmail == accountReference.HasEmail && (!this.HasEmail || this.Email.Equals(accountReference.Email)) && this.HasHandle == accountReference.HasHandle && (!this.HasHandle || this.Handle.Equals(accountReference.Handle)) && this.HasBattleTag == accountReference.HasBattleTag && (!this.HasBattleTag || this.BattleTag.Equals(accountReference.BattleTag)) && this.HasRegion == accountReference.HasRegion && (!this.HasRegion || this.Region.Equals(accountReference.Region)));
        }