public static ModuleMessageRequest DeserializeLengthDelimited(Stream stream)
        {
            ModuleMessageRequest moduleMessageRequest = new ModuleMessageRequest();

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

            num += stream.get_Position();
            return(ModuleMessageRequest.Deserialize(stream, instance, num));
        }
        public static ModuleMessageRequest DeserializeLengthDelimited(Stream stream, ModuleMessageRequest instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(ModuleMessageRequest.Deserialize(stream, instance, position));
        }
 public static void Serialize(Stream stream, ModuleMessageRequest instance)
 {
     stream.WriteByte(8);
     ProtocolParser.WriteUInt64(stream, (ulong)((long)instance.ModuleId));
     if (instance.HasMessage)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteBytes(stream, instance.Message);
     }
 }
 public static ModuleMessageRequest Deserialize(Stream stream, ModuleMessageRequest 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 != 8)
             {
                 if (num2 != 18)
                 {
                     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.Message = ProtocolParser.ReadBytes(stream);
                 }
             }
             else
             {
                 instance.ModuleId = (int)ProtocolParser.ReadUInt64(stream);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
        public override bool Equals(object obj)
        {
            ModuleMessageRequest moduleMessageRequest = obj as ModuleMessageRequest;

            if (moduleMessageRequest == null)
            {
                return(false);
            }
            if (!this.ModuleId.Equals(moduleMessageRequest.ModuleId))
            {
                return(false);
            }
            if (this.HasMessage == moduleMessageRequest.HasMessage && (!this.HasMessage || this.Message.Equals(moduleMessageRequest.Message)))
            {
                return(true);
            }
            return(false);
        }
 public static ModuleMessageRequest Deserialize(Stream stream, ModuleMessageRequest 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 == 8)
             {
                 instance.ModuleId = (int)ProtocolParser.ReadUInt64(stream);
             }
             else if (num == 18)
             {
                 instance.Message = ProtocolParser.ReadBytes(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 ModuleMessageRequest Deserialize(Stream stream, ModuleMessageRequest instance)
 {
     return(ModuleMessageRequest.Deserialize(stream, instance, -1L));
 }
 public void Deserialize(Stream stream)
 {
     ModuleMessageRequest.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            ModuleMessageRequest moduleMessageRequest = obj as ModuleMessageRequest;

            return(moduleMessageRequest != null && this.ModuleId.Equals(moduleMessageRequest.ModuleId) && this.HasMessage == moduleMessageRequest.HasMessage && (!this.HasMessage || this.Message.Equals(moduleMessageRequest.Message)));
        }