[PlusEMU] Catalog Issue

Core

Member
Nov 10, 2016
356
138
I have mimicked Habbo's catalog completely but I am having an issue with tab items. They seem to be indented even when they're not sub categories. Any help is greatly appreciated.

Here is what is does look like
b916f0ff0af848199fa15c05144cf562.png


This is what is does look like
1dc6e4fbfd80452babd0ef57008853a7.png
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,198
3,914
Can you show us your CatalogIndexComposer and dump/screenshot a couple rows from catalog_pages?

Cheers.
 
Also, could you paste in your external_variables & override variables.
 

Core

Member
Nov 10, 2016
356
138
Can you show us your CatalogIndexComposer and dump/screenshot a couple rows from catalog_pages?

Cheers.
 
Also, could you paste in your external_variables & override variables.

I have just noticed the issue myself for the indent! It's caused due to hierarchy :p I set it to false by accident when I was trying to enable the game center icon x'D! I feel retarded! However, the catalog tabs (other than the Front Page and Furniture) don't work. Any ideas on that?

Thanks in advance!

Catalog_pages
ca2c8166cb3e4e6bb5db57a988a76b2d.png


CatalogIndexComposer
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 || Page.MinimumRank > Session.GetHabbo().Rank || (Page.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 || Page.MinimumRank > Session.GetHabbo().Rank || (Page.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.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;
        }
    }
}

External Override variables;
Code:
seasonalcurrencyindicator.currency=103
seasonalcurrencyindicator.enabled=true
seasonalcurrencyindicator.page=diamonds

ads.domain=
roomenterad.habblet.enabled=false

diamonds.enabled=true
camera.enabled=false
builders.club.enabled=false
toolbar.stories.enabled=true

supersaverads.video.promo.development.mode=false
supersaverads.video.promo.enabled=false

offers.enabled=false
offers.sponsorpay.appid=0
offers.supersonic.enabled=false

avatareditor.promohabbos=http://localhost/game/gamedata/habblet/xml/promo_habbos.xml

game.center.default_game=basejump
game.center.enabled=true
game.center.promoted_game=basejump

embed.showInRoomInfo=true
sms.identity.verification.button.enabled=false
sms.identity.verification.enabled=false

multi.item.trading.enabled=true

disabled.custom.chat.styles=1,2,8,18,23,28,30,31,32,33,34,35

flash.dynamic.download.name.template=%typeid%.swf
flash.dynamic.download.url=http://localhost/game/dcr/hof_furni/
flash.dynamic.avatar.download.configuration=http://localhost/game/gamedata/figuremap.xml
group.badge.url=http://localhost/game/habbo-imaging/badge/%imagerdata%.gif

habbopages.url=http://localhost/game/gamedata/habbopages/

flash.client.url=http://localhost/game/gordon/PRODUCTION-201512170847-152005991/
external.texts.txt=http://localhost/game/gamedata/external_flash_texts/b7eb1d2844054a29476048a94e72a842be2d7822
external.override.texts.txt=http://localhost/game/gamedata/override/external_flash_override_texts/ccc12168e0117bbe34725223b194b0258beb10b2
external.override.variables.txt=http://localhost/game/gamedata/override/external_override_variables/da39a3ee5e6b4b0d3255bfef95601890afd80709
productdata.load.url=http://localhost/game/gamedata/productdata/29b96ba4eb25409c91c0ab725608a1add02e27fd
furnidata.load.url=http://localhost/game/gamedata/furnidata_xml/1af7ee31d9bfd314459f765ed457d7150e9724d1

External Variables
Code:
http://pastebin.com/raw/4n3Z8CiY
 
Last edited:

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,198
3,914
From what I've seen, root/parent categories (tabs at the top) need to be -1 for their parent category & have a page relation/link set.

Sub/child categories need to have a negative parent ID to be clickable (at-least for me), unless there is something missing haven't been able to work it out fully.

Ancestor (proceeding from child) categories can be a positive ID. Hope that makes sense, again this might be different for you - not sure.
 

Core

Member
Nov 10, 2016
356
138
From what I've seen, root/parent categories (tabs at the top) need to be -1 for their parent category & have a page relation/link set.

Sub/child categories need to have a negative parent ID to be clickable (at-least for me), unless there is something missing haven't been able to work it out fully.

Ancestor (proceeding from child) categories can be a positive ID. Hope that makes sense, again this might be different for you - not sure.
Yeah it makes sense, they are negative values (as here is my actual CatalogIndexComposer)

Code:
using System.Collections.Generic;
using Plus.HabboHotel.Catalog;
using Plus.HabboHotel.GameClients;
using Plus.HabboHotel.Users;

namespace Plus.Communication.Packets.Outgoing.Catalog
{
    public class CatalogIndexComposer : ServerPacket
    {
        public CatalogIndexComposer(GameClient Session, string Mode)
            : base(ServerPacketHeader.CatalogIndexMessageComposer)
        {
            NodeData(new CatalogPage(Mode == "NORMAL" ? -1 : -2), Session.GetHabbo());

            base.WriteBoolean(false); //show new items?
            base.WriteString(Mode);
        }

        public void NodeData(CatalogPage Page, Habbo Habbo)
        {
            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);
            }

            List<CatalogPage> Subs = PlusEnvironment.GetGame().GetCatalog().getPagesForHabbo(Page.Id, Habbo);

            base.WriteInteger(Subs.Count);
            foreach(CatalogPage Sub in Subs)
            {
                NodeData(Sub, Habbo);
            }
        }

    }
}


I was using the other one to see if I messed it up. Here is the table for parent elements ( ).
The public_id is the id which Habbo outputs in CatalogIndexComposer
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,198
3,914
PHP:
base.WriteInteger(Page.Enabled ? -1 : Page.Id);

I think this is your issue, it needs to match up with the ID. From what I can tell (I think) if the page is enabled it'll just show as -1 for each page? Rather than the ID it should show.

Hope that makes sense, not infront of a source atm.
 

Core

Member
Nov 10, 2016
356
138
PHP:
base.WriteInteger(Page.Enabled ? -1 : Page.Id);

I think this is your issue, it needs to match up with the ID. From what I can tell (I think) if the page is enabled it'll just show as -1 for each page? Rather than the ID it should show.

Hope that makes sense, not infront of a source atm.
Yeah just figured that out when I tested it xD that source was just wrote then as replaced file with one from your emu before and had to do it again! That was a silly mistake on my part but issue is still present. You have a really good eye for things ngl :p
 
The other tabs still don't work, same place as before xP
889fdbeb31ee4033b699368509a25962.png
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,198
3,914
Another thing (not sure if you are actually doing this already just hidden) I'm not sure if you're writing the root?

E.g. just a blank entry that loads first before all pages.

PHP:
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));
 

Core

Member
Nov 10, 2016
356
138
Another thing (not sure if you are actually doing this already just hidden) I'm not sure if you're writing the root?

E.g. just a blank entry that loads first before all pages.

PHP:
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));

Yeah the root is correct, I just modified the CatalogPage class :p
- my catalog_pages


cd1b578b925f43148a5c9bf16ed8936e.png
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,198
3,914
Yeah the root is correct, I just modified the CatalogPage class :p
- my catalog_pages


cd1b578b925f43148a5c9bf16ed8936e.png

Ooh, I see. Have you tried debugging and adding some breakpoints to see if those results do show?
 
When I get home, if you're still having this issue I'll test with your pages.
 

Core

Member
Nov 10, 2016
356
138
Ooh, I see. Have you tried debugging and adding some breakpoints to see if those results do show?
 
When I get home, if you're still having this issue I'll test with your pages.

Yeah it's all correct in terms of the way the emulator reads the catalog tree it just doesn't parse correctly.
If you put the "Clothing", "Pets" and "Memberships" categories in the "Furniture" sub category then they work fine;


It really has baffled me xD
 
Oh damn I am dumb!
I have fixed it ty sledmore <3
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,198
3,914
Yeah it's all correct in terms of the way the emulator reads the catalog tree it just doesn't parse correctly.
If you put the "Clothing", "Pets" and "Memberships" categories in the "Furniture" sub category then they work fine;


It really has baffled me xD
 
Oh damn I am dumb!
I have fixed it ty sledmore <3

Good to hear, what was the issue?
 

Core

Member
Nov 10, 2016
356
138
Good to hear, what was the issue?
It was the page link, like you said!
I didn't see your message though ;P - only found after reading through.
It's weird though as Habbo doesn't use any page links? But thanks xD!

Oh and would you happen to know how to enable gamecenter?
As from what I can see it's still in the Habbo.swf but changing external variables doesn't seem to work.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,198
3,914
It was the page link, like you said!
I didn't see your message though ;P - only found after reading through.
It's weird though as Habbo doesn't use any page links? But thanks xD!

Oh and would you happen to know how to enable gamecenter?
As from what I can see it's still in the Habbo.swf but changing external variables doesn't seem to work.

Habbo do, on all pages (I believe), especially the top tabs though. It's for the hyperlinks in the catalog and hotel view buttons too. If you have a packet structure I can point out which bit it is (but most of your pages seem to have a pagelink, other than 1-13).

I'll have to check when I get home for that, I'll PM you. If I remember rightly... two files one is something about the bottombar and the other I can't 100% remember, but you change a boolean to true & ctrl + f for elisa_habbo_stories (or something like that) and change it to 'basejump'.

Again, once I'm home I can get you my notes I wrote a while ago.
 

Core

Member
Nov 10, 2016
356
138
Habbo do, on all pages (I believe), especially the top tabs though. It's for the hyperlinks in the catalog and hotel view buttons too. If you have a packet structure I can point out which bit it is (but most of your pages seem to have a pagelink, other than 1-13).

I'll have to check when I get home for that, I'll PM you. If I remember rightly... two files one is something about the bottombar and the other I can't 100% remember, but you change a boolean to true & ctrl + f for elisa_habbo_stories (or something like that) and change it to 'basejump'.

Again, once I'm home I can get you my notes I wrote a while ago.

Oh yeah, once again! You're right! xD
It was just a logical error with my catalog ripper;
ed1195ed07c34a628589f0d978dd583f.png


and thanks :p
 

Users who are viewing this thread

Top