public override bool Equals(object obj) { ChannelState channelState = obj as ChannelState; return(channelState != null && this.HasIdentity == channelState.HasIdentity && (!this.HasIdentity || this.Identity.Equals(channelState.Identity)) && this.HasProgram == channelState.HasProgram && (!this.HasProgram || this.Program.Equals(channelState.Program)) && this.HasLocale == channelState.HasLocale && (!this.HasLocale || this.Locale.Equals(channelState.Locale)) && this.HasPublic == channelState.HasPublic && (!this.HasPublic || this.Public.Equals(channelState.Public)) && this.HasBucketIndex == channelState.HasBucketIndex && (!this.HasBucketIndex || this.BucketIndex.Equals(channelState.BucketIndex))); }
public void Serialize(Stream stream) { ChannelState.Serialize(stream, this); }
public static ChannelState Deserialize(Stream stream, ChannelState instance, long limit) { BinaryReader binaryReader = new BinaryReader(stream); instance.Public = false; while (limit < 0L || stream.get_Position() < limit) { int num = stream.ReadByte(); if (num != -1) { int num2 = num; switch (num2) { case 29: instance.Locale = binaryReader.ReadUInt32(); continue; case 30: case 31: { IL_7A: if (num2 == 10) { instance.Identity = ProtocolParser.ReadString(stream); continue; } if (num2 == 21) { instance.Program = binaryReader.ReadUInt32(); continue; } if (num2 == 40) { instance.BucketIndex = ProtocolParser.ReadUInt32(stream); continue; } Key key = ProtocolParser.ReadKey((byte)num, stream); uint field = key.Field; if (field != 0u) { ProtocolParser.SkipKey(stream, key); continue; } throw new ProtocolBufferException("Invalid field id: 0, something went wrong in the stream"); } case 32: instance.Public = ProtocolParser.ReadBool(stream); continue; } goto IL_7A; } if (limit >= 0L) { throw new EndOfStreamException(); } return(instance); } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static ChannelState Deserialize(Stream stream, ChannelState instance) { return(ChannelState.Deserialize(stream, instance, -1L)); }
public void SetChat(bnet.protocol.chat.ChannelState val) { this.Chat = val; }
public static ChannelState Deserialize(Stream stream, ChannelState instance, long limit) { BinaryReader binaryReader = new BinaryReader(stream); instance.Public = false; while (limit < 0L || stream.Position < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= 0L) { throw new EndOfStreamException(); } return(instance); } else { switch (num) { case 29: instance.Locale = binaryReader.ReadUInt32(); break; default: if (num != 10) { if (num != 21) { if (num != 40) { 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.BucketIndex = ProtocolParser.ReadUInt32(stream); } } else { instance.Program = binaryReader.ReadUInt32(); } } else { instance.Identity = ProtocolParser.ReadString(stream); } break; case 32: instance.Public = ProtocolParser.ReadBool(stream); break; } } } if (stream.Position == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }