PlusEMU Sub categories in the catalog

Results 1 to 4 of 4
  1. #1
    Newbie Scurq is offline
    MemberRank
    May 2014 Join Date
    2Posts

    PlusEMU Sub categories in the catalog


    RaGEZONE Recommends

    RaGEZONE Recommends

    Hi!
    I'm pretty new to running Habbo Retros and it's my first time setting up everything. I'm planning to make a very organized and well structured database when it comes to furniture. (Basically catalog_items, catalog_pages and furniture.)
    I ran into a problem when organizing the catalog, though. Habboon's catalog has a very interesting feature, where there are "sub sub categories" as shown in this image:
    Spoiler:

    I've looked at the code in the emulator, but I can't figure out why this won't work on any other hotel. Changing the parent_id to the sub category's id doesn't work.
    If you know how to change the code in CatalogIndexComposer.cs or something similar, please let me know, because this is something everyone should be able to do on their own hotel!


  2. #2
    Death from above! The General is offline
    The OmegaRank
    Aug 2011 Join Date
    8,905Posts

    Re: PlusEMU Sub categories in the catalog

    Its probably because they are not appended recursively in the packet.

    I'm unfamilar with Plus emulator but Arcturus emulator does have this enabled.
    If you are using Arcturus, contact me
    Skype: wesley.jabbo
    Discord: TheGeneral#0063

  3. #3
    Newbie Scurq is offline
    MemberRank
    May 2014 Join Date
    2Posts

    Re: PlusEMU Sub categories in the catalog

    Quote Originally Posted by The General View Post
    Its probably because they are not appended recursively in the packet.

    I'm unfamilar with Plus emulator but Arcturus emulator does have this enabled.
    Unfortunalety, I didn't understand any of that :(

    Maybe it would help if I post my CatalogIndexComposer.cs:
    Spoiler:
    Code:
    • using System.Collections.Generic;
    • using Plus.HabboHotel.Catalog;
    • using Plus.HabboHotel.GameClients;
    • namespace Plus.Communication.Packets.Outgoing.Catalog
    • {
    • public class CatalogIndexComposer : ServerPacket
    • {
    • public CatalogIndexComposer(GameClient Session, ICollection<CatalogPage> Pages, int Sub = 0)
    • : base(ServerPacketHeader.CatalogIndexMessageComposer)
    • {
    • WriteRootIndex(Session, Pages);
    • foreach (CatalogPage Page in Pages)
    • {
    • if (Page.ParentId != -1 || Page.MinimumRank > Session.GetHabbo().Rank || (Page.MinimumVIP > Session.GetHabbo().VIPRank &&Session.GetHabbo().Rank == 1))
    • continue;
    • WritePage(Page, CalcTreeSize(Session, Pages, Page.Id));
    • foreach (CatalogPage child in Pages)
    • {
    • if (child.ParentId != Page.Id || child.MinimumRank > Session.GetHabbo().Rank || (child.MinimumVIP >Session.GetHabbo().VIPRank && Session.GetHabbo().Rank == 1))
    • continue;
    • WritePage(child, CalcTreeSize(Session, Pages, child.Id));
    • foreach (CatalogPage baby in Pages)
    • {
    • if (baby.ParentId != child.Id || baby.MinimumRank > Session.GetHabbo().Rank || (baby.MinimumVIP >Session.GetHabbo().VIPRank && Session.GetHabbo().Rank == 1))
    • continue;
    • WritePage(baby, 0);
    • }
    • }
    • }
    • base.WriteBoolean(false);
    • base.WriteString("NORMAL");
    • }
    • public void WriteRootIndex(GameClient Session, ICollection<CatalogPage> Pages)
    • {
    • base.WriteBoolean(true);
    • base.WriteInteger(0);
    • base.WriteInteger(-1);
    • base.WriteString("root");
    • base.WriteString(string.Empty);
    • base.WriteInteger(0);
    • base.WriteInteger(CalcTreeSize(Session, Pages, -1));
    • }
    • public void WritePage(CatalogPage Page, int TreeSize)
    • {
    • base.WriteBoolean(Page.Visible);
    • base.WriteInteger(Page.Icon);
    • base.WriteInteger(!Page.Enabled ? -1 : Page.Id);
    • base.WriteString(Page.PageLink);
    • base.WriteString(Page.Caption);
    • base.WriteInteger(Page.ItemOffers.Count);
    • foreach (int i in Page.ItemOffers.Keys)
    • {
    • base.WriteInteger(i);
    • }
    • base.WriteInteger(TreeSize);
    • }
    • public int CalcTreeSize(GameClient Session, ICollection<CatalogPage> Pages, int ParentId)
    • {
    • int i = 0;
    • foreach (CatalogPage Page in Pages)
    • {
    • if (Page.MinimumRank > Session.GetHabbo().Rank || (Page.MinimumVIP > Session.GetHabbo().VIPRank && Session.GetHabbo().Rank ==1) || Page.ParentId != ParentId)
    • continue;
    • if (Page.ParentId == ParentId)
    • i++;
    • }
    • return i;
    • }
    • }
    • }


    EDIT: I solved it myself, the problem was that the fifth level of categories was missing entirely from the code. By changing this in the CatalogIndexComposer.cs:
    Code:
    • foreach (CatalogPage SubChild in Pages)
    • {
    • if (SubChild.ParentId != child.Id || SubChild.MinimumRank > Session.GetHabbo().Rank)
    • continue;
    • WritePage(SubChild, 0);
    • }
    to this
    Code:
    • foreach (CatalogPage SubChild in Pages)
    • {
    • if (SubChild.ParentId != child.Id || SubChild.MinimumRank > Session.GetHabbo().Rank)
    • continue;
    • if (SubChild.Enabled)
    • WritePage(SubChild, CalcTreeSize(Session, Pages, SubChild.Id));
    • else
    • WriteNodeIndex(SubChild, CalcTreeSize(Session, Pages, SubChild.Id));
    • foreach (CatalogPage SubSubChild in Pages)
    • {
    • if (SubSubChild.ParentId != SubChild.Id || SubSubChild.MinimumRank > Session.GetHabbo().Rank)
    • continue;
    • WritePage(SubSubChild, 0);
    • }
    it will work!
    Last edited by Scurq; 10-09-17 at 11:07 PM.

  4. #4
    Demi-god. Dominic is offline
    SubscriberRank
    Aug 2012 Join Date
    DenmarkLocation
    571Posts

    Re: PlusEMU Sub categories in the catalog

    Bump, I'm confused about this too?
    As far as I can see my Plus edit already contains triple categorizing?

    https://hastebin.com/ubinoqowic.php



    EDIT:
    Hmm, I seem to have figured out what's causing this.
    @The General - if the mode is NOT normal, then what's the mode?




Advertisement