From 1db6571db6498d669d295a2f8578a4c50ef82232 Mon Sep 17 00:00:00 2001 From: harmonic Date: Thu, 4 Jun 2020 16:52:04 +0100 Subject: [PATCH 1/6] Runs the flood protection everytime someone talks, as well as via the room cycle, fixing a tanji exploit. --- .../java/com/eu/habbo/habbohotel/rooms/Room.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index 10484daf..dfa02ad9 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -3040,6 +3040,20 @@ public class Room implements Comparable, ISerialize, Runnable { if (habbo.getHabboInfo().getCurrentRoom() != this) return; + if (!habbo.hasPermission(Permission.ACC_CHAT_NO_FLOOD) && habbo.getHabboStats().chatCounter > 0) { + int chatCounter = habbo.getHabboStats().chatCounter - 1; + + if (chatCounter > 3 && !this.hasRights(habbo)) { + if (this.chatProtection == 0) { + this.floodMuteHabbo(habbo, 30); + } else if (this.chatProtection == 1 && chatCounter > 4) { + this.floodMuteHabbo(habbo, 30); + } else if (this.chatProtection == 2 && chatCounter > 5) { + this.floodMuteHabbo(habbo, 30); + } + } + } + long millis = System.currentTimeMillis(); if (HABBO_CHAT_DELAY) { if (millis - habbo.getHabboStats().lastChat < 750) { From 6cb39c232f0ba1e0a20645046a1b6d8becdadea0 Mon Sep 17 00:00:00 2001 From: harmonic Date: Thu, 4 Jun 2020 20:01:44 +0100 Subject: [PATCH 2/6] Added it so that when a roller rolls you off of an object it counts as OnWalkOff, allowing it to be used in conjunction with the Wired Trigger: User walks off furni. (LIKE HABBO) --- .../rooms/users/RoomUnitOnRollerComposer.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitOnRollerComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitOnRollerComposer.java index 856e7a69..863792d7 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitOnRollerComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/rooms/users/RoomUnitOnRollerComposer.java @@ -9,8 +9,11 @@ import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class RoomUnitOnRollerComposer extends MessageComposer { + private static final Logger LOGGER = LoggerFactory.getLogger(RoomUnitOnRollerComposer.class); private final RoomUnit roomUnit; private final HabboItem roller; private final RoomTile oldLocation; @@ -18,6 +21,8 @@ public class RoomUnitOnRollerComposer extends MessageComposer { private final RoomTile newLocation; private final double newZ; private final Room room; + private int x; + private int y; public RoomUnitOnRollerComposer(RoomUnit roomUnit, HabboItem roller, RoomTile oldLocation, double oldZ, RoomTile newLocation, double newZ, Room room) { this.roomUnit = roomUnit; @@ -58,14 +63,23 @@ public class RoomUnitOnRollerComposer extends MessageComposer { if (this.roller != null && room.getLayout() != null) { RoomTile rollerTile = room.getLayout().getTile(this.roller.getX(), this.roller.getY()); - + HabboItem topItem = this.room.getTopItemAt(this.roomUnit.getCurrentLocation().x, this.roomUnit.getCurrentLocation().y); + if (topItem != null) { + try { + topItem.onWalkOff(this.roomUnit, this.room, new Object[]{this}); + } catch (Exception e) { + LOGGER.error("Caught exception", e); + } + } Emulator.getThreading().run(() -> { if (RoomUnitOnRollerComposer.this.oldLocation == rollerTile && RoomUnitOnRollerComposer.this.roomUnit.getGoal() == rollerTile) { RoomUnitOnRollerComposer.this.roomUnit.setLocation(room.getLayout().getTile(newLocation.x, newLocation.y)); RoomUnitOnRollerComposer.this.roomUnit.setPreviousLocationZ(RoomUnitOnRollerComposer.this.newLocation.getStackHeight()); RoomUnitOnRollerComposer.this.roomUnit.setZ(RoomUnitOnRollerComposer.this.newLocation.getStackHeight()); RoomUnitOnRollerComposer.this.roomUnit.sitUpdate = true; + } + }, this.room.getRollerSpeed() == 0 ? 250 : InteractionRoller.DELAY); } else { this.roomUnit.setLocation(this.newLocation); From ec41fdc73f74d76607722968edc4bd359529ed83 Mon Sep 17 00:00:00 2001 From: harmonic Date: Thu, 4 Jun 2020 20:53:39 +0100 Subject: [PATCH 3/6] Fixes Issue 656 --- .../habbo/messages/incoming/rooms/items/PostItDeleteEvent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItDeleteEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItDeleteEvent.java index 4b5c26f6..821f92c8 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItDeleteEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/PostItDeleteEvent.java @@ -3,6 +3,7 @@ package com.eu.habbo.messages.incoming.rooms.items; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.items.interactions.InteractionExternalImage; import com.eu.habbo.habbohotel.items.interactions.InteractionPostIt; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.incoming.MessageHandler; @@ -22,7 +23,7 @@ public class PostItDeleteEvent extends MessageHandler { HabboItem item = room.getHabboItem(itemId); if (item instanceof InteractionPostIt || item instanceof InteractionExternalImage) { - if (item.getUserId() == this.client.getHabbo().getHabboInfo().getId() || room.isOwner(this.client.getHabbo())) { + if (item.getUserId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) { item.setRoomId(0); room.removeHabboItem(item); room.sendComposer(new RemoveWallItemComposer(item).compose()); From de1b59acabb09563ec1b56387355d541fda5a78d Mon Sep 17 00:00:00 2001 From: Harmonic Date: Fri, 5 Jun 2020 04:06:48 -0400 Subject: [PATCH 4/6] Fixes users being sent into an endless loop in various edge cases when it tries to teleport them to a tile they're already on. Now it won't bother. --- .../interactions/wired/effects/WiredEffectTeleport.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTeleport.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTeleport.java index 965ed802..ebd7254a 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTeleport.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectTeleport.java @@ -47,14 +47,20 @@ public class WiredEffectTeleport extends InteractionWiredEffect { Room room = roomUnit.getRoom(); - if (room == null) + if (room == null) { return; + } // makes a temporary effect + roomUnit.getRoom().unIdle(roomUnit.getRoom().getHabbo(roomUnit)); room.sendComposer(new RoomUserEffectComposer(roomUnit, 4).compose()); Emulator.getThreading().run(new SendRoomUnitEffectComposer(room, roomUnit), WiredHandler.TELEPORT_DELAY + 1000); + if (tile == roomUnit.getCurrentLocation()) { + return; + } + if (tile.state == RoomTileState.INVALID || tile.state == RoomTileState.BLOCKED) { RoomTile alternativeTile = null; List optionalTiles = room.getLayout().getTilesAround(tile); @@ -146,6 +152,7 @@ public class WiredEffectTeleport extends InteractionWiredEffect { if (!this.items.isEmpty()) { int i = Emulator.getRandom().nextInt(this.items.size()); HabboItem item = this.items.get(i); + teleportUnitToTile(roomUnit, room.getLayout().getTile(item.getX(), item.getY())); return true; } From ed6dab3da9eaf37bdd302e8e54cf53d2a1261eaa Mon Sep 17 00:00:00 2001 From: Harmonic Date: Fri, 5 Jun 2020 04:10:49 -0400 Subject: [PATCH 5/6] Fix Room Bundle currency updating. Before: The currency was taken when purchasing a room bundle, however it did not send a composer window to update the client, also it still took the currency even if a user had maxiumum rooms, meaning that the user was charged even if they didn't get the room! --- .../incoming/catalog/CatalogBuyItemEvent.java | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java index a20ea1b8..b901e1ad 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java @@ -7,6 +7,7 @@ import com.eu.habbo.habbohotel.catalog.CatalogPage; import com.eu.habbo.habbohotel.catalog.ClubOffer; import com.eu.habbo.habbohotel.catalog.layouts.*; import com.eu.habbo.habbohotel.items.FurnitureType; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.HabboBadge; import com.eu.habbo.habbohotel.users.HabboInventory; import com.eu.habbo.messages.incoming.MessageHandler; @@ -17,6 +18,7 @@ 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; import com.eu.habbo.messages.outgoing.inventory.InventoryRefreshComposer; +import com.eu.habbo.messages.outgoing.navigator.CanCreateRoomComposer; import com.eu.habbo.messages.outgoing.users.*; import com.eu.habbo.threading.runnables.ShutdownEmulator; import gnu.trove.map.hash.THashMap; @@ -80,22 +82,29 @@ public class CatalogBuyItemEvent extends MessageHandler { } }); - if (item[0] == null || item[0].getCredits() > this.client.getHabbo().getHabboInfo().getCredits() || item[0].getPoints() > this.client.getHabbo().getHabboInfo().getCurrencyAmount(item[0].getPointsType())) { + CatalogItem roomBundleItem = item[0]; + if (roomBundleItem == null || roomBundleItem.getCredits() > this.client.getHabbo().getHabboInfo().getCredits() || roomBundleItem.getPoints() > this.client.getHabbo().getHabboInfo().getCurrencyAmount(roomBundleItem.getPointsType())) { this.client.sendResponse(new AlertPurchaseFailedComposer(AlertPurchaseFailedComposer.SERVER_ERROR)); return; } + int roomCount = Emulator.getGameEnvironment().getRoomManager().getRoomsForHabbo(this.client.getHabbo()).size(); + int maxRooms = this.client.getHabbo().getHabboStats().hasActiveClub() ? Emulator.getConfig().getInt("hotel.max.rooms.vip") : Emulator.getConfig().getInt("hotel.max.rooms.user"); - ((RoomBundleLayout) page).buyRoom(this.client.getHabbo()); - - if (!this.client.getHabbo().hasPermission("acc_infinite_credits")) { - this.client.getHabbo().getHabboInfo().addCredits(-item[0].getCredits()); + if (roomCount >= maxRooms) { // checks if a user has the maximum rooms + this.client.sendResponse(new CanCreateRoomComposer(roomCount, maxRooms)); // if so throws the max room error. + this.client.sendResponse(new PurchaseOKComposer(null)); // Send this so the alert disappears, not sure if this is how it should be handled :S + return; } - - if (!this.client.getHabbo().hasPermission("acc_inifinte_points")) { - this.client.getHabbo().getHabboInfo().addCurrencyAmount(item[0].getPointsType(), -item[0].getPoints()); - } - - this.client.sendResponse(new PurchaseOKComposer()); + ((RoomBundleLayout) page).buyRoom(this.client.getHabbo()); + if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) { //if the player has this perm disabled + this.client.getHabbo().getHabboInfo().addCredits(-roomBundleItem.getCredits()); // takes their credits away + this.client.sendResponse(new UserCreditsComposer(this.client.getHabbo())); // Sends the updated currency composer window + } + if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_POINTS)) { //if the player has this perm disabled + this.client.getHabbo().getHabboInfo().addCurrencyAmount(roomBundleItem.getPointsType(), -roomBundleItem.getPoints()); // takes their points away + this.client.sendResponse(new UserCurrencyComposer(this.client.getHabbo())); // Sends the updated currency composer window + } + this.client.sendResponse(new PurchaseOKComposer()); // Sends the composer to close the window. final boolean[] badgeFound = {false}; item[0].getBaseItems().stream().filter(i -> i.getType() == FurnitureType.BADGE).forEach(i -> { From 582b60b810b9a71835ea209449243925a6ebdc67 Mon Sep 17 00:00:00 2001 From: Harmonic Date: Fri, 5 Jun 2020 04:12:49 -0400 Subject: [PATCH 6/6] Goodbye magic strings --- sqlupdates/1_0_6_TO_1_0_7.sql | 2 +- .../eu/habbo/habbohotel/bots/BotManager.java | 6 +++--- .../habbohotel/catalog/CatalogManager.java | 5 +++-- .../habbohotel/commands/ChatTypeCommand.java | 3 ++- .../habbohotel/commands/CommandHandler.java | 2 +- .../habbohotel/commands/EnableCommand.java | 3 ++- .../habbo/habbohotel/commands/MimicCommand.java | 3 ++- .../habbo/habbohotel/commands/TestCommand.java | 4 ++-- .../habbohotel/commands/UserInfoCommand.java | 7 ++++--- .../interactions/InteractionGuildGate.java | 3 ++- .../wired/effects/WiredEffectGiveReward.java | 5 +++-- .../navigation/NavigatorHotelFilter.java | 4 ++-- .../navigation/NavigatorPublicFilter.java | 2 +- .../navigation/NavigatorRoomAdsFilter.java | 2 +- .../habbohotel/permissions/Permission.java | 6 ++---- .../com/eu/habbo/habbohotel/rooms/Room.java | 12 ++++++------ .../habbo/habbohotel/rooms/RoomChatMessage.java | 7 ++++--- .../eu/habbo/habbohotel/rooms/RoomManager.java | 6 +++--- .../AmbassadorAlertCommandEvent.java | 3 ++- .../AmbassadorVisitCommandEvent.java | 3 ++- .../catalog/CatalogBuyItemAsGiftEvent.java | 7 ++++--- .../incoming/catalog/CatalogBuyItemEvent.java | 4 ++-- .../FloorPlanEditorSaveEvent.java | 2 +- .../incoming/guides/RequestGuideToolEvent.java | 7 ++++--- .../guilds/GuildAcceptMembershipEvent.java | 3 ++- .../incoming/guilds/GuildChangeBadgeEvent.java | 3 ++- .../incoming/guilds/GuildChangeColorsEvent.java | 3 ++- .../guilds/GuildChangeNameDescEvent.java | 3 ++- .../guilds/GuildChangeSettingsEvent.java | 3 ++- .../guilds/GuildConfirmRemoveMemberEvent.java | 3 ++- .../guilds/GuildDeclineMembershipEvent.java | 3 ++- .../incoming/guilds/GuildDeleteEvent.java | 3 ++- .../incoming/guilds/GuildRemoveAdminEvent.java | 3 ++- .../incoming/guilds/GuildRemoveMemberEvent.java | 3 ++- .../incoming/guilds/GuildSetAdminEvent.java | 3 ++- .../incoming/guilds/RequestGuildBuyEvent.java | 3 ++- .../guilds/RequestGuildMembersEvent.java | 3 ++- .../forums/GuildForumModerateMessageEvent.java | 3 ++- .../forums/GuildForumModerateThreadEvent.java | 3 ++- .../forums/GuildForumPostThreadEvent.java | 3 ++- .../forums/GuildForumThreadUpdateEvent.java | 3 ++- .../RequestNewNavigatorRoomsEvent.java | 2 +- .../incoming/rooms/RoomBackgroundEvent.java | 3 ++- .../incoming/rooms/RoomPlacePaintEvent.java | 3 ++- .../incoming/rooms/RoomStaffPickEvent.java | 3 ++- .../rooms/bots/BotSaveSettingsEvent.java | 2 +- .../incoming/rooms/items/MoveWallItemEvent.java | 3 ++- .../incoming/rooms/pets/PetPickupEvent.java | 2 +- .../incoming/rooms/pets/PetPlaceEvent.java | 4 ++-- .../rooms/promotions/BuyRoomPromotionEvent.java | 5 +++-- .../incoming/rooms/users/RoomUserKickEvent.java | 2 +- .../incoming/rooms/users/RoomUserMuteEvent.java | 3 ++- .../incoming/trading/TradeStartEvent.java | 3 ++- .../incoming/users/ChangeChatBubbleEvent.java | 3 ++- .../wired/WiredConditionSaveDataEvent.java | 2 +- .../wired/WiredEffectSaveDataEvent.java | 2 +- .../wired/WiredTriggerSaveDataEvent.java | 2 +- .../catalog/CatalogPagesListComposer.java | 3 ++- .../outgoing/guilds/GuildInfoComposer.java | 3 ++- .../guilds/forums/GuildForumDataComposer.java | 3 ++- .../outgoing/modtool/ModToolComposer.java | 17 +++++++++-------- .../outgoing/users/UserPerksComposer.java | 5 +++-- .../outgoing/users/UserPermissionsComposer.java | 3 ++- 63 files changed, 139 insertions(+), 98 deletions(-) diff --git a/sqlupdates/1_0_6_TO_1_0_7.sql b/sqlupdates/1_0_6_TO_1_0_7.sql index 7b15a7fa..0274afa8 100644 --- a/sqlupdates/1_0_6_TO_1_0_7.sql +++ b/sqlupdates/1_0_6_TO_1_0_7.sql @@ -1,6 +1,6 @@ #DATABASE UPDATE: 1.0.6 -> 1.0.7 -ALTER TABLE `permissions` ADD `acc_update_notifications` ENUM( '0', '1' ) NOT NULL DEFAULT '0'; +ALTER TABLE `permissions` ADD `"acc_update_notifications"` ENUM( '0', '1' ) NOT NULL DEFAULT '0'; DELETE FROM emulator_settings WHERE `key` LIKE 'emulator.version'; #END DATABASE UPDATE: 1.0.5 -> 1.0.6 \ No newline at end of file diff --git a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java index d948c332..4bffd0a7 100644 --- a/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java @@ -110,8 +110,8 @@ public class BotManager { return; if (room != null && bot != null && habbo != null) { - if (room.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER) || habbo.hasPermission("acc_placefurni")) { - if (room.getCurrentBots().size() >= Room.MAXIMUM_BOTS && !habbo.hasPermission("acc_unlimited_bots")) { + if (room.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER) || habbo.hasPermission(Permission.ACC_PLACEFURNI)) { + if (room.getCurrentBots().size() >= Room.MAXIMUM_BOTS && !habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS)) { habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_MAX_BOTS)); return; } @@ -171,7 +171,7 @@ public class BotManager { return; if (bot.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER)) { - if (!habbo.hasPermission("acc_unlimited_bots") && habbo.getInventory().getBotsComponent().getBots().size() >= 15) + if (!habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS) && habbo.getInventory().getBotsComponent().getBots().size() >= 15) return; bot.onPickUp(habbo, habbo.getHabboInfo().getCurrentRoom()); diff --git a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java index 47423eff..eea7f628 100644 --- a/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/catalog/CatalogManager.java @@ -11,6 +11,7 @@ import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.SoundTrack; import com.eu.habbo.habbohotel.items.interactions.*; import com.eu.habbo.habbohotel.modtool.ScripterManager; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.pets.Pet; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboBadge; @@ -1070,14 +1071,14 @@ public class CatalogManager { } } - if (!free && !habbo.getClient().getHabbo().hasPermission("acc_infinite_credits")) { + if (!free && !habbo.getClient().getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) { if (purchasedEvent.totalCredits > 0) { habbo.getClient().getHabbo().getHabboInfo().addCredits(-purchasedEvent.totalCredits); habbo.getClient().sendResponse(new UserCreditsComposer(habbo.getClient().getHabbo())); } } - if (!free && !habbo.getClient().getHabbo().hasPermission("acc_infinite_points")) { + if (!free && !habbo.getClient().getHabbo().hasPermission(Permission.ACC_INFINITE_POINTS)) { if (purchasedEvent.totalPoints > 0) { habbo.getClient().getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -purchasedEvent.totalPoints); habbo.getClient().sendResponse(new UserPointsComposer(habbo.getClient().getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -purchasedEvent.totalPoints, item.getPointsType())); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java index 005911f7..6afc6dc3 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/ChatTypeCommand.java @@ -2,6 +2,7 @@ package com.eu.habbo.habbohotel.commands; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; import com.eu.habbo.messages.outgoing.users.MeMenuSettingsComposer; @@ -31,7 +32,7 @@ public class ChatTypeCommand extends Command { return true; } - if (!gameClient.getHabbo().hasPermission("acc_anychatcolor")) { + if (!gameClient.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) { for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) { if (Integer.valueOf(s) == chatColor) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_chatcolor.banned"), RoomChatMessageBubbles.ALERT); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/CommandHandler.java b/src/main/java/com/eu/habbo/habbohotel/commands/CommandHandler.java index 33974e59..16d2c5c9 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/CommandHandler.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/CommandHandler.java @@ -72,7 +72,7 @@ public class CommandHandler { for (String s : command.keys) { if (s.toLowerCase().equals(parts[0].toLowerCase())) { boolean succes = false; - if (command.permission == null || gameClient.getHabbo().hasPermission(command.permission, gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && (gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) || gameClient.getHabbo().hasPermission("acc_placefurni") || (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildId() > 0 && gameClient.getHabbo().getHabboInfo().getCurrentRoom().guildRightLevel(gameClient.getHabbo()) >= 2))) { + if (command.permission == null || gameClient.getHabbo().hasPermission(command.permission, gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && (gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) || gameClient.getHabbo().hasPermission(Permission.ACC_PLACEFURNI) || (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildId() > 0 && gameClient.getHabbo().getHabboInfo().getCurrentRoom().guildRightLevel(gameClient.getHabbo()) >= 2))) { try { Emulator.getPluginManager().fireEvent(new UserExecuteCommandEvent(gameClient.getHabbo(), command, parts)); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/EnableCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/EnableCommand.java index c56842b6..cf69a1d1 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/EnableCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/EnableCommand.java @@ -2,6 +2,7 @@ package com.eu.habbo.habbohotel.commands; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; import com.eu.habbo.habbohotel.users.Habbo; import org.slf4j.Logger; @@ -29,7 +30,7 @@ public class EnableCommand extends Command { } if (target != null) { - if (target == gameClient.getHabbo() || gameClient.getHabbo().hasPermission("acc_enable_others")) { + if (target == gameClient.getHabbo() || gameClient.getHabbo().hasPermission(Permission.ACC_ENABLE_OTHERS)) { try { if (target.getHabboInfo().getCurrentRoom() != null) { if (target.getHabboInfo().getRiding() == null) { diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/MimicCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/MimicCommand.java index 80bef498..123f1db4 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/MimicCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/MimicCommand.java @@ -2,6 +2,7 @@ package com.eu.habbo.habbohotel.commands; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboGender; @@ -27,7 +28,7 @@ public class MimicCommand extends Command { if (habbo == gameClient.getHabbo()) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_mimic.not_self"), RoomChatMessageBubbles.ALERT); return true; - } else if (habbo.hasPermission("acc_not_mimiced") && !gameClient.getHabbo().hasPermission("acc_not_mimiced")) { + } else if (habbo.hasPermission(Permission.ACC_NOT_MIMICED) && !gameClient.getHabbo().hasPermission(Permission.ACC_NOT_MIMICED)) { gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_mimic.blocked").replace("%user%", params[1]).replace("%gender_name%", (habbo.getHabboInfo().getGender().equals(HabboGender.M) ? Emulator.getTexts().getValue("gender.him") : Emulator.getTexts().getValue("gender.her"))), RoomChatMessageBubbles.ALERT); return true; } else if (!habbo.hasPermission("acc_mimic_unredeemed") && FigureUtil.hasBlacklistedClothing(habbo.getHabboInfo().getLook(), gameClient.getHabbo().getForbiddenClothing())) { diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java index 9caaa41d..243dec78 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/TestCommand.java @@ -2,7 +2,7 @@ package com.eu.habbo.habbohotel.commands; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; -import com.eu.habbo.habbohotel.users.Habbo; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.messages.ServerMessage; public class TestCommand extends Command { @@ -12,7 +12,7 @@ public class TestCommand extends Command { @Override public boolean handle(GameClient gameClient, String[] params) throws Exception { - if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasPermission("acc_supporttool") || !Emulator.debugging) + if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL) || !Emulator.debugging) return false; int header = Integer.valueOf(params[1]); diff --git a/src/main/java/com/eu/habbo/habbohotel/commands/UserInfoCommand.java b/src/main/java/com/eu/habbo/habbohotel/commands/UserInfoCommand.java index c0402ee3..fdd621c8 100644 --- a/src/main/java/com/eu/habbo/habbohotel/commands/UserInfoCommand.java +++ b/src/main/java/com/eu/habbo/habbohotel/commands/UserInfoCommand.java @@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.commands; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.modtool.ModToolBan; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboInfo; @@ -42,9 +43,9 @@ public class UserInfoCommand extends Command { Emulator.getTexts().getValue("command.cmd_userinfo.motto") + ": " + habbo.getMotto().replace("<", "[").replace(">", "]") + "\r" + Emulator.getTexts().getValue("command.cmd_userinfo.rank") + ": " + habbo.getRank().getName() + " (" + habbo.getRank().getId() + ") \r" + Emulator.getTexts().getValue("command.cmd_userinfo.online") + ": " + (onlineHabbo == null ? Emulator.getTexts().getValue("generic.no") : Emulator.getTexts().getValue("generic.yes")) + "\r" + - ((habbo.getRank().hasPermission("acc_hide_mail", true)) ? "" : Emulator.getTexts().getValue("command.cmd_userinfo.email") + ": " + habbo.getMail() + "\r") + - ((habbo.getRank().hasPermission("acc_hide_ip", true)) ? "" : Emulator.getTexts().getValue("command.cmd_userinfo.ip_register") + ": " + habbo.getIpRegister() + "\r") + - ((habbo.getRank().hasPermission("acc_hide_ip", true)) || onlineHabbo == null ? "" : Emulator.getTexts().getValue("command.cmd_userinfo.ip_current") + ": " + onlineHabbo.getClient().getChannel().remoteAddress().toString() + "\r") + + ((habbo.getRank().hasPermission(Permission.ACC_HIDE_MAIL, true)) ? "" : Emulator.getTexts().getValue("command.cmd_userinfo.email") + ": " + habbo.getMail() + "\r") + + ((habbo.getRank().hasPermission(Permission.ACC_HIDE_IP, true)) ? "" : Emulator.getTexts().getValue("command.cmd_userinfo.ip_register") + ": " + habbo.getIpRegister() + "\r") + + ((habbo.getRank().hasPermission(Permission.ACC_HIDE_IP, true)) || onlineHabbo == null ? "" : Emulator.getTexts().getValue("command.cmd_userinfo.ip_current") + ": " + onlineHabbo.getClient().getChannel().remoteAddress().toString() + "\r") + (onlineHabbo != null ? Emulator.getTexts().getValue("command.cmd_userinfo.achievement_score") + ": " + onlineHabbo.getHabboStats().achievementScore + "\r" : "")); ModToolBan ban = Emulator.getGameEnvironment().getModToolManager().checkForBan(habbo.getId()); diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGuildGate.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGuildGate.java index d552d5a9..176ae78d 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGuildGate.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionGuildGate.java @@ -3,6 +3,7 @@ package com.eu.habbo.habbohotel.items.interactions; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.items.Item; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomTile; import com.eu.habbo.habbohotel.rooms.RoomUnit; @@ -35,7 +36,7 @@ public class InteractionGuildGate extends InteractionGuildFurni { Habbo habbo = room.getHabbo(roomUnit); - return habbo != null && (habbo.getHabboStats().hasGuild(super.getGuildId()) || habbo.hasPermission("acc_guildgate")); + return habbo != null && (habbo.getHabboStats().hasGuild(super.getGuildId()) || habbo.hasPermission(Permission.ACC_GUILDGATE)); } @Override diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java index a5a8c947..e61973e9 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectGiveReward.java @@ -5,6 +5,7 @@ import com.eu.habbo.habbohotel.gameclients.GameClient; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.interactions.InteractionWiredEffect; import com.eu.habbo.habbohotel.items.interactions.InteractionWiredTrigger; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; import com.eu.habbo.habbohotel.rooms.RoomUnit; @@ -116,7 +117,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect { public void onClick(GameClient client, Room room, Object[] objects) throws Exception { super.onClick(client, room, objects); - if (client.getHabbo().hasPermission("acc_superwired")) { + if (client.getHabbo().hasPermission(Permission.ACC_SUPERWIRED)) { client.getHabbo().whisper(Emulator.getTexts().getValue("hotel.wired.superwired.info"), RoomChatMessageBubbles.BOT); } } @@ -165,7 +166,7 @@ public class WiredEffectGiveReward extends InteractionWiredEffect { @Override public boolean saveData(ClientMessage packet, GameClient gameClient) { - if (gameClient.getHabbo().hasPermission("acc_superwired")) { + if (gameClient.getHabbo().hasPermission(Permission.ACC_SUPERWIRED)) { packet.readInt(); this.rewardTime = packet.readInt(); diff --git a/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorHotelFilter.java b/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorHotelFilter.java index ff1b74b1..0a7825a5 100644 --- a/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorHotelFilter.java +++ b/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorHotelFilter.java @@ -19,7 +19,7 @@ public class NavigatorHotelFilter extends NavigatorFilter { @Override public List getResult(Habbo habbo) { - boolean showInvisible = habbo.hasPermission("acc_enter_anyroom") || habbo.hasPermission(Permission.ACC_ANYROOMOWNER); + boolean showInvisible = habbo.hasPermission(Permission.ACC_ENTERANYROOM) || habbo.hasPermission(Permission.ACC_ANYROOMOWNER); List resultLists = new ArrayList<>(); int i = 0; @@ -41,7 +41,7 @@ public class NavigatorHotelFilter extends NavigatorFilter { @Override public List getResult(Habbo habbo, NavigatorFilterField filterField, String value, int roomCategory) { - boolean showInvisible = habbo.hasPermission("acc_enter_anyroom") || habbo.hasPermission(Permission.ACC_ANYROOMOWNER); + boolean showInvisible = habbo.hasPermission(Permission.ACC_ENTERANYROOM) || habbo.hasPermission(Permission.ACC_ANYROOMOWNER); if (!filterField.databaseQuery.isEmpty()) { List resultLists = new ArrayList<>(); int i = 0; diff --git a/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorPublicFilter.java b/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorPublicFilter.java index 49be285d..4ab8c3bd 100644 --- a/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorPublicFilter.java +++ b/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorPublicFilter.java @@ -16,7 +16,7 @@ public class NavigatorPublicFilter extends NavigatorFilter { @Override public List getResult(Habbo habbo) { - boolean showInvisible = habbo.hasPermission("acc_enter_anyroom") || habbo.hasPermission(Permission.ACC_ANYROOMOWNER); + boolean showInvisible = habbo.hasPermission(Permission.ACC_ENTERANYROOM) || habbo.hasPermission(Permission.ACC_ANYROOMOWNER); List resultLists = new ArrayList<>(); int i = 0; diff --git a/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorRoomAdsFilter.java b/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorRoomAdsFilter.java index 2e98a9c3..a27d3c69 100644 --- a/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorRoomAdsFilter.java +++ b/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorRoomAdsFilter.java @@ -16,7 +16,7 @@ public class NavigatorRoomAdsFilter extends NavigatorFilter { @Override public List getResult(Habbo habbo) { - boolean showInvisible = habbo.hasPermission("acc_enter_anyroom") || habbo.hasPermission(Permission.ACC_ANYROOMOWNER); + boolean showInvisible = habbo.hasPermission(Permission.ACC_ENTERANYROOM) || habbo.hasPermission(Permission.ACC_ANYROOMOWNER); List resultList = new ArrayList<>(); resultList.add(new SearchResultList(0, "categories", "", SearchAction.NONE, habbo.getHabboStats().navigatorWindowSettings.getListModeForCategory("categories", ListMode.LIST), habbo.getHabboStats().navigatorWindowSettings.getDisplayModeForCategory("official-root", DisplayMode.VISIBLE), Emulator.getGameEnvironment().getNavigatorManager().getRoomsForCategory("categories", habbo), false, showInvisible, DisplayOrder.ACTIVITY, 0)); return resultList; 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 ace827af..46dc72d5 100644 --- a/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java +++ b/src/main/java/com/eu/habbo/habbohotel/permissions/Permission.java @@ -1,7 +1,7 @@ package com.eu.habbo.habbohotel.permissions; public class Permission { - public static String ACC_ANYCHATCOLOR = "acc_anychatcolor"; + public static String ACC_ANYCHATCOLOR = "acc_anychatcolor"; // allows them to pick and choose any color from the chat bubbles. public static String ACC_ANYROOMOWNER = "acc_anyroomowner"; public static String ACC_EMPTY_OTHERS = "acc_empty_others"; public static String ACC_ENABLE_OTHERS = "acc_enable_others"; @@ -18,15 +18,13 @@ public class Permission { public static String ACC_HIDE_MAIL = "acc_hide_mail"; public static String ACC_NOT_MIMICED = "acc_not_mimiced"; public static String ACC_CHAT_NO_FLOOD = "acc_chat_no_flood"; - public static String ACC_STAFF_CHAT = "acc_staff_chat"; public static String ACC_STAFF_PICK = "acc_staff_pick"; - public static String ACC_ENTERANYROOM = "acc_enteranyroom"; + public static String ACC_ENTERANYROOM = "acc_enteranyroom"; // public static String ACC_FULLROOMS = "acc_fullrooms"; public static String ACC_INFINITE_CREDITS = "acc_infinite_credits"; public static String ACC_INFINITE_PIXELS = "acc_infinite_pixels"; public static String ACC_INFINITE_POINTS = "acc_infinite_points"; public static String ACC_AMBASSADOR = "acc_ambassador"; - public static String ACC_DEBUG = "acc_debug"; public static String ACC_CHAT_NO_LIMIT = "acc_chat_no_limit"; public static String ACC_CHAT_NO_FILTER = "acc_chat_no_filter"; public static String ACC_NOMUTE = "acc_nomute"; diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java index dfa02ad9..d8488b7e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/Room.java @@ -1197,7 +1197,7 @@ public class Room implements Comparable, ISerialize, Runnable { habbo.getHabboStats().mutedBubbleTracker = false; this.sendComposer(new RoomUserIgnoredComposer(habbo, RoomUserIgnoredComposer.UNIGNORED).compose()); } - if (!habbo.hasPermission("acc_chat_no_flood") && habbo.getHabboStats().chatCounter > 0) { + if (!habbo.hasPermission(Permission.ACC_CHAT_NO_FLOOD) && habbo.getHabboStats().chatCounter > 0) { //if (habbo.getRoomUnit().talkTimeOut == 0 || currentTimestamp - habbo.getRoomUnit().talkTimeOut < 0) { habbo.getHabboStats().chatCounter--; @@ -3088,14 +3088,14 @@ public class Room implements Comparable, ISerialize, Runnable { } if (!this.wordFilterWords.isEmpty()) { - if (!habbo.hasPermission("acc_chat_no_filter")) { + if (!habbo.hasPermission(Permission.ACC_CHAT_NO_FILTER)) { for (String string : this.wordFilterWords) { roomChatMessage.setMessage(roomChatMessage.getMessage().replace(string, "bobba")); } } } - if (!habbo.hasPermission("acc_nomute")) { + if (!habbo.hasPermission(Permission.ACC_NOMUTE)) { if (this.isMuted() && !this.hasRights(habbo)) { return; } @@ -3160,13 +3160,13 @@ public class Room implements Comparable, ISerialize, Runnable { continue; } - if (h.hasPermission("acc_see_whispers")) { + if (h.hasPermission(Permission.ACC_SEE_WHISPERS)) { h.getClient().sendResponse(staffMessage); } } } else if (chatType == RoomChatType.TALK) { ServerMessage message = new RoomUserTalkComposer(roomChatMessage).compose(); - boolean noChatLimit = habbo.hasPermission("acc_chat_no_limit"); + boolean noChatLimit = habbo.hasPermission(Permission.ACC_CHAT_NO_LIMIT); for (Habbo h : this.getHabbos()) { if ((h.getRoomUnit().getCurrentLocation().distance(habbo.getRoomUnit().getCurrentLocation()) <= this.chatDistance || @@ -4229,7 +4229,7 @@ public class Room implements Comparable, ISerialize, Runnable { for (Habbo habbo : this.getHabbos()) { if (habbo.getHabboInfo().getCurrentRoom() == this) { if (habbo.getHabboInfo().getId() != this.ownerId) { - if (!(habbo.hasPermission(Permission.ACC_ANYROOMOWNER) || habbo.hasPermission("acc_moverotate"))) + if (!(habbo.hasPermission(Permission.ACC_ANYROOMOWNER) || habbo.hasPermission(Permission.ACC_MOVEROTATE))) this.refreshRightsForHabbo(habbo); } } diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java index 22a8b662..ba845ba4 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomChatMessage.java @@ -2,6 +2,7 @@ package com.eu.habbo.habbohotel.rooms; import com.eu.habbo.Emulator; import com.eu.habbo.core.DatabaseLoggable; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.ISerialize; import com.eu.habbo.messages.ServerMessage; @@ -51,7 +52,7 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable { this.bubble = RoomChatMessageBubbles.NORMAL; } - if (!message.client.getHabbo().hasPermission("acc_anychatcolor")) { + if (!message.client.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) { for (Integer i : RoomChatMessage.BANNED_BUBBLES) { if (i == this.bubble.getType()) { this.bubble = RoomChatMessageBubbles.NORMAL; @@ -173,7 +174,7 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable { @Override public void serialize(ServerMessage message) { if (this.habbo != null && this.bubble.isOverridable()) { - if (!this.habbo.hasPermission("acc_anychatcolor")) { + if (!this.habbo.hasPermission(Permission.ACC_ANYCHATCOLOR)) { for (Integer i : RoomChatMessage.BANNED_BUBBLES) { if (i == this.bubble.getType()) { this.bubble = RoomChatMessageBubbles.NORMAL; @@ -209,7 +210,7 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable { } if (Emulator.getConfig().getBoolean("hotel.wordfilter.enabled") && Emulator.getConfig().getBoolean("hotel.wordfilter.rooms")) { - if (!this.habbo.hasPermission("acc_chat_no_filter")) { + if (!this.habbo.hasPermission(Permission.ACC_CHAT_NO_FILTER)) { if (!Emulator.getGameEnvironment().getWordFilter().autoReportCheck(this)) { if (!Emulator.getGameEnvironment().getWordFilter().hideMessageCheck(this.message)) { Emulator.getGameEnvironment().getWordFilter().filter(this, this.habbo); diff --git a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java index 59dc8999..76917c82 100644 --- a/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/rooms/RoomManager.java @@ -510,7 +510,7 @@ public class RoomManager { } } - if (room.isBanned(habbo) && !habbo.hasPermission(Permission.ACC_ANYROOMOWNER) && !habbo.hasPermission("acc_enteranyroom")) { + if (room.isBanned(habbo) && !habbo.hasPermission(Permission.ACC_ANYROOMOWNER) && !habbo.hasPermission(Permission.ACC_ENTERANYROOM)) { habbo.getClient().sendResponse(new RoomEnterErrorComposer(RoomEnterErrorComposer.ROOM_ERROR_BANNED)); return; } @@ -528,7 +528,7 @@ public class RoomManager { room.getState() == RoomState.OPEN || room.getState() == RoomState.INVISIBLE || habbo.hasPermission(Permission.ACC_ANYROOMOWNER) || - habbo.hasPermission("acc_enteranyroom") || + habbo.hasPermission(Permission.ACC_ENTERANYROOM) || room.hasRights(habbo) || (room.hasGuild() && room.guildRightLevel(habbo) > 2)) { this.openRoom(habbo, room, doorLocation); @@ -620,7 +620,7 @@ public class RoomManager { return; } - if (room.getUserCount() >= room.getUsersMax() && !habbo.hasPermission("acc_fullrooms") && !room.hasRights(habbo)) { + if (room.getUserCount() >= room.getUsersMax() && !habbo.hasPermission(Permission.ACC_FULLROOMS) && !room.hasRights(habbo)) { habbo.getClient().sendResponse(new RoomEnterErrorComposer(RoomEnterErrorComposer.ROOM_ERROR_GUESTROOM_FULL)); return; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/ambassadors/AmbassadorAlertCommandEvent.java b/src/main/java/com/eu/habbo/messages/incoming/ambassadors/AmbassadorAlertCommandEvent.java index fe42366b..dc37847c 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/ambassadors/AmbassadorAlertCommandEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/ambassadors/AmbassadorAlertCommandEvent.java @@ -2,6 +2,7 @@ package com.eu.habbo.messages.incoming.ambassadors; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.modtool.ScripterManager; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer; @@ -11,7 +12,7 @@ import com.eu.habbo.plugin.events.support.SupportUserAlertedReason; public class AmbassadorAlertCommandEvent extends MessageHandler { @Override public void handle() throws Exception { - if (!this.client.getHabbo().hasPermission("acc_ambassador")) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_AMBASSADOR)) { ScripterManager.scripterDetected(this.client, Emulator.getTexts().getValue("scripter.warning.modtools.alert").replace("%username%", client.getHabbo().getHabboInfo().getUsername()).replace("%message%", "${notification.ambassador.alert.warning.message}")); return; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/ambassadors/AmbassadorVisitCommandEvent.java b/src/main/java/com/eu/habbo/messages/incoming/ambassadors/AmbassadorVisitCommandEvent.java index 0a92bcab..867ff0d8 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/ambassadors/AmbassadorVisitCommandEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/ambassadors/AmbassadorVisitCommandEvent.java @@ -1,6 +1,7 @@ package com.eu.habbo.messages.incoming.ambassadors; import com.eu.habbo.Emulator; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer; @@ -8,7 +9,7 @@ import com.eu.habbo.messages.outgoing.rooms.ForwardToRoomComposer; public class AmbassadorVisitCommandEvent extends MessageHandler { @Override public void handle() throws Exception { - if (this.client.getHabbo().hasPermission("acc_ambassador")) { + if (this.client.getHabbo().hasPermission(Permission.ACC_AMBASSADOR)) { String username = this.packet.readString(); Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(username); diff --git a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java index 8c08198a..f201cb83 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemAsGiftEvent.java @@ -10,6 +10,7 @@ import com.eu.habbo.habbohotel.items.FurnitureType; import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.interactions.*; import com.eu.habbo.habbohotel.modtool.ScripterManager; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.HabboBadge; import com.eu.habbo.habbohotel.users.HabboItem; @@ -347,15 +348,15 @@ public class CatalogBuyItemAsGiftEvent extends MessageHandler { AchievementManager.progressAchievement(userId, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GiftReceiver")); - if (!this.client.getHabbo().hasPermission("acc_infinite_credits")) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) { if (totalCredits > 0) { this.client.getHabbo().giveCredits(-totalCredits); } } if (totalPoints > 0) { - if (item.getPointsType() == 0 && !this.client.getHabbo().hasPermission("acc_infinite_pixels")) { + if (item.getPointsType() == 0 && !this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_PIXELS)) { this.client.getHabbo().getHabboInfo().addPixels(-totalPoints); - } else if (!this.client.getHabbo().hasPermission("acc_infinite_points")) { + } else if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_POINTS)) { this.client.getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -totalPoints); } this.client.sendResponse(new UserPointsComposer(this.client.getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -totalPoints, item.getPointsType())); diff --git a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java index b901e1ad..3e05fde7 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java @@ -166,10 +166,10 @@ public class CatalogBuyItemEvent extends MessageHandler { if (this.client.getHabbo().getHabboInfo().getCredits() < totalCredits) return; - if (!this.client.getHabbo().hasPermission("acc_infinite_credits")) + if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) this.client.getHabbo().getHabboInfo().addCredits(-totalCredits); - if (!this.client.getHabbo().hasPermission("acc_infinite_points")) + if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_POINTS)) this.client.getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -totalDuckets); if (this.client.getHabbo().getHabboStats().getClubExpireTimestamp() <= Emulator.getIntUnixTimestamp()) diff --git a/src/main/java/com/eu/habbo/messages/incoming/floorplaneditor/FloorPlanEditorSaveEvent.java b/src/main/java/com/eu/habbo/messages/incoming/floorplaneditor/FloorPlanEditorSaveEvent.java index 113dd0e3..c819a940 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/floorplaneditor/FloorPlanEditorSaveEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/floorplaneditor/FloorPlanEditorSaveEvent.java @@ -21,7 +21,7 @@ public class FloorPlanEditorSaveEvent extends MessageHandler { @Override public void handle() throws Exception { - if (!this.client.getHabbo().hasPermission("acc_floorplan_editor")) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_FLOORPLAN_EDITOR)) { this.client.sendResponse(new GenericAlertComposer(Emulator.getTexts().getValue("floorplan.permission"))); return; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideToolEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideToolEvent.java index a3240e31..2c954c2a 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideToolEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guides/RequestGuideToolEvent.java @@ -1,6 +1,7 @@ package com.eu.habbo.messages.incoming.guides; import com.eu.habbo.Emulator; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.guides.GuideToolsComposer; @@ -14,13 +15,13 @@ public class RequestGuideToolEvent extends MessageHandler { boolean helperRequests = this.packet.readBoolean(); boolean bullyReports = this.packet.readBoolean(); - if (!this.client.getHabbo().hasPermission("acc_helper_use_guide_tool")) + if (!this.client.getHabbo().hasPermission(Permission.ACC_HELPER_USE_GUIDE_TOOL)) return; - if (helperRequests && !this.client.getHabbo().hasPermission("acc_helper_give_guide_tours")) + if (helperRequests && !this.client.getHabbo().hasPermission(Permission.ACC_HELPER_GIVE_GUIDE_TOURS)) helperRequests = false; - if (bullyReports && !this.client.getHabbo().hasPermission("acc_helper_judge_chat_reviews")) + if (bullyReports && !this.client.getHabbo().hasPermission(Permission.ACC_HELPER_JUDGE_CHAT_REVIEWS)) bullyReports = false; if (helperRequests) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildAcceptMembershipEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildAcceptMembershipEvent.java index 497d4c15..1f932ffb 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildAcceptMembershipEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildAcceptMembershipEvent.java @@ -4,6 +4,7 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildRank; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; @@ -20,7 +21,7 @@ public class GuildAcceptMembershipEvent extends MessageHandler { Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); - if (guild == null || (guild.getOwnerId() != this.client.getHabbo().getHabboInfo().getId() && !Emulator.getGameEnvironment().getGuildManager().getOnlyAdmins(guild).containsKey(this.client.getHabbo().getHabboInfo().getId()) && !this.client.getHabbo().hasPermission("acc_guild_admin"))) + if (guild == null || (guild.getOwnerId() != this.client.getHabbo().getHabboInfo().getId() && !Emulator.getGameEnvironment().getGuildManager().getOnlyAdmins(guild).containsKey(this.client.getHabbo().getHabboInfo().getId()) && !this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN))) return; Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java index 1edbbd5f..965202d7 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeBadgeEvent.java @@ -2,6 +2,7 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.plugin.events.guilds.GuildChangedBadgeEvent; @@ -13,7 +14,7 @@ public class GuildChangeBadgeEvent extends MessageHandler { Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); if (guild != null) { - if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId()); if (room == null || room.getId() != guild.getRoomId()) diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeColorsEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeColorsEvent.java index ed496ded..fee78300 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeColorsEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeColorsEvent.java @@ -2,6 +2,7 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.plugin.events.guilds.GuildChangedColorsEvent; @@ -14,7 +15,7 @@ public class GuildChangeColorsEvent extends MessageHandler { Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); if (guild != null) { - if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { GuildChangedColorsEvent colorsEvent = new GuildChangedColorsEvent(guild, this.packet.readInt(), this.packet.readInt()); Emulator.getPluginManager().fireEvent(colorsEvent); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java index fc28261c..29eac532 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeNameDescEvent.java @@ -2,6 +2,7 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.plugin.events.guilds.GuildChangedNameEvent; @@ -14,7 +15,7 @@ public class GuildChangeNameDescEvent extends MessageHandler { Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); if (guild != null) { - if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { GuildChangedNameEvent nameEvent = new GuildChangedNameEvent(guild, this.packet.readString(), this.packet.readString()); Emulator.getPluginManager().fireEvent(nameEvent); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeSettingsEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeSettingsEvent.java index 75e20dc5..2cb2d807 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeSettingsEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildChangeSettingsEvent.java @@ -3,6 +3,7 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.guilds.GuildState; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.plugin.events.guilds.GuildChangedSettingsEvent; @@ -15,7 +16,7 @@ public class GuildChangeSettingsEvent extends MessageHandler { Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); if (guild != null) { - if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId()); if (room == null) diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildConfirmRemoveMemberEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildConfirmRemoveMemberEvent.java index 9e04a545..0daebeab 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildConfirmRemoveMemberEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildConfirmRemoveMemberEvent.java @@ -4,6 +4,7 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildRank; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.guilds.GuildConfirmRemoveMemberComposer; @@ -18,7 +19,7 @@ public class GuildConfirmRemoveMemberEvent extends MessageHandler { if (guild != null) { GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo()); - if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || (member != null && member.getRank().equals(GuildRank.OWNER)) || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || (member != null && member.getRank().equals(GuildRank.OWNER)) || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(guild.getRoomId()); int count = 0; if (room != null) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildDeclineMembershipEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildDeclineMembershipEvent.java index e67945d6..d75a5ef1 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildDeclineMembershipEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildDeclineMembershipEvent.java @@ -4,6 +4,7 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildRank; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; @@ -22,7 +23,7 @@ public class GuildDeclineMembershipEvent extends MessageHandler { if (guild != null) { GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo()); - if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.OWNER) || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.OWNER) || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { guild.decreaseRequestCount(); Emulator.getGameEnvironment().getGuildManager().removeMember(guild, userId); this.client.sendResponse(new GuildMembersComposer(guild, Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild, 0, 0, ""), this.client.getHabbo(), 0, 0, "", true, Emulator.getGameEnvironment().getGuildManager().getGuildMembersCount(guild, 0, 0, ""))); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildDeleteEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildDeleteEvent.java index b5f4300b..03e9bd2a 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildDeleteEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildDeleteEvent.java @@ -2,6 +2,7 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.guilds.RemoveGuildFromRoomComposer; import com.eu.habbo.messages.outgoing.rooms.RoomDataComposer; @@ -15,7 +16,7 @@ public class GuildDeleteEvent extends MessageHandler { Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); if (guild != null) { - if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission("acc_guild_admin")) //TODO Add staff permission override. + if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) //TODO Add staff permission override. { Emulator.getGameEnvironment().getGuildManager().deleteGuild(guild); Emulator.getPluginManager().fireEvent(new GuildDeletedEvent(guild, this.client.getHabbo())); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildRemoveAdminEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildRemoveAdminEvent.java index a26dbcc5..d017a5af 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildRemoveAdminEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildRemoveAdminEvent.java @@ -3,6 +3,7 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.guilds.GuildMember; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; @@ -18,7 +19,7 @@ public class GuildRemoveAdminEvent extends MessageHandler { Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); if (guild != null) { - if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { int userId = this.packet.readInt(); Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId()); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildRemoveMemberEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildRemoveMemberEvent.java index beb69560..7652c0da 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildRemoveMemberEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildRemoveMemberEvent.java @@ -4,6 +4,7 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildRank; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; @@ -22,7 +23,7 @@ public class GuildRemoveMemberEvent extends MessageHandler { if (guild != null) { GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo()); - if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.OWNER) || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.OWNER) || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId); GuildRemovedMemberEvent removedMemberEvent = new GuildRemovedMemberEvent(guild, userId, habbo); Emulator.getPluginManager().fireEvent(removedMemberEvent); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildSetAdminEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildSetAdminEvent.java index 6c91f4bc..7e60d6cf 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildSetAdminEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/GuildSetAdminEvent.java @@ -3,6 +3,7 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.guilds.GuildMember; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; @@ -18,7 +19,7 @@ public class GuildSetAdminEvent extends MessageHandler { Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId); if (guild != null) { - if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission("acc_guild_admin")) { + if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN)) { Emulator.getGameEnvironment().getGuildManager().setAdmin(guild, userId); Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java index fd969b85..7e613c42 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildBuyEvent.java @@ -3,6 +3,7 @@ package com.eu.habbo.messages.incoming.guilds; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.modtool.ScripterManager; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; @@ -20,7 +21,7 @@ public class RequestGuildBuyEvent extends MessageHandler { @Override public void handle() throws Exception { - if (!this.client.getHabbo().hasPermission("acc_infinite_credits")) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) { int guildPrice = Emulator.getConfig().getInt("catalog.guild.price"); if (this.client.getHabbo().getHabboInfo().getCredits() >= guildPrice) { this.client.getHabbo().giveCredits(-guildPrice); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildMembersEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildMembersEvent.java index f8ec7693..2423a900 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildMembersEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/RequestGuildMembersEvent.java @@ -4,6 +4,7 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildRank; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.guilds.GuildMembersComposer; @@ -18,7 +19,7 @@ public class RequestGuildMembersEvent extends MessageHandler { Guild g = Emulator.getGameEnvironment().getGuildManager().getGuild(groupId); if (g != null) { - boolean isAdmin = this.client.getHabbo().hasPermission("acc_guild_admin"); + boolean isAdmin = this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN); if (!isAdmin && this.client.getHabbo().getHabboStats().hasGuild(g.getId())) { GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(g, this.client.getHabbo()); isAdmin = member != null && (member.getRank().equals(GuildRank.OWNER) || member.getRank().equals(GuildRank.ADMIN)); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumModerateMessageEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumModerateMessageEvent.java index 9f8ab11f..f7211d14 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumModerateMessageEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumModerateMessageEvent.java @@ -7,6 +7,7 @@ import com.eu.habbo.habbohotel.guilds.GuildRank; import com.eu.habbo.habbohotel.guilds.forums.ForumThread; import com.eu.habbo.habbohotel.guilds.forums.ForumThreadComment; import com.eu.habbo.habbohotel.guilds.forums.ForumThreadState; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys; @@ -36,7 +37,7 @@ public class GuildForumModerateMessageEvent extends MessageHandler { return; } - boolean isStaff = this.client.getHabbo().hasPermission("acc_modtool_ticket_q"); + boolean isStaff = this.client.getHabbo().hasPermission(Permission.ACC_MODTOOL_TICKET_Q); GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId()); if (member == null) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumModerateThreadEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumModerateThreadEvent.java index 6fdea270..dfd1d31d 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumModerateThreadEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumModerateThreadEvent.java @@ -6,6 +6,7 @@ import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildRank; import com.eu.habbo.habbohotel.guilds.forums.ForumThread; import com.eu.habbo.habbohotel.guilds.forums.ForumThreadState; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys; @@ -29,7 +30,7 @@ public class GuildForumModerateThreadEvent extends MessageHandler { return; } - boolean isStaff = this.client.getHabbo().hasPermission("acc_modtool_ticket_q"); + boolean isStaff = this.client.getHabbo().hasPermission(Permission.ACC_MODTOOL_TICKET_Q); GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId()); if (member == null) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumPostThreadEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumPostThreadEvent.java index a21ddc8f..5d3db9e1 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumPostThreadEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumPostThreadEvent.java @@ -6,6 +6,7 @@ import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildRank; import com.eu.habbo.habbohotel.guilds.forums.ForumThread; import com.eu.habbo.habbohotel.guilds.forums.ForumThreadComment; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumAddCommentComposer; import com.eu.habbo.messages.outgoing.guilds.forums.GuildForumThreadMessagesComposer; @@ -38,7 +39,7 @@ public class GuildForumPostThreadEvent extends MessageHandler { return; } - boolean isStaff = this.client.getHabbo().hasPermission("acc_modtool_ticket_q"); + boolean isStaff = this.client.getHabbo().hasPermission(Permission.ACC_MODTOOL_TICKET_Q); GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId()); diff --git a/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumThreadUpdateEvent.java b/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumThreadUpdateEvent.java index a73b9b27..5611b934 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumThreadUpdateEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/guilds/forums/GuildForumThreadUpdateEvent.java @@ -6,6 +6,7 @@ import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildRank; import com.eu.habbo.habbohotel.guilds.SettingsState; import com.eu.habbo.habbohotel.guilds.forums.ForumThread; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer; import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys; @@ -29,7 +30,7 @@ public class GuildForumThreadUpdateEvent extends MessageHandler { return; } - boolean isStaff = this.client.getHabbo().hasPermission("acc_modtool_ticket_q"); + boolean isStaff = this.client.getHabbo().hasPermission(Permission.ACC_MODTOOL_TICKET_Q); GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId()); if (member == null) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestNewNavigatorRoomsEvent.java b/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestNewNavigatorRoomsEvent.java index 4fb1dec0..28a18a2b 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestNewNavigatorRoomsEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/navigator/RequestNewNavigatorRoomsEvent.java @@ -123,7 +123,7 @@ public class RequestNewNavigatorRoomsEvent extends MessageHandler { } } - SearchResultList list = new SearchResultList(0, "query", "", SearchAction.NONE, ListMode.LIST, DisplayMode.VISIBLE, new ArrayList(searchRooms.values()), true, this.client.getHabbo().hasPermission("acc_enter_anyroom") || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER), DisplayOrder.ACTIVITY, -1); + SearchResultList list = new SearchResultList(0, "query", "", SearchAction.NONE, ListMode.LIST, DisplayMode.VISIBLE, new ArrayList(searchRooms.values()), true, this.client.getHabbo().hasPermission(Permission.ACC_ENTERANYROOM) || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER), DisplayOrder.ACTIVITY, -1); nList.add(list); return nList; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomBackgroundEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomBackgroundEvent.java index 038eba01..a53c8f1b 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomBackgroundEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomBackgroundEvent.java @@ -1,6 +1,7 @@ package com.eu.habbo.messages.incoming.rooms; import com.eu.habbo.Emulator; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.incoming.MessageHandler; @@ -15,7 +16,7 @@ public class RoomBackgroundEvent extends MessageHandler { if (room == null) return; - if (room.hasRights(this.client.getHabbo()) || this.client.getHabbo().hasPermission("acc_placefurni")) { + if (room.hasRights(this.client.getHabbo()) || this.client.getHabbo().hasPermission(Permission.ACC_PLACEFURNI)) { HabboItem item = room.getHabboItem(itemId); if (item == null) diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomPlacePaintEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomPlacePaintEvent.java index 6ec977c7..74855056 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomPlacePaintEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomPlacePaintEvent.java @@ -2,6 +2,7 @@ package com.eu.habbo.messages.incoming.rooms; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.achievements.AchievementManager; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.HabboItem; import com.eu.habbo.messages.incoming.MessageHandler; @@ -16,7 +17,7 @@ public class RoomPlacePaintEvent extends MessageHandler { Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); - if (room.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || room.hasRights(this.client.getHabbo()) || this.client.getHabbo().hasPermission("acc_placefurni")) { + if (room.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || room.hasRights(this.client.getHabbo()) || this.client.getHabbo().hasPermission(Permission.ACC_PLACEFURNI)) { int itemId = this.packet.readInt(); HabboItem item = this.client.getHabbo().getInventory().getItemsComponent().getHabboItem(itemId); diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomStaffPickEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomStaffPickEvent.java index 4a1ba8b8..0e3e320d 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomStaffPickEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/RoomStaffPickEvent.java @@ -3,6 +3,7 @@ package com.eu.habbo.messages.incoming.rooms; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.achievements.AchievementManager; import com.eu.habbo.habbohotel.navigation.NavigatorPublicCategory; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; @@ -11,7 +12,7 @@ import com.eu.habbo.messages.outgoing.rooms.RoomDataComposer; public class RoomStaffPickEvent extends MessageHandler { @Override public void handle() throws Exception { - if (this.client.getHabbo().hasPermission("acc_staff_pick")) { + if (this.client.getHabbo().hasPermission(Permission.ACC_STAFF_PICK)) { int roomId = this.packet.readInt(); Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(roomId); diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java index aea766c0..2d217924 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/bots/BotSaveSettingsEvent.java @@ -80,7 +80,7 @@ public class BotSaveSettingsEvent extends MessageHandler { String result = Emulator.getGameEnvironment().getWordFilter().filter(s, null); if (!result.isEmpty()) { - if (!this.client.getHabbo().hasPermission("acc_chat_no_filter")) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_CHAT_NO_FILTER)) { result = Emulator.getGameEnvironment().getWordFilter().filter(result, this.client.getHabbo()); } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoveWallItemEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoveWallItemEvent.java index b583cff8..bb260add 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoveWallItemEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoveWallItemEvent.java @@ -1,5 +1,6 @@ package com.eu.habbo.messages.incoming.rooms.items; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.FurnitureMovementError; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.HabboItem; @@ -15,7 +16,7 @@ public class MoveWallItemEvent extends MessageHandler { if (room == null) return; - if (!room.hasRights(this.client.getHabbo()) && !this.client.getHabbo().hasPermission("acc_placefurni") && !(room.getGuildId() > 0 && room.guildRightLevel(this.client.getHabbo()) >= 2)) { + if (!room.hasRights(this.client.getHabbo()) && !this.client.getHabbo().hasPermission(Permission.ACC_PLACEFURNI) && !(room.getGuildId() > 0 && room.guildRightLevel(this.client.getHabbo()) >= 2)) { this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FURNITURE_PLACEMENT_ERROR.key, FurnitureMovementError.NO_RIGHTS.errorCode)); return; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java index 29dd53f6..58dd3aa3 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java @@ -26,7 +26,7 @@ public class PetPickupEvent extends MessageHandler { if (pet != null) { if (this.client.getHabbo().getHabboInfo().getId() == pet.getId() || room.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) { - if (this.client.getHabbo().getInventory().getPetsComponent().getPets().size() >= Emulator.getConfig().getInt("hotel.pets.max.inventory") && !this.client.getHabbo().hasPermission("acc_unlimited_pets")) { + if (this.client.getHabbo().getInventory().getPetsComponent().getPets().size() >= Emulator.getConfig().getInt("hotel.pets.max.inventory") && !this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_PETS)) { this.client.sendResponse(new RoomUserWhisperComposer(new RoomChatMessage(Emulator.getTexts().getValue("error.pets.max.inventory"), this.client.getHabbo(), this.client.getHabbo(), RoomChatMessageBubbles.ALERT))); return; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPlaceEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPlaceEvent.java index b43f8ab7..2af5c3af 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPlaceEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPlaceEvent.java @@ -17,7 +17,7 @@ public class PetPlaceEvent extends MessageHandler { if (room == null) return; - if (this.client.getHabbo().getHabboInfo().getId() != room.getOwnerId() && !room.isAllowPets() && !(this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER) || this.client.getHabbo().hasPermission("acc_placefurni"))) { + if (this.client.getHabbo().getHabboInfo().getId() != room.getOwnerId() && !room.isAllowPets() && !(this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER) || this.client.getHabbo().hasPermission(Permission.ACC_PLACEFURNI))) { this.client.sendResponse(new PetErrorComposer(PetErrorComposer.ROOM_ERROR_PETS_FORBIDDEN_IN_FLAT)); return; } @@ -29,7 +29,7 @@ public class PetPlaceEvent extends MessageHandler { if (pet == null) { return; } - if (room.getCurrentPets().size() >= Room.MAXIMUM_PETS && !this.client.getHabbo().hasPermission("acc_unlimited_pets")) { + if (room.getCurrentPets().size() >= Room.MAXIMUM_PETS && !this.client.getHabbo().hasPermission(Permission.ACC_UNLIMITED_PETS)) { this.client.sendResponse(new PetErrorComposer(PetErrorComposer.ROOM_ERROR_MAX_PETS)); return; } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/promotions/BuyRoomPromotionEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/promotions/BuyRoomPromotionEvent.java index 2fa40246..511f9829 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/promotions/BuyRoomPromotionEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/promotions/BuyRoomPromotionEvent.java @@ -3,6 +3,7 @@ package com.eu.habbo.messages.incoming.rooms.promotions; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.catalog.CatalogItem; import com.eu.habbo.habbohotel.catalog.CatalogPage; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.messages.incoming.MessageHandler; import com.eu.habbo.messages.outgoing.catalog.AlertPurchaseFailedComposer; @@ -45,11 +46,11 @@ public class BuyRoomPromotionEvent extends MessageHandler { } if (room.isPromoted()) { - if (!this.client.getHabbo().hasPermission("acc_infinite_credits")) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS)) { this.client.getHabbo().giveCredits(-item.getCredits()); } - if (!this.client.getHabbo().hasPermission("acc_infinite_points")) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_INFINITE_POINTS)) { this.client.getHabbo().givePoints(item.getPointsType(), -item.getPoints()); } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserKickEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserKickEvent.java index 210a8d94..814b0599 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserKickEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserKickEvent.java @@ -41,7 +41,7 @@ public class RoomUserKickEvent extends MessageHandler { if (event.isCancelled()) return; - if (room.hasRights(this.client.getHabbo()) || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER) || this.client.getHabbo().hasPermission("acc_ambassador")) { + if (room.hasRights(this.client.getHabbo()) || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER) || this.client.getHabbo().hasPermission(Permission.ACC_AMBASSADOR)) { if (target.hasPermission(Permission.ACC_UNKICKABLE)) return; room.kickHabbo(target, true); diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserMuteEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserMuteEvent.java index 7c6a770c..8acca3b2 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserMuteEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/users/RoomUserMuteEvent.java @@ -2,6 +2,7 @@ package com.eu.habbo.messages.incoming.rooms.users; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.achievements.AchievementManager; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.incoming.MessageHandler; @@ -17,7 +18,7 @@ public class RoomUserMuteEvent extends MessageHandler { Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(roomId); if (room != null) { - if (room.hasRights(this.client.getHabbo()) || this.client.getHabbo().hasPermission("cmd_mute") || this.client.getHabbo().hasPermission("acc_ambassador")) { + if (room.hasRights(this.client.getHabbo()) || this.client.getHabbo().hasPermission("cmd_mute") || this.client.getHabbo().hasPermission(Permission.ACC_AMBASSADOR)) { Habbo habbo = room.getHabbo(userId); if (habbo != null) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/trading/TradeStartEvent.java b/src/main/java/com/eu/habbo/messages/incoming/trading/TradeStartEvent.java index c9c5cdb5..836424c5 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/trading/TradeStartEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/trading/TradeStartEvent.java @@ -1,6 +1,7 @@ package com.eu.habbo.messages.incoming.trading; import com.eu.habbo.Emulator; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.Room; import com.eu.habbo.habbohotel.rooms.RoomTrade; import com.eu.habbo.habbohotel.rooms.RoomUnitStatus; @@ -20,7 +21,7 @@ public class TradeStartEvent extends MessageHandler { if (userId >= 0 && userId != this.client.getHabbo().getRoomUnit().getId()) { Habbo targetUser = room.getHabboByRoomUnitId(userId); - boolean tradeAnywhere = this.client.getHabbo().hasPermission("acc_trade_anywhere"); + boolean tradeAnywhere = this.client.getHabbo().hasPermission(Permission.ACC_TRADE_ANYWHERE); if (!RoomTrade.TRADING_ENABLED && !tradeAnywhere) { this.client.sendResponse(new TradeStartFailComposer(TradeStartFailComposer.HOTEL_TRADING_NOT_ALLOWED)); diff --git a/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java b/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java index 7557b387..46f6ab53 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/users/ChangeChatBubbleEvent.java @@ -1,6 +1,7 @@ package com.eu.habbo.messages.incoming.users; import com.eu.habbo.Emulator; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles; import com.eu.habbo.messages.incoming.MessageHandler; @@ -9,7 +10,7 @@ public class ChangeChatBubbleEvent extends MessageHandler { public void handle() throws Exception { int chatBubble = this.packet.readInt(); - if (!this.client.getHabbo().hasPermission("acc_anychatcolor")) { + if (!this.client.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) { for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) { if (Integer.valueOf(s) == chatBubble) { return; diff --git a/src/main/java/com/eu/habbo/messages/incoming/wired/WiredConditionSaveDataEvent.java b/src/main/java/com/eu/habbo/messages/incoming/wired/WiredConditionSaveDataEvent.java index 80302599..93972ee1 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/wired/WiredConditionSaveDataEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/wired/WiredConditionSaveDataEvent.java @@ -15,7 +15,7 @@ public class WiredConditionSaveDataEvent extends MessageHandler { Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); if (room != null) { - if (room.hasRights(this.client.getHabbo()) || room.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER) || this.client.getHabbo().hasPermission("acc_moverotate")) { + if (room.hasRights(this.client.getHabbo()) || room.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER) || this.client.getHabbo().hasPermission(Permission.ACC_MOVEROTATE)) { InteractionWiredCondition condition = room.getRoomSpecialTypes().getCondition(itemId); if (condition != null) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/wired/WiredEffectSaveDataEvent.java b/src/main/java/com/eu/habbo/messages/incoming/wired/WiredEffectSaveDataEvent.java index 0ad93f85..98ace187 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/wired/WiredEffectSaveDataEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/wired/WiredEffectSaveDataEvent.java @@ -15,7 +15,7 @@ public class WiredEffectSaveDataEvent extends MessageHandler { Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); if (room != null) { - if (room.hasRights(this.client.getHabbo()) || room.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER) || this.client.getHabbo().hasPermission("acc_moverotate")) { + if (room.hasRights(this.client.getHabbo()) || room.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER) || this.client.getHabbo().hasPermission(Permission.ACC_MOVEROTATE)) { InteractionWiredEffect effect = room.getRoomSpecialTypes().getEffect(itemId); if (effect != null) { diff --git a/src/main/java/com/eu/habbo/messages/incoming/wired/WiredTriggerSaveDataEvent.java b/src/main/java/com/eu/habbo/messages/incoming/wired/WiredTriggerSaveDataEvent.java index c25591b2..8f62f60e 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/wired/WiredTriggerSaveDataEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/wired/WiredTriggerSaveDataEvent.java @@ -15,7 +15,7 @@ public class WiredTriggerSaveDataEvent extends MessageHandler { Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); if (room != null) { - if (room.hasRights(this.client.getHabbo()) || room.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER) || this.client.getHabbo().hasPermission("acc_moverotate")) { + if (room.hasRights(this.client.getHabbo()) || room.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER) || this.client.getHabbo().hasPermission(Permission.ACC_MOVEROTATE)) { InteractionWiredTrigger trigger = room.getRoomSpecialTypes().getTrigger(itemId); if (trigger != null) { diff --git a/src/main/java/com/eu/habbo/messages/outgoing/catalog/CatalogPagesListComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/catalog/CatalogPagesListComposer.java index a6bb52ca..829c48b3 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/catalog/CatalogPagesListComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/catalog/CatalogPagesListComposer.java @@ -2,6 +2,7 @@ package com.eu.habbo.messages.outgoing.catalog; import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.catalog.CatalogPage; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; @@ -21,7 +22,7 @@ public class CatalogPagesListComposer extends MessageComposer { public CatalogPagesListComposer(Habbo habbo, String mode) { this.habbo = habbo; this.mode = mode; - this.hasPermission = this.habbo.hasPermission("acc_catalog_ids"); + this.hasPermission = this.habbo.hasPermission(Permission.ACC_CATALOG_IDS); } @Override diff --git a/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildInfoComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildInfoComposer.java index a4d2206f..768e85ba 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildInfoComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/guilds/GuildInfoComposer.java @@ -5,6 +5,7 @@ import com.eu.habbo.habbohotel.guilds.Guild; import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildMembershipStatus; import com.eu.habbo.habbohotel.guilds.GuildRank; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; import com.eu.habbo.messages.outgoing.Outgoing; @@ -27,7 +28,7 @@ public class GuildInfoComposer extends MessageComposer { @Override protected ServerMessage composeInternal() { - boolean adminPermissions = this.client.getHabbo().getHabboStats().hasGuild(this.guild.getId()) && this.client.getHabbo().hasPermission("acc_guild_admin"); + boolean adminPermissions = this.client.getHabbo().getHabboStats().hasGuild(this.guild.getId()) && this.client.getHabbo().hasPermission(Permission.ACC_GUILD_ADMIN); this.response.init(Outgoing.GuildInfoComposer); this.response.appendInt(this.guild.getId()); this.response.appendBoolean(true); diff --git a/src/main/java/com/eu/habbo/messages/outgoing/guilds/forums/GuildForumDataComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/guilds/forums/GuildForumDataComposer.java index db555561..8e03ebd3 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/guilds/forums/GuildForumDataComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/guilds/forums/GuildForumDataComposer.java @@ -6,6 +6,7 @@ import com.eu.habbo.habbohotel.guilds.GuildMember; import com.eu.habbo.habbohotel.guilds.GuildRank; import com.eu.habbo.habbohotel.guilds.forums.ForumThread; import com.eu.habbo.habbohotel.guilds.forums.ForumThreadComment; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; @@ -107,7 +108,7 @@ public class GuildForumDataComposer extends MessageComposer { GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, habbo); boolean isAdmin = member != null && (member.getRank().type < GuildRank.MEMBER.type || guild.getOwnerId() == this.habbo.getHabboInfo().getId()); - boolean isStaff = this.habbo.hasPermission("acc_modtool_ticket_q"); + boolean isStaff = this.habbo.hasPermission(Permission.ACC_MODTOOL_TICKET_Q); String errorRead = ""; String errorPost = ""; diff --git a/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolComposer.java index d534ffef..aacc82af 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/modtool/ModToolComposer.java @@ -4,6 +4,7 @@ import com.eu.habbo.Emulator; import com.eu.habbo.habbohotel.modtool.ModToolCategory; import com.eu.habbo.habbohotel.modtool.ModToolIssue; import com.eu.habbo.habbohotel.modtool.ModToolTicketState; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; @@ -25,7 +26,7 @@ public class ModToolComposer extends MessageComposer implements TObjectProcedure protected ServerMessage composeInternal() { this.response.init(Outgoing.ModToolComposer); - if (this.habbo.hasPermission("acc_modtool_ticket_q")) { + if (this.habbo.hasPermission(Permission.ACC_MODTOOL_TICKET_Q)) { THashSet openTickets = new THashSet<>(); THashMap tickets = Emulator.getGameEnvironment().getModToolManager().getTickets(); @@ -63,13 +64,13 @@ public class ModToolComposer extends MessageComposer implements TObjectProcedure Emulator.getGameEnvironment().getModToolManager().getCategory().forEachValue(this); - this.response.appendBoolean(this.habbo.hasPermission("acc_modtool_ticket_q")); //ticketQueueueuhuehuehuehue - this.response.appendBoolean(this.habbo.hasPermission("acc_modtool_user_logs")); //user chatlogs - this.response.appendBoolean(this.habbo.hasPermission("acc_modtool_user_alert")); //can send caution - this.response.appendBoolean(this.habbo.hasPermission("acc_modtool_user_kick")); //can send kick - this.response.appendBoolean(this.habbo.hasPermission("acc_modtool_user_ban")); //can send ban - this.response.appendBoolean(this.habbo.hasPermission("acc_modtool_room_info")); //room info ??Not sure - this.response.appendBoolean(this.habbo.hasPermission("acc_modtool_room_logs")); //room chatlogs ??Not sure + this.response.appendBoolean(this.habbo.hasPermission(Permission.ACC_MODTOOL_TICKET_Q)); //ticketQueueueuhuehuehuehue + this.response.appendBoolean(this.habbo.hasPermission(Permission.ACC_MODTOOL_USER_LOGS)); //user chatlogs + this.response.appendBoolean(this.habbo.hasPermission(Permission.ACC_MODTOOL_USER_ALERT)); //can send caution + this.response.appendBoolean(this.habbo.hasPermission(Permission.ACC_MODTOOL_USER_KICK)); //can send kick + this.response.appendBoolean(this.habbo.hasPermission(Permission.ACC_MODTOOL_USER_BAN)); //can send ban + this.response.appendBoolean(this.habbo.hasPermission(Permission.ACC_MODTOOL_ROOM_INFO)); //room info ??Not sure + this.response.appendBoolean(this.habbo.hasPermission(Permission.ACC_MODTOOL_ROOM_LOGS)); //room chatlogs ??Not sure synchronized (Emulator.getGameEnvironment().getModToolManager().getPresets()) { this.response.appendInt(Emulator.getGameEnvironment().getModToolManager().getPresets().get("room").size()); diff --git a/src/main/java/com/eu/habbo/messages/outgoing/users/UserPerksComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/users/UserPerksComposer.java index d8d3262d..7c81d3c2 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/users/UserPerksComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/users/UserPerksComposer.java @@ -1,6 +1,7 @@ package com.eu.habbo.messages.outgoing.users; import com.eu.habbo.Emulator; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; @@ -20,7 +21,7 @@ public class UserPerksComposer extends MessageComposer { this.response.appendString("USE_GUIDE_TOOL"); this.response.appendString("requirement.unfulfilled.helper_level_4"); - this.response.appendBoolean(Emulator.getGameEnvironment().getPermissionsManager().hasPermission(this.habbo, "acc_helper_use_guide_tool")); + this.response.appendBoolean(Emulator.getGameEnvironment().getPermissionsManager().hasPermission(this.habbo, Permission.ACC_HELPER_USE_GUIDE_TOOL)); this.response.appendString("GIVE_GUIDE_TOURS"); this.response.appendString(""); @@ -48,7 +49,7 @@ public class UserPerksComposer extends MessageComposer { this.response.appendString("HEIGHTMAP_EDITOR_BETA"); this.response.appendString("requirement.unfulfilled.feature_disabled"); - this.response.appendBoolean(Emulator.getGameEnvironment().getPermissionsManager().hasPermission(this.habbo, "acc_floorplan_editor")); + this.response.appendBoolean(Emulator.getGameEnvironment().getPermissionsManager().hasPermission(this.habbo, Permission.ACC_FLOORPLAN_EDITOR)); this.response.appendString("BUILDER_AT_WORK"); this.response.appendString(""); diff --git a/src/main/java/com/eu/habbo/messages/outgoing/users/UserPermissionsComposer.java b/src/main/java/com/eu/habbo/messages/outgoing/users/UserPermissionsComposer.java index 4a0d13d4..d7c5809e 100644 --- a/src/main/java/com/eu/habbo/messages/outgoing/users/UserPermissionsComposer.java +++ b/src/main/java/com/eu/habbo/messages/outgoing/users/UserPermissionsComposer.java @@ -1,5 +1,6 @@ package com.eu.habbo.messages.outgoing.users; +import com.eu.habbo.habbohotel.permissions.Permission; import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.messages.ServerMessage; import com.eu.habbo.messages.outgoing.MessageComposer; @@ -20,7 +21,7 @@ public class UserPermissionsComposer extends MessageComposer { this.response.init(Outgoing.UserPermissionsComposer); this.response.appendInt(this.clubLevel); this.response.appendInt(this.habbo.getHabboInfo().getRank().getLevel()); - this.response.appendBoolean(this.habbo.hasPermission("acc_ambassador")); + this.response.appendBoolean(this.habbo.hasPermission(Permission.ACC_AMBASSADOR)); return this.response; } }