From d2fc1d6827d56acf17f1953d16e6ae4b898eb64b Mon Sep 17 00:00:00 2001 From: ArpyAge Date: Sat, 22 Jan 2022 02:51:57 +0100 Subject: [PATCH] Offer ID fix for catalog page highlights --- .../messages/incoming/catalog/RequestCatalogPageEvent.java | 4 ++-- .../messages/outgoing/catalog/CatalogPageComposer.java | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/eu/habbo/messages/incoming/catalog/RequestCatalogPageEvent.java b/src/main/java/com/eu/habbo/messages/incoming/catalog/RequestCatalogPageEvent.java index 2e0f73c5..0198c01e 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/catalog/RequestCatalogPageEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/catalog/RequestCatalogPageEvent.java @@ -11,14 +11,14 @@ public class RequestCatalogPageEvent extends MessageHandler { @Override public void handle() throws Exception { int catalogPageId = this.packet.readInt(); - int unknown = this.packet.readInt(); + int offerId = this.packet.readInt(); String mode = this.packet.readString(); CatalogPage page = Emulator.getGameEnvironment().getCatalogManager().catalogPages.get(catalogPageId); if (catalogPageId > 0 && page != null) { if (page.getRank() <= this.client.getHabbo().getHabboInfo().getRank().getId() && page.isEnabled()) { - this.client.sendResponse(new CatalogPageComposer(page, this.client.getHabbo(), mode)); + this.client.sendResponse(new CatalogPageComposer(page, this.client.getHabbo(), offerId, mode)); } else { if (!page.isVisible()) { ScripterManager.scripterDetected(this.client, Emulator.getTexts().getValue("scripter.warning.catalog.page").replace("%username%", this.client.getHabbo().getHabboInfo().getUsername()).replace("%pagename%", page.getCaption())); diff --git a/src/main/java/com/eu/habbo/messages/outgoing/catalog/CatalogPageComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/catalog/CatalogPageComposer.java index 9c0c682f..d1ba4480 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/catalog/CatalogPageComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/catalog/CatalogPageComposer.java @@ -20,11 +20,13 @@ import java.util.Map; public class CatalogPageComposer extends MessageComposer { private final CatalogPage page; private final Habbo habbo; + private final int offerId; private final String mode; - public CatalogPageComposer(CatalogPage page, Habbo habbo, String mode) { + public CatalogPageComposer(CatalogPage page, Habbo habbo, int offerId, String mode) { this.page = page; this.habbo = habbo; + this.offerId = offerId; this.mode = mode; } @@ -49,7 +51,7 @@ public class CatalogPageComposer extends MessageComposer { item.serialize(this.response); } } - this.response.appendInt(0); + this.response.appendInt(offerId); this.response.appendBoolean(false); //acceptSeasonCurrencyAsCredits if (this.page instanceof FrontPageFeaturedLayout || this.page instanceof FrontpageLayout) {