Exemplo n.º 1
0
        public override void Recreate()
        {
            PacketModified.Append(PageId);
            PacketModified.Append(CatalogType);
            PacketModified.Append(LayoutCode);

            Localization.WriteTo(PacketModified);

            PacketModified.Append(Offers.Count);
            foreach (var offer in Offers)
            {
                offer.WriteTo(PacketModified);
            }

            PacketModified.Append(OfferId);
            PacketModified.Append(Unknown1);

            if (FrontPageItems != null)
            {
                PacketModified.Append(FrontPageItems.Count);
                foreach (var item in FrontPageItems)
                {
                    item.WriteTo(PacketModified);
                }
            }
        }
 public override void Recreate()
 {
     PacketModified.Append(PageId);
     PacketModified.Append(ItemId);
     PacketModified.Append(ExtraData);
     PacketModified.Append(Amount);
 }
        public override void Recreate()
        {
            PacketModified.Append(RoomId);
            PacketModified.Append(Name);
            PacketModified.Append(Description);
            PacketModified.Append(DoorMode);
            PacketModified.Append(Password);
            PacketModified.Append(MaxUsers);
            PacketModified.Append(CategoryId);

            PacketModified.Append(Tags.Count);
            foreach (var tag in Tags)
            {
                PacketModified.Append(tag);
            }

            PacketModified.Append(TradeSettings);
            PacketModified.Append(AllowPets);
            PacketModified.Append(AllowPetsEat);
            PacketModified.Append(RoomBlockingEnabled);
            PacketModified.Append(HideWall);
            PacketModified.Append(WallThickness);
            PacketModified.Append(FloorThickness);
            ModerationSettings.WriteTo(PacketModified);
            ChatSettings.WriteTo(PacketModified);
            PacketModified.Append(Unknown0);
        }
Exemplo n.º 4
0
        public override void Recreate()
        {
            PacketModified.Append(Friends.Count);

            foreach (var friend in Friends)
            {
                PacketModified.Append(friend.UserId);
                PacketModified.Append(friend.Username);
                PacketModified.Append(friend.Motto);
                PacketModified.Append(friend.IsOnline);
                PacketModified.Append(friend.Unknown0);
                PacketModified.Append(friend.Unknown1);
                PacketModified.Append(friend.Unknown2);
                PacketModified.Append(friend.Figure);
                PacketModified.Append(friend.LastOnline);
            }

            PacketModified.Append(Others.Count);

            foreach (var other in Others)
            {
                PacketModified.Append(other.UserId);
                PacketModified.Append(other.Username);
                PacketModified.Append(other.Motto);
                PacketModified.Append(other.IsOnline);
                PacketModified.Append(other.Unknown0);
                PacketModified.Append(other.Unknown1);
                PacketModified.Append(other.Unknown2);
                PacketModified.Append(other.Figure);
                PacketModified.Append(other.LastOnline);
            }
        }
        public override void Recreate()
        {
            PacketModified.Append(UserId);
            PacketModified.Append(Username);
            PacketModified.Append(Figure);
            PacketModified.Append(Motto);
            PacketModified.Append(CreationDate);
            PacketModified.Append(AchievementPoints);
            PacketModified.Append(FriendCount);
            PacketModified.Append(IsFriend);
            PacketModified.Append(IsFriendRequestPending);
            PacketModified.Append(IsOnline);
            PacketModified.Append(Groups.Count);

            foreach (var group in Groups)
            {
                PacketModified.Append(group.GroupId);
                PacketModified.Append(group.Name);
                PacketModified.Append(group.Badge);
                PacketModified.Append(group.Colour1);
                PacketModified.Append(group.Colour2);
                PacketModified.Append(group.IsFavourite);
                PacketModified.Append(group.Unknown0);
                PacketModified.Append(group.IsForumEnabled);
            }

            PacketModified.Append(LastOnline);
            PacketModified.Append(ShowProfile);
        }
 public override void Recreate()
 {
     if (Reason.HasValue)
     {
         PacketModified.Append(Reason.Value);
     }
 }
Exemplo n.º 7
0
 public override void Recreate()
 {
     PacketModified.Append(Unknown0);
     PacketModified.Append(Unknown1);
     PacketModified.Append(Unknown2);
     PacketModified.Append(Unknown3);
     PacketModified.Append(Unknown4);
 }
Exemplo n.º 8
0
 public override void Recreate()
 {
     PacketModified.Append(VirtualId);
     PacketModified.Append(Figure);
     PacketModified.Append(Gender);
     PacketModified.Append(Motto);
     PacketModified.Append(AchievementPoints);
 }
Exemplo n.º 9
0
        public override void Recreate()
        {
            PacketModified.Append(Messages.Count);

            foreach (var message in Messages)
            {
                PacketModified.Append(message);
            }
        }
        public override void Recreate()
        {
            PacketModified.Append(AcceptIds.Count);

            foreach (var acceptId in AcceptIds)
            {
                PacketModified.Append(acceptId);
            }
        }
Exemplo n.º 11
0
        public override void Recreate()
        {
            if (!Connection.Session.Navigator.LastCategorySearch.Equals(SearchCode))
            {
                Discard = true;
                return;
            }

            PacketModified.Append(0); // Ignored.
            PacketModified.Append("");

            List <WebRoomData> rooms = null;

            switch (Connection.Session.Navigator.LastCategorySearchType)
            {
            case NavigatorSearchType.MyWorldView:
            case NavigatorSearchType.HotelView:
            case NavigatorSearchType.PromotionHot:
                rooms = SearchResults.FirstOrDefault(x => x.CategoryId.Equals(Connection.Session.Navigator.LastCategorySearchId))?.GuestRooms;
                break;

            case NavigatorSearchType.MyWorldViewHighestScore:
                rooms = SearchResults.SelectMany(x => x.GuestRooms).DistinctBy(x => x.FlatId).OrderByDescending(x => x.Score).ToList();
                break;

            case NavigatorSearchType.HotelViewUserCat:
                rooms = SearchResults
                        .OrderBy(x => StringUtils.DamerauLevenshteinDistance(x.PublicName, Connection.Session.Navigator.LastCategorySearchId, 50))
                        .FirstOrDefault()?
                        .GuestRooms;
                break;

            case NavigatorSearchType.PromotionNew:
                rooms = SearchResults.SelectMany(x => x.GuestRooms).DistinctBy(x => x.FlatId).OrderByDescending(x => x.FlatId).ToList();
                break;

            case NavigatorSearchType.OfficialView:
                rooms = SearchResults.FirstOrDefault()?.GuestRooms;
                break;
            }

            if (rooms == null)
            {
                Discard = true;
                return;
            }

            PacketModified.Append(rooms.Count);

            foreach (var room in rooms)
            {
                room.WriteTo(PacketModified);
            }

            PacketModified.Append(false); // No official room.
        }
        public override void Recreate()
        {
            PacketModified.Append(DeclineAll);
            PacketModified.Append(DeclineIds.Count);

            foreach (var declineId in DeclineIds)
            {
                PacketModified.Append(declineId);
            }
        }
        public override void Recreate()
        {
            PacketModified.Append(Currencies.Count);

            foreach (var(currencyId, currencyValue) in Currencies)
            {
                PacketModified.Append(currencyId);
                PacketModified.Append(currencyValue);
            }
        }
Exemplo n.º 14
0
        public override void Recreate()
        {
            PacketModified.Append(Aliases.Count);

            foreach (var alias in Aliases)
            {
                PacketModified.Append(alias.Item1);
                PacketModified.Append(alias.Item2);
            }
        }
Exemplo n.º 15
0
        public override void Recreate()
        {
            PacketModified.Append(Unknown0);
            PacketModified.Append(Unknown1);

            if (Unknown2.HasValue)
            {
                PacketModified.Append(Unknown2.Value);
            }
        }
Exemplo n.º 16
0
        public override void Recreate()
        {
            PacketModified.Append(Width);
            PacketModified.Append(Entries.Count);

            foreach (var entry in Entries)
            {
                PacketModified.Append(entry);
            }
        }
Exemplo n.º 17
0
        public override void Recreate()
        {
            // HabboAir expects RoomId.
            if (!Connection.Session.Room.LastFlatConnectionRoomId.HasValue)
            {
                throw new ApplicationException($"{Outgoing.OpenConnection.ToString()} was called without an incoming {Incoming.OpenFlatConnection.ToString()} packet beforehand.");
            }

            PacketModified.Append(Connection.Session.Room.LastFlatConnectionRoomId.Value);
        }
Exemplo n.º 18
0
        public override void Recreate()
        {
            PacketModified.Append(Limit);
            PacketModified.Append(FavouriteIds.Count);

            foreach (var id in FavouriteIds)
            {
                PacketModified.Append(id);
            }
        }
        public override void Recreate()
        {
            PacketModified.Append(SenderUserId);
            PacketModified.Append(Message);
            PacketModified.Append(Timestamp);

            if (Unknown0 != null)
            {
                PacketModified.Append(Unknown0);
            }
        }
        public override void Recreate()
        {
            PacketModified.Append(UserId);
            PacketModified.Append(EquippedBadges.Count);

            foreach (var(key, value) in EquippedBadges)
            {
                PacketModified.Append(key);
                PacketModified.Append(value);
            }
        }
Exemplo n.º 21
0
        public override void Recreate()
        {
            PacketModified.Append(Perks.Count);

            foreach (var perk in Perks)
            {
                PacketModified.Append(perk.Code);
                PacketModified.Append(perk.ErrorMessage);
                PacketModified.Append(perk.IsAllowed);
            }
        }
 public override void Recreate()
 {
     PacketModified.Append(Volume1);
     PacketModified.Append(Volume2);
     PacketModified.Append(Volume3);
     PacketModified.Append(ChatPreference);
     PacketModified.Append(InvitesStatus);
     PacketModified.Append(FocusPreference);
     PacketModified.Append(FriendBarState);
     PacketModified.Append(Unknown0);
 }
Exemplo n.º 23
0
 public override void Recreate()
 {
     PacketModified.Append(PageId);
     PacketModified.Append(ItemId);
     PacketModified.Append(ExtraData);
     PacketModified.Append(GiftUser);
     PacketModified.Append(GiftMessage);
     PacketModified.Append(SpriteId);
     PacketModified.Append(Ribbon);
     PacketModified.Append(Colour);
     PacketModified.Append(Unknown0);
 }
        public override void Recreate()
        {
            PacketModified.Append(TotalRequests);
            PacketModified.Append(Requests.Count);

            foreach (var request in Requests)
            {
                PacketModified.Append(request.UserId);
                PacketModified.Append(request.Username);
                PacketModified.Append(request.Figure);
            }
        }
        public override void Recreate()
        {
            PacketModified.Append(FriendsMax);
            PacketModified.Append(Unknown0);
            PacketModified.Append(Unknown1);
            PacketModified.Append(Categories.Count);

            foreach (var category in Categories)
            {
                PacketModified.Append(category.Id);
                PacketModified.Append(category.Name);
            }
        }
Exemplo n.º 26
0
 public override void Recreate()
 {
     PacketModified.Append(Id);
     PacketModified.Append(OwnerId);
     PacketModified.Append(OwnerName);
     PacketModified.Append(Unknown0);
     PacketModified.Append(Unknown1);
     PacketModified.Append(Name);
     PacketModified.Append(Description);
     PacketModified.Append(Unknown2);
     PacketModified.Append(Unknown3);
     PacketModified.Append(Unknown4);
 }
        public override void Recreate()
        {
            PacketModified.Append(Unknown0);
            PacketModified.Append(Unknown1);
            PacketModified.Append(Unknown2);
            PacketModified.Append(Unknown3);
            PacketModified.Append(Unknown4.Count);

            foreach (var unknown in Unknown4)
            {
                PacketModified.Append(unknown);
            }
        }
        public override void Recreate()
        {
            PacketModified.Append(UserId);
            PacketModified.Append(Relationships.Count);

            foreach (var relationship in Relationships)
            {
                PacketModified.Append((int)relationship.Type);
                PacketModified.Append(relationship.Amount);
                PacketModified.Append(relationship.TargetUserId);
                PacketModified.Append(relationship.TargetUsername);
                PacketModified.Append(relationship.TargetFigure);
            }
        }
        public override void Recreate()
        {
            PacketModified.Append(Effects.Count);

            foreach (var effect in Effects)
            {
                PacketModified.Append(effect.SpriteId);
                PacketModified.Append((int)effect.Type);
                PacketModified.Append(effect.Duration);
                PacketModified.Append(effect.Quantity);
                PacketModified.Append(effect.TimeLeft);
                PacketModified.Append(effect.Permanent);
            }
        }
        public override void Recreate()
        {
            PacketModified.Append(Categories.Count);

            foreach (var category in Categories)
            {
                PacketModified.Append(category.Id);
                PacketModified.Append(category.NodeName);
                PacketModified.Append(category.Visible);
                PacketModified.Append(category.Automatic);
                PacketModified.Append(category.Unknown0);
                PacketModified.Append(category.Unknown1);
                PacketModified.Append(category.Unknown2);
            }
        }