Esempio n. 1
0
        public static UpdateFriendStateNotification DeserializeLengthDelimited(Stream stream, UpdateFriendStateNotification instance)
        {
            long position = (long)ProtocolParser.ReadUInt32(stream);

            position += stream.Position;
            return(UpdateFriendStateNotification.Deserialize(stream, instance, position));
        }
Esempio n. 2
0
        public static UpdateFriendStateNotification DeserializeLengthDelimited(Stream stream)
        {
            UpdateFriendStateNotification updateFriendStateNotification = new UpdateFriendStateNotification();

            UpdateFriendStateNotification.DeserializeLengthDelimited(stream, updateFriendStateNotification);
            return(updateFriendStateNotification);
        }
Esempio n. 3
0
        public static UpdateFriendStateNotification DeserializeLengthDelimited(Stream stream, UpdateFriendStateNotification instance)
        {
            long num = (long)((ulong)ProtocolParser.ReadUInt32(stream));

            num += stream.get_Position();
            return(UpdateFriendStateNotification.Deserialize(stream, instance, num));
        }
Esempio n. 4
0
 public static UpdateFriendStateNotification Deserialize(Stream stream, UpdateFriendStateNotification 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.ChangedFriend != null)
                 {
                     Friend.DeserializeLengthDelimited(stream, instance.ChangedFriend);
                 }
                 else
                 {
                     instance.ChangedFriend = Friend.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.GameAccountId != null)
             {
                 EntityId.DeserializeLengthDelimited(stream, instance.GameAccountId);
             }
             else
             {
                 instance.GameAccountId = EntityId.DeserializeLengthDelimited(stream);
             }
         }
         else
         {
             if (stream.Position != limit)
             {
                 throw new ProtocolBufferException("Read past max limit");
             }
             break;
         }
     }
     return(instance);
 }
Esempio n. 5
0
 public static UpdateFriendStateNotification Deserialize(Stream stream, UpdateFriendStateNotification 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.GameAccountId == null)
                 {
                     instance.GameAccountId = EntityId.DeserializeLengthDelimited(stream);
                 }
                 else
                 {
                     EntityId.DeserializeLengthDelimited(stream, instance.GameAccountId);
                 }
             }
             else if (instance.ChangedFriend == null)
             {
                 instance.ChangedFriend = Friend.DeserializeLengthDelimited(stream);
             }
             else
             {
                 Friend.DeserializeLengthDelimited(stream, instance.ChangedFriend);
             }
         }
     }
     if (stream.get_Position() == limit)
     {
         return(instance);
     }
     throw new ProtocolBufferException("Read past max limit");
 }
Esempio n. 6
0
 public static void Serialize(Stream stream, UpdateFriendStateNotification instance)
 {
     if (instance.ChangedFriend == null)
     {
         throw new ArgumentNullException("ChangedFriend", "Required by proto specification.");
     }
     stream.WriteByte(10);
     ProtocolParser.WriteUInt32(stream, instance.ChangedFriend.GetSerializedSize());
     Friend.Serialize(stream, instance.ChangedFriend);
     if (instance.HasGameAccountId)
     {
         stream.WriteByte(18);
         ProtocolParser.WriteUInt32(stream, instance.GameAccountId.GetSerializedSize());
         EntityId.Serialize(stream, instance.GameAccountId);
     }
 }
Esempio n. 7
0
        public override bool Equals(object obj)
        {
            UpdateFriendStateNotification updateFriendStateNotification = obj as UpdateFriendStateNotification;

            if (updateFriendStateNotification == null)
            {
                return(false);
            }
            if (!this.ChangedFriend.Equals(updateFriendStateNotification.ChangedFriend))
            {
                return(false);
            }
            if (this.HasGameAccountId == updateFriendStateNotification.HasGameAccountId && (!this.HasGameAccountId || this.GameAccountId.Equals(updateFriendStateNotification.GameAccountId)))
            {
                return(true);
            }
            return(false);
        }
Esempio n. 8
0
 public static UpdateFriendStateNotification Deserialize(Stream stream, UpdateFriendStateNotification instance)
 {
     return(UpdateFriendStateNotification.Deserialize(stream, instance, (long)-1));
 }
Esempio n. 9
0
 public void Deserialize(Stream stream)
 {
     UpdateFriendStateNotification.Deserialize(stream, this);
 }
        public override bool Equals(object obj)
        {
            UpdateFriendStateNotification updateFriendStateNotification = obj as UpdateFriendStateNotification;

            return(updateFriendStateNotification != null && this.ChangedFriend.Equals(updateFriendStateNotification.ChangedFriend) && this.HasGameAccountId == updateFriendStateNotification.HasGameAccountId && (!this.HasGameAccountId || this.GameAccountId.Equals(updateFriendStateNotification.GameAccountId)));
        }