From 4aabb738a3c8f337219f58ae698d055d0e3a06f8 Mon Sep 17 00:00:00 2001 From: duckietm Date: Wed, 27 May 2026 09:47:30 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=86=99=20Added=20missing=20Table=20fo?= =?UTF-8?q?r=20the=20HK?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../006_Allow_Housekeeping_in_Client.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Database Updates/006_Allow_Housekeeping_in_Client.sql b/Database Updates/006_Allow_Housekeeping_in_Client.sql index 42359fe0..f4d2053e 100644 --- a/Database Updates/006_Allow_Housekeeping_in_Client.sql +++ b/Database Updates/006_Allow_Housekeeping_in_Client.sql @@ -1 +1,17 @@ INSERT INTO `permission_definitions` (`permission_key`, `max_value`, `comment`, `rank_1`, `rank_2`, `rank_3`, `rank_4`, `rank_5`, `rank_6`, `rank_7`) VALUES ('acc_housekeeping', '1', 'Allow housekeeping in the client', '0', '0', '0', '0', '0', '0', '1'); + + +CREATE TABLE IF NOT EXISTS `housekeeping_log` ( + `id` INT NOT NULL AUTO_INCREMENT, + `timestamp` INT NOT NULL, + `actor_id` INT NOT NULL, + `actor_name` VARCHAR(64) NOT NULL DEFAULT '', + `target_type` VARCHAR(16) NOT NULL DEFAULT 'user', + `target_id` INT NOT NULL DEFAULT 0, + `target_label` VARCHAR(128) NOT NULL DEFAULT '', + `action` VARCHAR(64) NOT NULL DEFAULT '', + `detail` VARCHAR(500) NOT NULL DEFAULT '', + `success` TINYINT NOT NULL DEFAULT 1, + PRIMARY KEY (`id`), + KEY `timestamp` (`timestamp`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; \ No newline at end of file From 7b7154e68f376dd82e4159c33d1ff93763949a4c Mon Sep 17 00:00:00 2001 From: duckietm Date: Wed, 27 May 2026 11:34:55 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=86=99=20Fix=20search=20and=20buy=20#?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../catalog/CatalogBuyItemAsGiftEvent.java | 9 +++++++++ .../incoming/catalog/CatalogBuyItemEvent.java | 15 ++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java index def6f210..2a208c2f 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java @@ -175,6 +175,15 @@ public class CatalogBuyItemAsGiftEvent extends MessageHandler { CatalogItem item = page.getCatalogItem(itemId); + if (item == null) { + for (CatalogItem candidate : page.getCatalogItems().valueCollection()) { + if (candidate != null && candidate.getOfferId() == itemId) { + item = candidate; + break; + } + } + } + if (item == null) { LOGGER.debug("catalog item null -> {}", itemId); this.client.sendResponse(new AlertPurchaseFailedComposer(AlertPurchaseFailedComposer.SERVER_ERROR).compose()); diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java index e4aac1b0..c280f758 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java @@ -13,11 +13,7 @@ import com.eu.habbo.habbohotel.users.HabboBadge; import com.eu.habbo.habbohotel.users.HabboInventory; import com.eu.habbo.habbohotel.users.subscriptions.Subscription; import com.eu.habbo.messages.incoming.MessageHandler; -import com.eu.habbo.messages.outgoing.catalog.AlertPurchaseFailedComposer; -import com.eu.habbo.messages.outgoing.catalog.AlertPurchaseUnavailableComposer; -import com.eu.habbo.messages.outgoing.catalog.BuildersClubFurniCountComposer; -import com.eu.habbo.messages.outgoing.catalog.BuildersClubSubscriptionStatusComposer; -import com.eu.habbo.messages.outgoing.catalog.PurchaseOKComposer; +import com.eu.habbo.messages.outgoing.catalog.*; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys; import com.eu.habbo.messages.outgoing.generic.alerts.HotelWillCloseInMinutesComposer; @@ -201,6 +197,15 @@ public class CatalogBuyItemEvent extends MessageHandler { else item = page.getCatalogItem(itemId); + + if (item == null && !(page instanceof RecentPurchasesLayout)) { + for (CatalogItem candidate : page.getCatalogItems().valueCollection()) { + if (candidate != null && candidate.getOfferId() == itemId) { + item = candidate; + break; + } + } + } // temp patch, can a dev with better knowledge than me look into this asap pls. if (page instanceof BotsLayout) { if (!this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_BOTS) && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) { From 539c5b5b96338ddf87aed1664d089898d8978f40 Mon Sep 17 00:00:00 2001 From: duckietm Date: Wed, 27 May 2026 13:46:17 +0200 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=86=99=20Fix=20BOTS=20in=20catalog=20?= =?UTF-8?q?and=20inventory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/eu/habbo/habbohotel/items/Item.java | 6 +++++ .../incoming/catalog/CatalogBuyItemEvent.java | 27 ++++++++++++++----- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java index 0ca0afbe..323f9758 100644 --- a/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java +++ b/Emulator/src/main/java/com/eu/habbo/habbohotel/items/Item.java @@ -48,6 +48,12 @@ public class Item implements ISerialize { return item.getName().toLowerCase().startsWith("a0 pet"); } + public static boolean isBot(Item item) { + if (item == null) return false; + String name = item.getName(); + return name != null && (name.startsWith("bot_") || name.startsWith("rentable_bot_")); + } + public static double getCurrentHeight(HabboItem item) { if (item instanceof InteractionMultiHeight && item.getBaseItem().getMultiHeights().length > 0) { if (item.getExtradata().isEmpty()) { diff --git a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java index c280f758..e948a5eb 100644 --- a/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java +++ b/Emulator/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java @@ -5,6 +5,7 @@ import com.eu.habbo.habbohotel.bots.BotManager; import com.eu.habbo.habbohotel.catalog.*; import com.eu.habbo.habbohotel.catalog.layouts.*; import com.eu.habbo.habbohotel.items.FurnitureType; +import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.pets.PetManager; import com.eu.habbo.habbohotel.rooms.BuildersClubRoomSupport; @@ -206,15 +207,27 @@ public class CatalogBuyItemEvent extends MessageHandler { } } } - // temp patch, can a dev with better knowledge than me look into this asap pls. - if (page instanceof BotsLayout) { - if (!this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_BOTS) && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) { - this.client.getHabbo().alert(Emulator.getTexts().getValue("error.bots.max.inventory").replace("%amount%", BotManager.MAXIMUM_BOT_INVENTORY_SIZE + "")); - return; + + boolean itemHasBot = false; + boolean itemHasPet = false; + + if (item != null) { + for (Item baseItem : item.getBaseItems()) { + if (baseItem == null) continue; + if (Item.isBot(baseItem)) itemHasBot = true; + if (Item.isPet(baseItem)) itemHasPet = true; } } - if (page instanceof PetsLayout) { - if (!this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_PETS) && this.client.getHabbo().getInventory().getPetsComponent().getPets().size() >= PetManager.MAXIMUM_PET_INVENTORY_SIZE) { + + if (itemHasBot && !this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_BOTS) + && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) { + this.client.getHabbo().alert(Emulator.getTexts().getValue("error.bots.max.inventory").replace("%amount%", BotManager.MAXIMUM_BOT_INVENTORY_SIZE + "")); + return; + } + + if (itemHasPet) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_PETS) + && this.client.getHabbo().getInventory().getPetsComponent().getPets().size() >= PetManager.MAXIMUM_PET_INVENTORY_SIZE) { this.client.getHabbo().alert(Emulator.getTexts().getValue("error.pets.max.inventory").replace("%amount%", PetManager.MAXIMUM_PET_INVENTORY_SIZE + "")); return; }