public override bool Equals(object obj)
        {
            PresenceChannelCreatedRequest presenceChannelCreatedRequest = obj as PresenceChannelCreatedRequest;

            if (presenceChannelCreatedRequest == null)
            {
                return(false);
            }
            if (!this.Id.Equals(presenceChannelCreatedRequest.Id))
            {
                return(false);
            }
            if (this.HasGameAccountId != presenceChannelCreatedRequest.HasGameAccountId || this.HasGameAccountId && !this.GameAccountId.Equals(presenceChannelCreatedRequest.GameAccountId))
            {
                return(false);
            }
            if (this.HasBnetAccountId != presenceChannelCreatedRequest.HasBnetAccountId || this.HasBnetAccountId && !this.BnetAccountId.Equals(presenceChannelCreatedRequest.BnetAccountId))
            {
                return(false);
            }
            if (this.HasHost == presenceChannelCreatedRequest.HasHost && (!this.HasHost || this.Host.Equals(presenceChannelCreatedRequest.Host)))
            {
                return(true);
            }
            return(false);
        }
 public static void Serialize(Stream stream, PresenceChannelCreatedRequest instance)
 {
     if (instance.Id == null)
     {
         throw new ArgumentNullException("Id", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.Id.GetSerializedSize());
     EntityId.Serialize(stream, instance.Id);
     if (instance.HasGameAccountId)
     {
         stream.WriteByte(26);
         ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.GameAccountId);
     }
     if (instance.HasBnetAccountId)
     {
         stream.WriteByte(34);
         ProtocolParser.WriteUInt32(stream, instance.BnetAccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.BnetAccountId);
     }
     if (instance.HasHost)
     {
         stream.WriteByte(42);
         ProtocolParser.WriteUInt32(stream, instance.Host.GetSerializedSize());
         ProcessId.Serialize(stream, instance.Host);
     }
 }
        public static PresenceChannelCreatedRequest DeserializeLengthDelimited(Stream stream, PresenceChannelCreatedRequest instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(PresenceChannelCreatedRequest.Deserialize(stream, instance, position));
        }
        public static PresenceChannelCreatedRequest DeserializeLengthDelimited(Stream stream)
        {
            PresenceChannelCreatedRequest presenceChannelCreatedRequest = new PresenceChannelCreatedRequest();

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

            num += stream.get_Position();
            return(PresenceChannelCreatedRequest.Deserialize(stream, instance, num));
        }
 public static PresenceChannelCreatedRequest Deserialize(Stream stream, PresenceChannelCreatedRequest 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.Id != null)
                 {
                     EntityId.DeserializeLengthDelimited(stream, instance.Id);
                 }
                 else
                 {
                     instance.Id = EntityId.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 26)
             {
                 if (instance.GameAccountId != null)
                 {
                     EntityId.DeserializeLengthDelimited(stream, instance.GameAccountId);
                 }
                 else
                 {
                     instance.GameAccountId = EntityId.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 34)
             {
                 if (instance.BnetAccountId != null)
                 {
                     EntityId.DeserializeLengthDelimited(stream, instance.BnetAccountId);
                 }
                 else
                 {
                     instance.BnetAccountId = EntityId.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num != 42)
             {
                 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.Host != null)
             {
                 ProcessId.DeserializeLengthDelimited(stream, instance.Host);
             }
             else
             {
                 instance.Host = ProcessId.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
 public static PresenceChannelCreatedRequest Deserialize(Stream stream, PresenceChannelCreatedRequest instance)
 {
     return(PresenceChannelCreatedRequest.Deserialize(stream, instance, (long)-1));
 }
 public void Deserialize(Stream stream)
 {
     PresenceChannelCreatedRequest.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            PresenceChannelCreatedRequest presenceChannelCreatedRequest = obj as PresenceChannelCreatedRequest;

            return(presenceChannelCreatedRequest != null && this.Id.Equals(presenceChannelCreatedRequest.Id) && this.HasGameAccountId == presenceChannelCreatedRequest.HasGameAccountId && (!this.HasGameAccountId || this.GameAccountId.Equals(presenceChannelCreatedRequest.GameAccountId)) && this.HasBnetAccountId == presenceChannelCreatedRequest.HasBnetAccountId && (!this.HasBnetAccountId || this.BnetAccountId.Equals(presenceChannelCreatedRequest.BnetAccountId)) && this.HasHost == presenceChannelCreatedRequest.HasHost && (!this.HasHost || this.Host.Equals(presenceChannelCreatedRequest.Host)));
        }
 public static PresenceChannelCreatedRequest Deserialize(Stream stream, PresenceChannelCreatedRequest 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 != 26)
                 {
                     if (num2 != 34)
                     {
                         if (num2 != 42)
                         {
                             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 if (instance.Host == null)
                         {
                             instance.Host = ProcessId.DeserializeLengthDelimited(stream);
                         }
                         else
                         {
                             ProcessId.DeserializeLengthDelimited(stream, instance.Host);
                         }
                     }
                     else if (instance.BnetAccountId == null)
                     {
                         instance.BnetAccountId = EntityId.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         EntityId.DeserializeLengthDelimited(stream, instance.BnetAccountId);
                     }
                 }
                 else if (instance.GameAccountId == null)
                 {
                     instance.GameAccountId = EntityId.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     EntityId.DeserializeLengthDelimited(stream, instance.GameAccountId);
                 }
             }
             else if (instance.Id == null)
             {
                 instance.Id = EntityId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.Id);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }