public static JoinChannelResponse DeserializeLengthDelimited(Stream stream)
        {
            JoinChannelResponse joinChannelResponse = new JoinChannelResponse();

            JoinChannelResponse.DeserializeLengthDelimited(stream, joinChannelResponse);
            return(joinChannelResponse);
        }
        public static JoinChannelResponse DeserializeLengthDelimited(Stream stream, JoinChannelResponse instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

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

            if (joinChannelResponse == null)
            {
                return(false);
            }
            if (this.HasObjectId != joinChannelResponse.HasObjectId || (this.HasObjectId && !this.ObjectId.Equals(joinChannelResponse.ObjectId)))
            {
                return(false);
            }
            if (this.HasRequireFriendValidation != joinChannelResponse.HasRequireFriendValidation || (this.HasRequireFriendValidation && !this.RequireFriendValidation.Equals(joinChannelResponse.RequireFriendValidation)))
            {
                return(false);
            }
            if (this.PrivilegedAccount.get_Count() != joinChannelResponse.PrivilegedAccount.get_Count())
            {
                return(false);
            }
            for (int i = 0; i < this.PrivilegedAccount.get_Count(); i++)
            {
                if (!this.PrivilegedAccount.get_Item(i).Equals(joinChannelResponse.PrivilegedAccount.get_Item(i)))
                {
                    return(false);
                }
            }
            return(true);
        }
 public static void Serialize(Stream stream, JoinChannelResponse instance)
 {
     if (instance.HasObjectId)
     {
         stream.WriteByte(8);
         ProtocolParser.WriteUInt64(stream, instance.ObjectId);
     }
     if (instance.HasRequireFriendValidation)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteBool(stream, instance.RequireFriendValidation);
     }
     if (instance.PrivilegedAccount.get_Count() > 0)
     {
         using (List <EntityId> .Enumerator enumerator = instance.PrivilegedAccount.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 EntityId current = enumerator.get_Current();
                 stream.WriteByte(26);
                 ProtocolParser.WriteUInt32(stream, current.GetSerializedSize());
                 EntityId.Serialize(stream, current);
             }
         }
     }
 }
        public static JoinChannelResponse DeserializeLengthDelimited(Stream stream, JoinChannelResponse instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(JoinChannelResponse.Deserialize(stream, instance, position));
        }
 public static JoinChannelResponse Deserialize(Stream stream, JoinChannelResponse instance, long limit)
 {
     instance.RequireFriendValidation = false;
     if (instance.PrivilegedAccount == null)
     {
         instance.PrivilegedAccount = new List <EntityId>();
     }
     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 != 8)
             {
                 if (num2 != 16)
                 {
                     if (num2 != 26)
                     {
                         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.PrivilegedAccount.Add(EntityId.DeserializeLengthDelimited(stream));
                     }
                 }
                 else
                 {
                     instance.RequireFriendValidation = ProtocolParser.ReadBool(stream);
                 }
             }
             else
             {
                 instance.ObjectId = ProtocolParser.ReadUInt64(stream);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static void Serialize(Stream stream, JoinChannelResponse instance)
 {
     if (instance.HasObjectId)
     {
         stream.WriteByte(8);
         ProtocolParser.WriteUInt64(stream, instance.ObjectId);
     }
     if (instance.HasRequireFriendValidation)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteBool(stream, instance.RequireFriendValidation);
     }
     if (instance.PrivilegedAccount.Count > 0)
     {
         foreach (EntityId privilegedAccount in instance.PrivilegedAccount)
         {
             stream.WriteByte(26);
             ProtocolParser.WriteUInt32(stream, privilegedAccount.GetSerializedSize());
             EntityId.Serialize(stream, privilegedAccount);
         }
     }
 }
 public static JoinChannelResponse Deserialize(Stream stream, JoinChannelResponse instance)
 {
     return(JoinChannelResponse.Deserialize(stream, instance, -1L));
 }
 public void Deserialize(Stream stream)
 {
     JoinChannelResponse.Deserialize(stream, this);
 }