Merge branch 'dev' into 'fix-bot-limit'

# Conflicts:
#   src/main/java/com/eu/habbo/habbohotel/bots/BotManager.java
#   src/main/java/com/eu/habbo/messages/incoming/catalog/CatalogBuyItemEvent.java
#   src/main/java/com/eu/habbo/messages/incoming/rooms/pets/PetPickupEvent.java
This commit is contained in:
Harmonic 2020-06-05 11:36:39 -04:00
commit 93b46b468b
65 changed files with 195 additions and 111 deletions

View File

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

View File

@ -112,8 +112,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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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<RoomTile> 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;
}

View File

@ -19,7 +19,7 @@ public class NavigatorHotelFilter extends NavigatorFilter {
@Override
public List<SearchResultList> 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<SearchResultList> resultLists = new ArrayList<>();
int i = 0;
@ -41,7 +41,7 @@ public class NavigatorHotelFilter extends NavigatorFilter {
@Override
public List<SearchResultList> 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<SearchResultList> resultLists = new ArrayList<>();
int i = 0;

View File

@ -16,7 +16,7 @@ public class NavigatorPublicFilter extends NavigatorFilter {
@Override
public List<SearchResultList> 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<SearchResultList> resultLists = new ArrayList<>();
int i = 0;

View File

@ -16,7 +16,7 @@ public class NavigatorRoomAdsFilter extends NavigatorFilter {
@Override
public List<SearchResultList> 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<SearchResultList> 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;

View File

@ -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";

View File

@ -1197,7 +1197,7 @@ public class Room implements Comparable<Room>, 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--;
@ -3040,6 +3040,20 @@ public class Room implements Comparable<Room>, 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) {
@ -3074,14 +3088,14 @@ public class Room implements Comparable<Room>, 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;
}
@ -3146,13 +3160,13 @@ public class Room implements Comparable<Room>, 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 ||
@ -4215,7 +4229,7 @@ public class Room implements Comparable<Room>, 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);
}
}

View File

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

View File

@ -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;
}

View File

@ -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;
}

View File

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

View File

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

View File

@ -9,7 +9,6 @@ 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.pets.PetManager;
import com.eu.habbo.habbohotel.users.HabboBadge;
import com.eu.habbo.habbohotel.users.HabboInventory;
import com.eu.habbo.messages.incoming.MessageHandler;
@ -20,6 +19,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;
@ -85,22 +85,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 -> {
@ -162,10 +169,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())

View File

@ -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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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, "")));

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -123,7 +123,7 @@ public class RequestNewNavigatorRoomsEvent extends MessageHandler {
}
}
SearchResultList list = new SearchResultList(0, "query", "", SearchAction.NONE, ListMode.LIST, DisplayMode.VISIBLE, new ArrayList<Room>(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<Room>(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;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -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;
}

View File

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

View File

@ -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;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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 = "";

View File

@ -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<ModToolIssue> openTickets = new THashSet<>();
THashMap<Integer, ModToolIssue> 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());

View File

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

View File

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

View File

@ -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;
}
}