From f4955ff039e5a031a4ecbad659216990b1922acf Mon Sep 17 00:00:00 2001 From: Snaiker Date: Mon, 18 Nov 2024 21:22:27 +0000 Subject: [PATCH] Fix Ignore issue --- sqlupdates/Update 3_5_3 to 3_5_4.sql | 5 ++++- .../eu/habbo/habbohotel/permissions/Permission.java | 1 + .../com/eu/habbo/habbohotel/users/HabboStats.java | 12 ++++-------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sqlupdates/Update 3_5_3 to 3_5_4.sql b/sqlupdates/Update 3_5_3 to 3_5_4.sql index e6b0a748..7789a918 100644 --- a/sqlupdates/Update 3_5_3 to 3_5_4.sql +++ b/sqlupdates/Update 3_5_3 to 3_5_4.sql @@ -1,3 +1,6 @@ --New bot walking settings INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.bot.limit.walking.distance', '1'); -INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.bot.limit.walking.distance.radius', '5'); \ No newline at end of file +INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('hotel.bot.limit.walking.distance.radius', '5'); + +--New permission +ALTER TABLE `permissions` ADD COLUMN `acc_unignorable` ENUM('0','1') NOT NULL DEFAULT '0' AFTER `acc_infinite_friends`; \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java b/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java index 469f9072..242db3fb 100644 --- a/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java +++ b/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java @@ -43,6 +43,7 @@ public class Permission { public static String ACC_HELPER_GIVE_GUIDE_TOURS = "acc_helper_give_guide_tours"; public static String ACC_HELPER_JUDGE_CHAT_REVIEWS = "acc_helper_judge_chat_reviews"; public static String ACC_FLOORPLAN_EDITOR = "acc_floorplan_editor"; + public static String ACC_UNIGNORABLE = "acc_unignorable"; public final String key; public final PermissionSetting setting; public Permission(String key, PermissionSetting setting) { diff --git a/src/main/java/com/eu/habbo/habbohotel/users/HabboStats.java b/src/main/java/com/eu/habbo/habbohotel/users/HabboStats.java index 29ef2a2f..3ce1a653 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/HabboStats.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/HabboStats.java @@ -7,6 +7,7 @@ import com.eu.habbo.habbohotel.achievements.Achievement; import com.eu.habbo.habbohotel.achievements.AchievementManager; import com.eu.habbo.habbohotel.achievements.TalentTrackType; import com.eu.habbo.habbohotel.catalog.CatalogItem; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; import com.eu.habbo.habbohotel.rooms.RoomTrade; import com.eu.habbo.habbohotel.users.cache.HabboOfferPurchase; @@ -741,14 +742,9 @@ public class HabboStats implements Runnable { public boolean ignoreUser(GameClient gameClient, int userId) { final Habbo target = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId); - if (!Emulator.getConfig().getBoolean("hotel.allow.ignore.staffs")) { - final int ownRank = gameClient.getHabbo().getHabboInfo().getRank().getId(); - final int targetRank = target.getHabboInfo().getRank().getId(); - - if (targetRank >= ownRank) { - gameClient.getHabbo().whisper(Emulator.getTexts().getValue("generic.error.ignore_higher_rank"), RoomChatMessageBubbles.ALERT); - return false; - } + if (!Emulator.getConfig().getBoolean("hotel.allow.ignore.staffs") && target.hasPermission(Permission.ACC_UNIGNORABLE)) { + gameClient.getHabbo().whisper(Emulator.getTexts().getValue("generic.error.ignore_higher_rank"), RoomChatMessageBubbles.ALERT); + return false; } if (!this.userIgnored(userId)) {