Beispiel #1
0
        public static SubscribeToFriendsRequest DeserializeLengthDelimited(Stream stream, SubscribeToFriendsRequest instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(SubscribeToFriendsRequest.Deserialize(stream, instance, position));
        }
Beispiel #2
0
        public static SubscribeToFriendsRequest DeserializeLengthDelimited(Stream stream)
        {
            SubscribeToFriendsRequest subscribeToFriendsRequest = new SubscribeToFriendsRequest();

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

            num += stream.get_Position();
            return(SubscribeToFriendsRequest.Deserialize(stream, instance, num));
        }
Beispiel #4
0
 public static void Serialize(Stream stream, SubscribeToFriendsRequest instance)
 {
     if (instance.HasAgentId)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize());
         EntityId.Serialize(stream, instance.AgentId);
     }
     stream.WriteByte(16);
     ProtocolParser.WriteUInt64(stream, instance.ObjectId);
 }
Beispiel #5
0
 public static SubscribeToFriendsRequest Deserialize(Stream stream, SubscribeToFriendsRequest 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 (num == 16)
                 {
                     instance.ObjectId = ProtocolParser.ReadUInt64(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 (instance.AgentId != null)
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.AgentId);
             }
             else
             {
                 instance.AgentId = EntityId.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
 public static SubscribeToFriendsRequest Deserialize(Stream stream, SubscribeToFriendsRequest 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)
                 {
                     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.ObjectId = ProtocolParser.ReadUInt64(stream);
                 }
             }
             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");
 }
Beispiel #7
0
        public override bool Equals(object obj)
        {
            SubscribeToFriendsRequest subscribeToFriendsRequest = obj as SubscribeToFriendsRequest;

            if (subscribeToFriendsRequest == null)
            {
                return(false);
            }
            if (this.HasAgentId != subscribeToFriendsRequest.HasAgentId || this.HasAgentId && !this.AgentId.Equals(subscribeToFriendsRequest.AgentId))
            {
                return(false);
            }
            if (!this.ObjectId.Equals(subscribeToFriendsRequest.ObjectId))
            {
                return(false);
            }
            return(true);
        }
Beispiel #8
0
 public static SubscribeToFriendsRequest Deserialize(Stream stream, SubscribeToFriendsRequest instance)
 {
     return(SubscribeToFriendsRequest.Deserialize(stream, instance, (long)-1));
 }
Beispiel #9
0
 public void Deserialize(Stream stream)
 {
     SubscribeToFriendsRequest.Deserialize(stream, this);
 }
Beispiel #10
0
        public override bool Equals(object obj)
        {
            SubscribeToFriendsRequest subscribeToFriendsRequest = obj as SubscribeToFriendsRequest;

            return(subscribeToFriendsRequest != null && this.HasAgentId == subscribeToFriendsRequest.HasAgentId && (!this.HasAgentId || this.AgentId.Equals(subscribeToFriendsRequest.AgentId)) && this.ObjectId.Equals(subscribeToFriendsRequest.ObjectId));
        }