Beispiel #1
0
        public static ChannelState DeserializeLengthDelimited(Stream stream)
        {
            ChannelState channelState = new ChannelState();

            ChannelState.DeserializeLengthDelimited(stream, channelState);
            return(channelState);
        }
Beispiel #2
0
 public static ChannelDescription Deserialize(Stream stream, ChannelDescription 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 != 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 if (instance.State == null)
                     {
                         instance.State = ChannelState.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         ChannelState.DeserializeLengthDelimited(stream, instance.State);
                     }
                 }
                 else
                 {
                     instance.CurrentMembers = ProtocolParser.ReadUInt32(stream);
                 }
             }
             else if (instance.ChannelId == null)
             {
                 instance.ChannelId = EntityId.DeserializeLengthDelimited(stream);
             }
             else
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.ChannelId);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Beispiel #3
0
 public static AddNotification Deserialize(Stream stream, AddNotification instance, long limit)
 {
     if (instance.Member == null)
     {
         instance.Member = new List <Member>();
     }
     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)
                 {
                     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.ChannelState == null)
                 {
                     instance.ChannelState = ChannelState.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     ChannelState.DeserializeLengthDelimited(stream, instance.ChannelState);
                 }
             }
             else
             {
                 instance.Member.Add(bnet.protocol.channel.Member.DeserializeLengthDelimited(stream));
             }
         }
         else if (instance.Self == null)
         {
             instance.Self = bnet.protocol.channel.Member.DeserializeLengthDelimited(stream);
         }
         else
         {
             bnet.protocol.channel.Member.DeserializeLengthDelimited(stream, instance.Self);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Beispiel #4
0
 public static ChannelDescription Deserialize(Stream stream, ChannelDescription 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.ChannelId != null)
                 {
                     EntityId.DeserializeLengthDelimited(stream, instance.ChannelId);
                 }
                 else
                 {
                     instance.ChannelId = EntityId.DeserializeLengthDelimited(stream);
                 }
             }
             else if (num == 16)
             {
                 instance.CurrentMembers = ProtocolParser.ReadUInt32(stream);
             }
             else if (num != 26)
             {
                 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)
             {
                 ChannelState.DeserializeLengthDelimited(stream, instance.State);
             }
             else
             {
                 instance.State = ChannelState.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
Beispiel #5
0
 public static UpdateChannelStateNotification Deserialize(Stream stream, UpdateChannelStateNotification instance, long limit)
 {
     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)
             {
                 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.StateChange == null)
             {
                 instance.StateChange = ChannelState.DeserializeLengthDelimited(stream);
             }
             else
             {
                 ChannelState.DeserializeLengthDelimited(stream, instance.StateChange);
             }
         }
         else if (instance.AgentId == null)
         {
             instance.AgentId = EntityId.DeserializeLengthDelimited(stream);
         }
         else
         {
             EntityId.DeserializeLengthDelimited(stream, instance.AgentId);
         }
     }
     if (stream.Position == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
 public static CreateChannelRequest Deserialize(Stream stream, CreateChannelRequest 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)
                 {
                     if (num2 != 26)
                     {
                         if (num2 != 34)
                         {
                             if (num2 != 40)
                             {
                                 if (num2 != 50)
                                 {
                                     if (num2 != 58)
                                     {
                                         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.LocalMemberState == null)
                                     {
                                         instance.LocalMemberState = MemberState.DeserializeLengthDelimited(stream);
                                     }
                                     else
                                     {
                                         MemberState.DeserializeLengthDelimited(stream, instance.LocalMemberState);
                                     }
                                 }
                                 else if (instance.LocalAgent == null)
                                 {
                                     instance.LocalAgent = EntityId.DeserializeLengthDelimited(stream);
                                 }
                                 else
                                 {
                                     EntityId.DeserializeLengthDelimited(stream, instance.LocalAgent);
                                 }
                             }
                             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.ChannelState == null)
                     {
                         instance.ChannelState = ChannelState.DeserializeLengthDelimited(stream);
                     }
                     else
                     {
                         ChannelState.DeserializeLengthDelimited(stream, instance.ChannelState);
                     }
                 }
                 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.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }