public static GameAccountStateNotification DeserializeLengthDelimited(Stream stream)
        {
            GameAccountStateNotification gameAccountStateNotification = new GameAccountStateNotification();

            GameAccountStateNotification.DeserializeLengthDelimited(stream, gameAccountStateNotification);
            return(gameAccountStateNotification);
        }
 public static void Serialize(Stream stream, GameAccountStateNotification instance)
 {
     if (instance.HasState)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.State.GetSerializedSize());
         GameAccountState.Serialize(stream, instance.State);
     }
     if (instance.HasSubscriberId)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt64(stream, instance.SubscriberId);
     }
     if (instance.HasGameAccountTags)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.GameAccountTags.GetSerializedSize());
         GameAccountFieldTags.Serialize(stream, instance.GameAccountTags);
     }
     if (instance.HasSubscriptionCompleted)
     {
         stream.WriteByte(32);
         ProtocolParser.WriteBool(stream, instance.SubscriptionCompleted);
     }
 }
        public static GameAccountStateNotification DeserializeLengthDelimited(Stream stream, GameAccountStateNotification instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(GameAccountStateNotification.Deserialize(stream, instance, num));
        }
        public override bool Equals(object obj)
        {
            GameAccountStateNotification gameAccountStateNotification = obj as GameAccountStateNotification;

            if (gameAccountStateNotification == null)
            {
                return(false);
            }
            if (this.HasState != gameAccountStateNotification.HasState || this.HasState && !this.State.Equals(gameAccountStateNotification.State))
            {
                return(false);
            }
            if (this.HasSubscriberId != gameAccountStateNotification.HasSubscriberId || this.HasSubscriberId && !this.SubscriberId.Equals(gameAccountStateNotification.SubscriberId))
            {
                return(false);
            }
            if (this.HasGameAccountTags != gameAccountStateNotification.HasGameAccountTags || this.HasGameAccountTags && !this.GameAccountTags.Equals(gameAccountStateNotification.GameAccountTags))
            {
                return(false);
            }
            if (this.HasSubscriptionCompleted == gameAccountStateNotification.HasSubscriptionCompleted && (!this.HasSubscriptionCompleted || this.SubscriptionCompleted.Equals(gameAccountStateNotification.SubscriptionCompleted)))
            {
                return(true);
            }
            return(false);
        }
        public static GameAccountStateNotification DeserializeLengthDelimited(Stream stream, GameAccountStateNotification instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(GameAccountStateNotification.Deserialize(stream, instance, position));
        }
 public static GameAccountStateNotification Deserialize(Stream stream, GameAccountStateNotification instance)
 {
     return(GameAccountStateNotification.Deserialize(stream, instance, -1L));
 }
 public void Deserialize(Stream stream)
 {
     GameAccountStateNotification.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            GameAccountStateNotification gameAccountStateNotification = obj as GameAccountStateNotification;

            return(gameAccountStateNotification != null && this.HasState == gameAccountStateNotification.HasState && (!this.HasState || this.State.Equals(gameAccountStateNotification.State)) && this.HasSubscriberId == gameAccountStateNotification.HasSubscriberId && (!this.HasSubscriberId || this.SubscriberId.Equals(gameAccountStateNotification.SubscriberId)) && this.HasGameAccountTags == gameAccountStateNotification.HasGameAccountTags && (!this.HasGameAccountTags || this.GameAccountTags.Equals(gameAccountStateNotification.GameAccountTags)) && this.HasSubscriptionCompleted == gameAccountStateNotification.HasSubscriptionCompleted && (!this.HasSubscriptionCompleted || this.SubscriptionCompleted.Equals(gameAccountStateNotification.SubscriptionCompleted)));
        }
 public static GameAccountStateNotification Deserialize(Stream stream, GameAccountStateNotification 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)
                 {
                     if (num2 != 26)
                     {
                         if (num2 != 32)
                         {
                             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.SubscriptionCompleted = ProtocolParser.ReadBool(stream);
                         }
                     }
                     else if (instance.GameAccountTags == null)
                     {
                         instance.GameAccountTags = GameAccountFieldTags.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         GameAccountFieldTags.DeserializeLengthDelimited(stream, instance.GameAccountTags);
                     }
                 }
                 else
                 {
                     instance.SubscriberId = ProtocolParser.ReadUInt64(stream);
                 }
             }
             else if (instance.State == null)
             {
                 instance.State = GameAccountState.DeserializeLengthDelimited(stream);
             }
             else
             {
                 GameAccountState.DeserializeLengthDelimited(stream, instance.State);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static GameAccountStateNotification Deserialize(Stream stream, GameAccountStateNotification 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)
             {
                 if (instance.State != null)
                 {
                     GameAccountState.DeserializeLengthDelimited(stream, instance.State);
                 }
                 else
                 {
                     instance.State = GameAccountState.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 16)
             {
                 instance.SubscriberId = ProtocolParser.ReadUInt64(stream);
             }
             else if (num != 26)
             {
                 if (num == 32)
                 {
                     instance.SubscriptionCompleted = ProtocolParser.ReadBool(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 (instance.GameAccountTags != null)
             {
                 GameAccountFieldTags.DeserializeLengthDelimited(stream, instance.GameAccountTags);
             }
             else
             {
                 instance.GameAccountTags = GameAccountFieldTags.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }