Offer ID fix for catalog page highlights

This commit is contained in:
ArpyAge 2022-01-22 02:51:57 +01:00
parent 20120ea6bb
commit d2fc1d6827
2 changed files with 6 additions and 4 deletions

View File

@ -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()));

View File

@ -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) {