public static MemberState DeserializeLengthDelimited(Stream stream) { MemberState memberState = new MemberState(); MemberState.DeserializeLengthDelimited(stream, memberState); return(memberState); }
public static Member Deserialize(Stream stream, Member 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.Identity != null) { bnet.protocol.Identity.DeserializeLengthDelimited(stream, instance.Identity); } else { instance.Identity = bnet.protocol.Identity.DeserializeLengthDelimited(stream); } } else if (num != 18) { 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.State != null) { MemberState.DeserializeLengthDelimited(stream, instance.State); } else { instance.State = MemberState.DeserializeLengthDelimited(stream); } } else { if (stream.Position != limit) { throw new ProtocolBufferException("Read past max limit"); } break; } } return(instance); }
public static Member Deserialize(Stream stream, Member 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 != 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 if (instance.State == null) { instance.State = MemberState.DeserializeLengthDelimited(stream); } else { MemberState.DeserializeLengthDelimited(stream, instance.State); } } else if (instance.Identity == null) { instance.Identity = Identity.DeserializeLengthDelimited(stream); } else { Identity.DeserializeLengthDelimited(stream, instance.Identity); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static AddMemberRequest Deserialize(Stream stream, AddMemberRequest instance, long limit) { instance.Subscribe = true; 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 != 18) { if (num2 != 26) { if (num2 != 32) { if (num2 != 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.Subscribe = ProtocolParser.ReadBool(stream); } } else { instance.ObjectId = ProtocolParser.ReadUInt64(stream); } } else if (instance.MemberState == null) { instance.MemberState = MemberState.DeserializeLengthDelimited(stream); } else { MemberState.DeserializeLengthDelimited(stream, instance.MemberState); } } else if (instance.MemberIdentity == null) { instance.MemberIdentity = Identity.DeserializeLengthDelimited(stream); } else { Identity.DeserializeLengthDelimited(stream, instance.MemberIdentity); } } else if (instance.AgentId == null) { instance.AgentId = EntityId.DeserializeLengthDelimited(stream); } else { EntityId.DeserializeLengthDelimited(stream, instance.AgentId); } } } if (stream.get_Position() == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }
public static JoinChannelRequest Deserialize(Stream stream, JoinChannelRequest instance, long limit) { if (instance.FriendAccountId == null) { instance.FriendAccountId = new List <EntityId>(); } instance.LocalSubscriber = true; while (limit < 0L || stream.Position < limit) { int num = stream.ReadByte(); if (num == -1) { if (limit >= 0L) { throw new EndOfStreamException(); } return(instance); } else if (num != 10) { if (num != 18) { if (num != 26) { if (num != 32) { if (num != 42) { if (num != 48) { 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.LocalSubscriber = ProtocolParser.ReadBool(stream); } } else { instance.FriendAccountId.Add(EntityId.DeserializeLengthDelimited(stream)); } } else { instance.ObjectId = ProtocolParser.ReadUInt64(stream); } } else if (instance.ChannelId == null) { instance.ChannelId = EntityId.DeserializeLengthDelimited(stream); } else { EntityId.DeserializeLengthDelimited(stream, instance.ChannelId); } } else if (instance.MemberState == null) { instance.MemberState = MemberState.DeserializeLengthDelimited(stream); } else { MemberState.DeserializeLengthDelimited(stream, instance.MemberState); } } else if (instance.AgentIdentity == null) { instance.AgentIdentity = Identity.DeserializeLengthDelimited(stream); } else { Identity.DeserializeLengthDelimited(stream, instance.AgentIdentity); } } if (stream.Position == limit) { return(instance); } throw new ProtocolBufferException("Read past max limit"); }