public static UnsubscribeToFriendsRequest DeserializeLengthDelimited(Stream stream)
        {
            UnsubscribeToFriendsRequest unsubscribeToFriendsRequest = new UnsubscribeToFriendsRequest();

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

            num += stream.get_Position();
            return(UnsubscribeToFriendsRequest.Deserialize(stream, instance, num));
        }
Exemplo n.º 3
0
        public static UnsubscribeToFriendsRequest DeserializeLengthDelimited(Stream stream, UnsubscribeToFriendsRequest instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(UnsubscribeToFriendsRequest.Deserialize(stream, instance, position));
        }
Exemplo n.º 4
0
 public static UnsubscribeToFriendsRequest Deserialize(Stream stream, UnsubscribeToFriendsRequest 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 void Serialize(Stream stream, UnsubscribeToFriendsRequest instance)
 {
     if (instance.HasAgentId)
     {
         stream.WriteByte(10);
         ProtocolParser.WriteUInt32(stream, instance.AgentId.GetSerializedSize());
         EntityId.Serialize(stream, instance.AgentId);
     }
     if (instance.HasObjectId)
     {
         stream.WriteByte(16);
         ProtocolParser.WriteUInt64(stream, instance.ObjectId);
     }
 }
 public static UnsubscribeToFriendsRequest Deserialize(Stream stream, UnsubscribeToFriendsRequest 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");
 }
Exemplo n.º 7
0
        public override bool Equals(object obj)
        {
            UnsubscribeToFriendsRequest unsubscribeToFriendsRequest = obj as UnsubscribeToFriendsRequest;

            if (unsubscribeToFriendsRequest == null)
            {
                return(false);
            }
            if (this.HasAgentId != unsubscribeToFriendsRequest.HasAgentId || this.HasAgentId && !this.AgentId.Equals(unsubscribeToFriendsRequest.AgentId))
            {
                return(false);
            }
            if (this.HasObjectId == unsubscribeToFriendsRequest.HasObjectId && (!this.HasObjectId || this.ObjectId.Equals(unsubscribeToFriendsRequest.ObjectId)))
            {
                return(true);
            }
            return(false);
        }
 public static UnsubscribeToFriendsRequest Deserialize(Stream stream, UnsubscribeToFriendsRequest instance)
 {
     return(UnsubscribeToFriendsRequest.Deserialize(stream, instance, -1L));
 }
 public void Deserialize(Stream stream)
 {
     UnsubscribeToFriendsRequest.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            UnsubscribeToFriendsRequest unsubscribeToFriendsRequest = obj as UnsubscribeToFriendsRequest;

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