mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-31 12:22:36 +01:00
Fixed Permissions Reloading and more cleanup
This commit is contained in:
parent
cb154377e9
commit
e2b0299aec
@ -112,8 +112,8 @@ public class BotManager {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (room != null && bot != null && habbo != null) {
|
if (room != null && bot != null && habbo != null) {
|
||||||
if (room.getRoomInfo().isRoomOwner(habbo) || habbo.hasRight(Permission.ACC_ANYROOMOWNER) || habbo.hasRight(Permission.ACC_PLACEFURNI)) {
|
if (room.getRoomInfo().isRoomOwner(habbo) || habbo.hasPermissionRight(Permission.ACC_ANYROOMOWNER) || habbo.hasPermissionRight(Permission.ACC_PLACEFURNI)) {
|
||||||
if (room.getRoomUnitManager().getCurrentRoomBots().size() >= Room.MAXIMUM_BOTS && !habbo.hasRight(Permission.ACC_UNLIMITED_BOTS)) {
|
if (room.getRoomUnitManager().getCurrentRoomBots().size() >= Room.MAXIMUM_BOTS && !habbo.hasPermissionRight(Permission.ACC_UNLIMITED_BOTS)) {
|
||||||
habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_MAX_BOTS));
|
habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_MAX_BOTS));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -184,8 +184,8 @@ public class BotManager {
|
|||||||
if (pickedUpEvent.isCancelled())
|
if (pickedUpEvent.isCancelled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (habbo == null || (bot.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasRight(Permission.ACC_ANYROOMOWNER))) {
|
if (habbo == null || (bot.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermissionRight(Permission.ACC_ANYROOMOWNER))) {
|
||||||
if (habbo != null && !habbo.hasRight(Permission.ACC_UNLIMITED_BOTS) && habbo.getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) {
|
if (habbo != null && !habbo.hasPermissionRight(Permission.ACC_UNLIMITED_BOTS) && habbo.getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) {
|
||||||
habbo.alert(Emulator.getTexts().getValue("error.bots.max.inventory").replace("%amount%", BotManager.MAXIMUM_BOT_INVENTORY_SIZE + ""));
|
habbo.alert(Emulator.getTexts().getValue("error.bots.max.inventory").replace("%amount%", BotManager.MAXIMUM_BOT_INVENTORY_SIZE + ""));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ public class CalendarManager {
|
|||||||
|
|
||||||
if (object == null) return;
|
if (object == null) return;
|
||||||
long daysBetween = ChronoUnit.DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant());
|
long daysBetween = ChronoUnit.DAYS.between(new Timestamp(campaign.getStartTimestamp() * 1000L).toInstant(), new Date().toInstant());
|
||||||
if (((daysBetween >= 0 && daysBetween <= campaign.getTotalDays()) && (((daysBetween - day <= 2 || !campaign.getLockExpired()) && daysBetween - day >= 0)) || (force && habbo.hasRight(Permission.ACC_CALENDAR_FORCE)))) {
|
if (((daysBetween >= 0 && daysBetween <= campaign.getTotalDays()) && (((daysBetween - day <= 2 || !campaign.getLockExpired()) && daysBetween - day >= 0)) || (force && habbo.hasPermissionRight(Permission.ACC_CALENDAR_FORCE)))) {
|
||||||
if (Emulator.getPluginManager().fireEvent(new UserClaimRewardEvent(habbo, campaign, day, object, force)).isCancelled()) {
|
if (Emulator.getPluginManager().fireEvent(new UserClaimRewardEvent(habbo, campaign, day, object, force)).isCancelled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1050,12 +1050,12 @@ public class CatalogManager {
|
|||||||
UserCatalogItemPurchasedEvent purchasedEvent = new UserCatalogItemPurchasedEvent(habbo, item, itemsList, totalCredits, totalPoints, badges);
|
UserCatalogItemPurchasedEvent purchasedEvent = new UserCatalogItemPurchasedEvent(habbo, item, itemsList, totalCredits, totalPoints, badges);
|
||||||
Emulator.getPluginManager().fireEvent(purchasedEvent);
|
Emulator.getPluginManager().fireEvent(purchasedEvent);
|
||||||
|
|
||||||
if (!free && !habbo.getClient().getHabbo().hasRight(Permission.ACC_INFINITE_CREDITS) && purchasedEvent.getTotalCredits() > 0) {
|
if (!free && !habbo.getClient().getHabbo().hasPermissionRight(Permission.ACC_INFINITE_CREDITS) && purchasedEvent.getTotalCredits() > 0) {
|
||||||
habbo.getClient().getHabbo().getHabboInfo().addCredits(-purchasedEvent.getTotalCredits());
|
habbo.getClient().getHabbo().getHabboInfo().addCredits(-purchasedEvent.getTotalCredits());
|
||||||
habbo.getClient().sendResponse(new CreditBalanceComposer(habbo.getClient().getHabbo()));
|
habbo.getClient().sendResponse(new CreditBalanceComposer(habbo.getClient().getHabbo()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!free && !habbo.getClient().getHabbo().hasRight(Permission.ACC_INFINITE_POINTS) && purchasedEvent.getTotalPoints() > 0) {
|
if (!free && !habbo.getClient().getHabbo().hasPermissionRight(Permission.ACC_INFINITE_POINTS) && purchasedEvent.getTotalPoints() > 0) {
|
||||||
habbo.getClient().getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -purchasedEvent.getTotalPoints());
|
habbo.getClient().getHabbo().getHabboInfo().addCurrencyAmount(item.getPointsType(), -purchasedEvent.getTotalPoints());
|
||||||
habbo.getClient().sendResponse(new HabboActivityPointNotificationMessageComposer(habbo.getClient().getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -purchasedEvent.getTotalPoints(), item.getPointsType()));
|
habbo.getClient().sendResponse(new HabboActivityPointNotificationMessageComposer(habbo.getClient().getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -purchasedEvent.getTotalPoints(), item.getPointsType()));
|
||||||
}
|
}
|
||||||
|
@ -87,13 +87,16 @@ public class CommandsManager {
|
|||||||
|
|
||||||
String commandKey = parts[0];
|
String commandKey = parts[0];
|
||||||
Room currentRoom = gameClient.getHabbo().getRoomUnit().getRoom();
|
Room currentRoom = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
boolean hasRights = currentRoom != null &&
|
|
||||||
(currentRoom.getRoomRightsManager().hasRights(gameClient.getHabbo())) ||
|
|
||||||
gameClient.getHabbo().hasRight(Permission.ACC_PLACEFURNI) ||
|
|
||||||
currentRoom.getRoomInfo().getGuild().getId() > 0 && currentRoom.getGuildRightLevel(gameClient.getHabbo()).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS);
|
|
||||||
|
|
||||||
|
if(currentRoom == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!gameClient.getHabbo().canExecuteCommand(commandKey, hasRights)) {
|
boolean hasRights = (currentRoom.getRoomRightsManager().hasRights(gameClient.getHabbo())) || gameClient.getHabbo().hasPermissionRight(Permission.ACC_PLACEFURNI) || (currentRoom.getRoomInfo().hasGuild() && currentRoom.getGuildRightLevel(gameClient.getHabbo()).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS));
|
||||||
|
|
||||||
|
boolean canExecuteCommand = gameClient.getHabbo().canExecuteCommand(commandKey, hasRights);
|
||||||
|
|
||||||
|
if (!canExecuteCommand) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ public class CalendarCommand extends Command {
|
|||||||
if (Emulator.getConfig().getBoolean("hotel.calendar.enabled")) {
|
if (Emulator.getConfig().getBoolean("hotel.calendar.enabled")) {
|
||||||
String campaignName = Emulator.getConfig().getValue("hotel.calendar.default");
|
String campaignName = Emulator.getConfig().getValue("hotel.calendar.default");
|
||||||
|
|
||||||
if (params.length > 1 && gameClient.getHabbo().hasCommand("cmd_calendar_staff")) {
|
if (params.length > 1 && gameClient.getHabbo().canExecuteCommand("cmd_calendar_staff")) {
|
||||||
campaignName = params[1];
|
campaignName = params[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ public class ChatTypeCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gameClient.getHabbo().hasRight(Permission.ACC_ANYCHATCOLOR)) {
|
if (!gameClient.getHabbo().hasPermissionRight(Permission.ACC_ANYCHATCOLOR)) {
|
||||||
for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) {
|
for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) {
|
||||||
if (Integer.parseInt(s) == chatColor) {
|
if (Integer.parseInt(s) == chatColor) {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_chatcolor.banned"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_chatcolor.banned"), RoomChatMessageBubbles.ALERT);
|
||||||
|
@ -32,7 +32,7 @@ public class EmptyBotsInventoryCommand extends Command {
|
|||||||
|
|
||||||
if (params.length >= 2 && params[1].equalsIgnoreCase(getTextsValue("generic.yes"))) {
|
if (params.length >= 2 && params[1].equalsIgnoreCase(getTextsValue("generic.yes"))) {
|
||||||
|
|
||||||
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasPermissionRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
TIntObjectHashMap<Bot> bots = new TIntObjectHashMap<>();
|
TIntObjectHashMap<Bot> bots = new TIntObjectHashMap<>();
|
||||||
|
@ -34,7 +34,7 @@ public class EmptyInventoryCommand extends Command {
|
|||||||
|
|
||||||
if (params.length >= 2 && params[1].equalsIgnoreCase(getTextsValue("generic.yes"))) {
|
if (params.length >= 2 && params[1].equalsIgnoreCase(getTextsValue("generic.yes"))) {
|
||||||
|
|
||||||
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasPermissionRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
TIntObjectMap<RoomItem> items = new TIntObjectHashMap<>();
|
TIntObjectMap<RoomItem> items = new TIntObjectHashMap<>();
|
||||||
|
@ -32,7 +32,7 @@ public class EmptyPetsInventoryCommand extends Command {
|
|||||||
|
|
||||||
if (params.length >= 2 && params[1].equalsIgnoreCase(getTextsValue("generic.yes"))) {
|
if (params.length >= 2 && params[1].equalsIgnoreCase(getTextsValue("generic.yes"))) {
|
||||||
|
|
||||||
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasPermissionRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
TIntObjectHashMap<Pet> pets = new TIntObjectHashMap<>(habbo.getInventory().getPetsComponent().getPets());
|
TIntObjectHashMap<Pet> pets = new TIntObjectHashMap<>(habbo.getInventory().getPetsComponent().getPets());
|
||||||
|
@ -31,7 +31,7 @@ public class EnableCommand extends Command {
|
|||||||
if (target == null) {
|
if (target == null) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (target == gameClient.getHabbo() || gameClient.getHabbo().hasRight(Permission.ACC_ENABLE_OTHERS)) {
|
if (target == gameClient.getHabbo() || gameClient.getHabbo().hasPermissionRight(Permission.ACC_ENABLE_OTHERS)) {
|
||||||
try {
|
try {
|
||||||
if (target.getRoomUnit().getRoom() != null && target.getHabboInfo().getRiding() == null) {
|
if (target.getRoomUnit().getRoom() != null && target.getHabboInfo().getRiding() == null) {
|
||||||
if (Emulator.getGameEnvironment().getPermissionsManager().isEffectBlocked(effectId, target.getHabboInfo().getPermissionGroup().getId())) {
|
if (Emulator.getGameEnvironment().getPermissionsManager().isEffectBlocked(effectId, target.getHabboInfo().getPermissionGroup().getId())) {
|
||||||
|
@ -17,7 +17,7 @@ public class FreezeBotsCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gameClient.getHabbo().getHabboInfo().getId() == gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getOwnerInfo().getId()
|
if (gameClient.getHabbo().getHabboInfo().getId() == gameClient.getHabbo().getRoomUnit().getRoom().getRoomInfo().getOwnerInfo().getId()
|
||||||
|| gameClient.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)) {
|
|| gameClient.getHabbo().hasPermissionRight(Permission.ACC_ANYROOMOWNER)) {
|
||||||
gameClient.getHabbo().getRoomUnit().getRoom().setAllowBotsWalk(!gameClient.getHabbo().getRoomUnit().getRoom().isAllowBotsWalk());
|
gameClient.getHabbo().getRoomUnit().getRoom().setAllowBotsWalk(!gameClient.getHabbo().getRoomUnit().getRoom().isAllowBotsWalk());
|
||||||
gameClient.getHabbo().whisper(gameClient.getHabbo().getRoomUnit().getRoom().isAllowBotsWalk() ? getTextsValue("commands.succes.cmd_freeze_bots.unfrozen") : getTextsValue("commands.succes.cmd_freeze_bots.frozen"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(gameClient.getHabbo().getRoomUnit().getRoom().isAllowBotsWalk() ? getTextsValue("commands.succes.cmd_freeze_bots.unfrozen") : getTextsValue("commands.succes.cmd_freeze_bots.frozen"), RoomChatMessageBubbles.ALERT);
|
||||||
} else {
|
} else {
|
||||||
|
@ -20,7 +20,7 @@ public class LayCommand extends Command {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
gameClient.getHabbo().getRoomUnit().setCmdLayEnabled(true);
|
gameClient.getHabbo().getRoomUnit().setCmdLayEnabled(true);
|
||||||
gameClient.getHabbo().getRoomUnit().getRoom().updateHabbo(gameClient.getHabbo());
|
gameClient.getHabbo().getRoomUnit().getRoom().updateRoomUnit(gameClient.getHabbo().getRoomUnit());
|
||||||
gameClient.getHabbo().getRoomUnit().setCmdSitEnabled(true);
|
gameClient.getHabbo().getRoomUnit().setCmdSitEnabled(true);
|
||||||
gameClient.getHabbo().getRoomUnit().setBodyRotation(RoomRotation.values()[gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue() - gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue() % 2]);
|
gameClient.getHabbo().getRoomUnit().setBodyRotation(RoomRotation.values()[gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue() - gameClient.getHabbo().getRoomUnit().getBodyRotation().getValue() % 2]);
|
||||||
|
|
||||||
|
@ -29,10 +29,10 @@ public class MimicCommand extends Command {
|
|||||||
if (habbo == gameClient.getHabbo()) {
|
if (habbo == gameClient.getHabbo()) {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_mimic.not_self"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_mimic.not_self"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else if (habbo.hasRight(Permission.ACC_NOT_MIMICED) && !gameClient.getHabbo().hasRight(Permission.ACC_NOT_MIMICED)) {
|
} else if (habbo.hasPermissionRight(Permission.ACC_NOT_MIMICED) && !gameClient.getHabbo().hasPermissionRight(Permission.ACC_NOT_MIMICED)) {
|
||||||
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_mimic.blocked"), params[1]).replace("%gender_name%", getGenderName(habbo)), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_mimic.blocked"), params[1]).replace("%gender_name%", getGenderName(habbo)), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else if (!habbo.hasRight(Permission.ACC_MIMIC_UNREDEEMED) && FigureUtil.hasBlacklistedClothing(habbo.getHabboInfo().getLook(), gameClient.getHabbo().getForbiddenClothing())) {
|
} else if (!habbo.hasPermissionRight(Permission.ACC_MIMIC_UNREDEEMED) && FigureUtil.hasBlacklistedClothing(habbo.getHabboInfo().getLook(), gameClient.getHabbo().getForbiddenClothing())) {
|
||||||
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_mimic.forbidden_clothing"), RoomChatMessageBubbles.ALERT);
|
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_mimic.forbidden_clothing"), RoomChatMessageBubbles.ALERT);
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -25,7 +25,7 @@ public class RoomKickCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Habbo habbo : room.getRoomUnitManager().getRoomHabbos()) {
|
for (Habbo habbo : room.getRoomUnitManager().getRoomHabbos()) {
|
||||||
if (!(habbo.hasRight(Permission.ACC_UNKICKABLE) || habbo.hasRight(Permission.ACC_SUPPORTTOOL) || room.getRoomInfo().isRoomOwner(habbo))) {
|
if (!(habbo.hasPermissionRight(Permission.ACC_UNKICKABLE) || habbo.hasPermissionRight(Permission.ACC_SUPPORTTOOL) || room.getRoomInfo().isRoomOwner(habbo))) {
|
||||||
room.kickHabbo(habbo, true);
|
room.kickHabbo(habbo, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ public class SoftKickCommand extends Command {
|
|||||||
|
|
||||||
final Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
final Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
|
|
||||||
if (room != null && (!(habbo.hasRight(Permission.ACC_UNKICKABLE) || habbo.hasRight(Permission.ACC_SUPPORTTOOL) || room.getRoomInfo().isRoomOwner(habbo)))) {
|
if (room != null && (!(habbo.hasPermissionRight(Permission.ACC_UNKICKABLE) || habbo.hasPermissionRight(Permission.ACC_SUPPORTTOOL) || room.getRoomInfo().isRoomOwner(habbo)))) {
|
||||||
room.kickHabbo(habbo, false);
|
room.kickHabbo(habbo, false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package com.eu.habbo.habbohotel.commands.list;
|
package com.eu.habbo.habbohotel.commands.list;
|
||||||
|
|
||||||
import com.eu.habbo.Emulator;
|
|
||||||
import com.eu.habbo.habbohotel.commands.Command;
|
import com.eu.habbo.habbohotel.commands.Command;
|
||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
|
||||||
import com.eu.habbo.messages.ServerMessage;
|
|
||||||
|
|
||||||
public class TestCommand extends Command {
|
public class TestCommand extends Command {
|
||||||
public TestCommand() {
|
public TestCommand() {
|
||||||
@ -13,34 +10,6 @@ public class TestCommand extends Command {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL) || !Emulator.debugging)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
int header = Integer.parseInt(params[1]);
|
|
||||||
|
|
||||||
ServerMessage message = new ServerMessage(header);
|
|
||||||
|
|
||||||
for (int i = 1; i < params.length; i++) {
|
|
||||||
String[] data = params[i].split(":");
|
|
||||||
|
|
||||||
if (data[0].equalsIgnoreCase("b")) {
|
|
||||||
message.appendBoolean(data[1].equalsIgnoreCase("1"));
|
|
||||||
} else if (data[0].equalsIgnoreCase("s")) {
|
|
||||||
if (data.length > 1) {
|
|
||||||
message.appendString(data[1]);
|
|
||||||
} else {
|
|
||||||
message.appendString("");
|
|
||||||
}
|
|
||||||
} else if (data[0].equals("i")) {
|
|
||||||
message.appendInt(Integer.parseInt(data[1]));
|
|
||||||
} else if (data[0].equalsIgnoreCase("by")) {
|
|
||||||
message.appendByte(Integer.parseInt(data[1]));
|
|
||||||
} else if (data[0].equalsIgnoreCase("sh")) {
|
|
||||||
message.appendShort(Integer.parseInt(data[1]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
gameClient.sendResponse(message);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class UnloadRoomCommand extends Command {
|
|||||||
public boolean handle(GameClient gameClient, String[] params) {
|
public boolean handle(GameClient gameClient, String[] params) {
|
||||||
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
Room room = gameClient.getHabbo().getRoomUnit().getRoom();
|
||||||
|
|
||||||
if (room != null && (room.getRoomInfo().isRoomOwner(gameClient.getHabbo()) || (room.getRoomInfo().hasGuild() && room.getGuildRightLevel(gameClient.getHabbo()).equals(RoomRightLevels.GUILD_ADMIN))) || gameClient.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)) {
|
if (room != null && (room.getRoomInfo().isRoomOwner(gameClient.getHabbo()) || (room.getRoomInfo().hasGuild() && room.getGuildRightLevel(gameClient.getHabbo()).equals(RoomRightLevels.GUILD_ADMIN))) || gameClient.getHabbo().hasPermissionRight(Permission.ACC_ANYROOMOWNER)) {
|
||||||
room.dispose();
|
room.dispose();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -44,9 +44,9 @@ public class UserInfoCommand extends Command {
|
|||||||
getTextsValue("command.cmd_userinfo.motto") + ": " + habbo.getMotto().replace("<", "[").replace(">", "]") + "\r" +
|
getTextsValue("command.cmd_userinfo.motto") + ": " + habbo.getMotto().replace("<", "[").replace(">", "]") + "\r" +
|
||||||
getTextsValue("command.cmd_userinfo.rank") + ": " + habbo.getPermissionGroup().getName() + " (" + habbo.getPermissionGroup().getId() + ") \r" +
|
getTextsValue("command.cmd_userinfo.rank") + ": " + habbo.getPermissionGroup().getName() + " (" + habbo.getPermissionGroup().getId() + ") \r" +
|
||||||
getTextsValue("command.cmd_userinfo.online") + ": " + (onlineHabbo == null ? getTextsValue("generic.no") : getTextsValue("generic.yes")) + "\r" +
|
getTextsValue("command.cmd_userinfo.online") + ": " + (onlineHabbo == null ? getTextsValue("generic.no") : getTextsValue("generic.yes")) + "\r" +
|
||||||
((habbo.getPermissionGroup().hasRight(Permission.ACC_HIDE_MAIL, true)) ? "" : getTextsValue("command.cmd_userinfo.email") + ": " + habbo.getMail() + "\r") +
|
((habbo.getPermissionGroup().hasPermissionRight(Permission.ACC_HIDE_MAIL, true)) ? "" : getTextsValue("command.cmd_userinfo.email") + ": " + habbo.getMail() + "\r") +
|
||||||
((habbo.getPermissionGroup().hasRight(Permission.ACC_HIDE_IP, true)) ? "" : getTextsValue("command.cmd_userinfo.ip_register") + ": " + habbo.getIpRegister() + "\r") +
|
((habbo.getPermissionGroup().hasPermissionRight(Permission.ACC_HIDE_IP, true)) ? "" : getTextsValue("command.cmd_userinfo.ip_register") + ": " + habbo.getIpRegister() + "\r") +
|
||||||
((habbo.getPermissionGroup().hasRight(Permission.ACC_HIDE_IP, true)) || onlineHabbo == null ? "" : getTextsValue("command.cmd_userinfo.ip_current") + ": " + onlineHabbo.getHabboInfo().getIpLogin() + "\r") +
|
((habbo.getPermissionGroup().hasPermissionRight(Permission.ACC_HIDE_IP, true)) || onlineHabbo == null ? "" : getTextsValue("command.cmd_userinfo.ip_current") + ": " + onlineHabbo.getHabboInfo().getIpLogin() + "\r") +
|
||||||
(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.achievement_score") + ": " + onlineHabbo.getHabboStats().getAchievementScore() + "\r" : ""));
|
(onlineHabbo != null ? getTextsValue("command.cmd_userinfo.achievement_score") + ": " + onlineHabbo.getHabboStats().getAchievementScore() + "\r" : ""));
|
||||||
|
|
||||||
ModToolBan ban = Emulator.getGameEnvironment().getModToolManager().checkForBan(habbo.getId());
|
ModToolBan ban = Emulator.getGameEnvironment().getModToolManager().checkForBan(habbo.getId());
|
||||||
|
@ -152,7 +152,7 @@ public class GameClientManager {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (client.getHabbo() != null) {
|
if (client.getHabbo() != null) {
|
||||||
if (client.getHabbo().hasRight(minPermission)) {
|
if (client.getHabbo().hasPermissionRight(minPermission)) {
|
||||||
client.sendResponse(message);
|
client.sendResponse(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ public class InteractionGuildGate extends InteractionGuildFurni implements Condi
|
|||||||
|
|
||||||
Habbo habbo = room.getRoomUnitManager().getHabboByRoomUnit(roomUnit);
|
Habbo habbo = room.getRoomUnitManager().getHabboByRoomUnit(roomUnit);
|
||||||
|
|
||||||
return habbo != null && (habbo.getHabboStats().hasGuild(super.getGuildId()) || habbo.hasRight(Permission.ACC_GUILDGATE));
|
return habbo != null && (habbo.getHabboStats().hasGuild(super.getGuildId()) || habbo.hasPermissionRight(Permission.ACC_GUILDGATE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -3,8 +3,8 @@ package com.eu.habbo.habbohotel.items.interactions;
|
|||||||
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
import com.eu.habbo.habbohotel.rooms.Room;
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
|
||||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||||
import com.eu.habbo.messages.ServerMessage;
|
import com.eu.habbo.messages.ServerMessage;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@ -48,10 +48,10 @@ public class InteractionJukeBox extends RoomItem {
|
|||||||
|
|
||||||
if (client != null && objects.length == 1) {
|
if (client != null && objects.length == 1) {
|
||||||
if ((Integer) objects[0] == 0) {
|
if ((Integer) objects[0] == 0) {
|
||||||
if (room.getTraxManager().isPlaying()) {
|
if (room.getRoomTraxManager().isPlaying()) {
|
||||||
room.getTraxManager().stop();
|
room.getRoomTraxManager().stop();
|
||||||
} else {
|
} else {
|
||||||
room.getTraxManager().play(0, client.getHabbo());
|
room.getRoomTraxManager().play(0, client.getHabbo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -61,14 +61,14 @@ public class InteractionJukeBox extends RoomItem {
|
|||||||
public void onPickUp(Room room) {
|
public void onPickUp(Room room) {
|
||||||
super.onPickUp(room);
|
super.onPickUp(room);
|
||||||
this.setExtradata("0");
|
this.setExtradata("0");
|
||||||
room.getTraxManager().removeTraxOnRoom(this);
|
room.getRoomTraxManager().removeTraxOnRoom(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlace(Room room) {
|
public void onPlace(Room room) {
|
||||||
super.onPlace(room);
|
super.onPlace(room);
|
||||||
room.getTraxManager().addTraxOnRoom(this);
|
room.getRoomTraxManager().addTraxOnRoom(this);
|
||||||
if (room.getTraxManager().isPlaying()) {
|
if (room.getRoomTraxManager().isPlaying()) {
|
||||||
this.setExtradata("1");
|
this.setExtradata("1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@ package com.eu.habbo.habbohotel.items.interactions;
|
|||||||
|
|
||||||
import com.eu.habbo.habbohotel.items.Item;
|
import com.eu.habbo.habbohotel.items.Item;
|
||||||
import com.eu.habbo.habbohotel.rooms.Room;
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
|
||||||
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
import com.eu.habbo.habbohotel.rooms.entities.items.RoomItem;
|
||||||
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||||
import com.eu.habbo.messages.ServerMessage;
|
import com.eu.habbo.messages.ServerMessage;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@ -74,13 +74,13 @@ public class InteractionMusicDisc extends RoomItem {
|
|||||||
public void onPlace(Room room) {
|
public void onPlace(Room room) {
|
||||||
super.onPlace(room);
|
super.onPlace(room);
|
||||||
|
|
||||||
room.getTraxManager().sendUpdatedSongList();
|
room.getRoomTraxManager().sendUpdatedSongList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPickUp(Room room) {
|
public void onPickUp(Room room) {
|
||||||
super.onPickUp(room);
|
super.onPickUp(room);
|
||||||
|
|
||||||
room.getTraxManager().sendUpdatedSongList();
|
room.getRoomTraxManager().sendUpdatedSongList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ public class InteractionGameTimer extends RoomItem implements Runnable {
|
|||||||
Emulator.getThreading().run(new GameTimer(this), 1000);
|
Emulator.getThreading().run(new GameTimer(this), 1000);
|
||||||
}
|
}
|
||||||
} else if (client != null) {
|
} else if (client != null) {
|
||||||
if (!(room.getRoomRightsManager().hasRights(client.getHabbo()) || client.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)))
|
if (!(room.getRoomRightsManager().hasRights(client.getHabbo()) || client.getHabbo().hasPermissionRight(Permission.ACC_ANYROOMOWNER)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
InteractionGameTimerAction state = InteractionGameTimerAction.START_STOP;
|
InteractionGameTimerAction state = InteractionGameTimerAction.START_STOP;
|
||||||
|
@ -127,11 +127,14 @@ public class InteractionBattleBanzaiPuck extends InteractionPushable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean validMove(Room room, RoomTile from, RoomTile to) {
|
public boolean validMove(Room room, RoomTile from, RoomTile to) {
|
||||||
if (to == null) return false;
|
if (to == null) {
|
||||||
RoomItem topItem = room.getRoomItemManager().getTopItemAt(to.getX(), to.getY(), this);
|
return false;
|
||||||
return !(!room.getLayout().tileWalkable(to.getX(), to.getY()) || (topItem != null && (!topItem.getBaseItem().allowStack() || topItem.getBaseItem().allowSit() || topItem.getBaseItem().allowLay())));
|
}
|
||||||
|
|
||||||
//return !(!room.getLayout().tileWalkable(to.x, to.y) || (topItem != null && (!topItem.getBaseItem().setAllowStack() || topItem.getBaseItem().allowSit() || topItem.getBaseItem().allowLay())));
|
RoomItem topItem = room.getRoomItemManager().getTopItemAt(to.getX(), to.getY(), this);
|
||||||
|
|
||||||
|
return !(!room.getLayout().tileWalkable(to) || (topItem != null && (!topItem.getBaseItem().allowStack() || topItem.getBaseItem().allowSit() || topItem.getBaseItem().allowLay())));
|
||||||
|
//return !(!room.getLayout().tileWalkable(to.x, to.y) || (topItem != null && (!topItem.getBaseItem().setAllowStack() || topItem.getBaseItem().allowSit() || topItem.getBaseItem().allowLay())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -87,7 +87,7 @@ public class WiredEffectChangeFurniDirection extends InteractionWiredEffect {
|
|||||||
|
|
||||||
RoomTile targetTile = room.getLayout().getTileInFront(room.getLayout().getTile(item.getX(), item.getY()), setting.getDirection().getValue());
|
RoomTile targetTile = room.getLayout().getTileInFront(room.getLayout().getTile(item.getX(), item.getY()), setting.getDirection().getValue());
|
||||||
int count = 1;
|
int count = 1;
|
||||||
while ((targetTile == null || targetTile.getState() == RoomTileState.INVALID || !room.tileWalkable(targetTile) || room.getRoomItemManager().furnitureFitsAt(targetTile, item, item.getRotation(), false) != FurnitureMovementError.NONE) && count < 8) {
|
while ((targetTile == null || targetTile.getState() == RoomTileState.INVALID || !room.getLayout().tileWalkable(targetTile) || room.getRoomItemManager().furnitureFitsAt(targetTile, item, item.getRotation(), false) != FurnitureMovementError.NONE) && count < 8) {
|
||||||
setting.setDirection(this.nextDirection(setting.getDirection()));
|
setting.setDirection(this.nextDirection(setting.getDirection()));
|
||||||
|
|
||||||
RoomTile tile = room.getLayout().getTileInFront(room.getLayout().getTile(item.getX(), item.getY()), setting.getDirection().getValue());
|
RoomTile tile = room.getLayout().getTileInFront(room.getLayout().getTile(item.getX(), item.getY()), setting.getDirection().getValue());
|
||||||
|
@ -33,7 +33,7 @@ public class WiredEffectKickRoom extends InteractionWiredEffect {
|
|||||||
Habbo habbo = room.getRoomUnitManager().getHabboByRoomUnit(roomUnit);
|
Habbo habbo = room.getRoomUnitManager().getHabboByRoomUnit(roomUnit);
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
if (habbo.hasRight(Permission.ACC_UNKICKABLE)) {
|
if (habbo.hasPermissionRight(Permission.ACC_UNKICKABLE)) {
|
||||||
habbo.whisper(Emulator.getTexts().getValue("hotel.wired.kickexception.unkickable"));
|
habbo.whisper(Emulator.getTexts().getValue("hotel.wired.kickexception.unkickable"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ public class ModToolManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void alert(Habbo moderator, Habbo target, String message, SupportUserAlertedReason reason) {
|
public void alert(Habbo moderator, Habbo target, String message, SupportUserAlertedReason reason) {
|
||||||
if (!moderator.hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (!moderator.hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
ScripterManager.scripterDetected(moderator.getClient(), Emulator.getTexts().getValue("scripter.warning.modtools.alert").replace("%username%", moderator.getHabboInfo().getUsername()).replace("%message%", message));
|
ScripterManager.scripterDetected(moderator.getClient(), Emulator.getTexts().getValue("scripter.warning.modtools.alert").replace("%username%", moderator.getHabboInfo().getUsername()).replace("%message%", message));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -401,7 +401,7 @@ public class ModToolManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void kick(Habbo moderator, Habbo target, String message) {
|
public void kick(Habbo moderator, Habbo target, String message) {
|
||||||
if (moderator.hasRight(Permission.ACC_SUPPORTTOOL) && !target.hasRight(Permission.ACC_UNKICKABLE)) {
|
if (moderator.hasPermissionRight(Permission.ACC_SUPPORTTOOL) && !target.hasPermissionRight(Permission.ACC_UNKICKABLE)) {
|
||||||
if (target.getRoomUnit().getRoom() != null) {
|
if (target.getRoomUnit().getRoom() != null) {
|
||||||
Emulator.getGameEnvironment().getRoomManager().leaveRoom(target, target.getRoomUnit().getRoom());
|
Emulator.getGameEnvironment().getRoomManager().leaveRoom(target, target.getRoomUnit().getRoom());
|
||||||
}
|
}
|
||||||
@ -484,7 +484,7 @@ public class ModToolManager {
|
|||||||
|
|
||||||
if (roomActionEvent.isKickUsers()) {
|
if (roomActionEvent.isKickUsers()) {
|
||||||
for (Habbo habbo : room.getRoomUnitManager().getRoomHabbos()) {
|
for (Habbo habbo : room.getRoomUnitManager().getRoomHabbos()) {
|
||||||
if (!(habbo.hasRight(Permission.ACC_UNKICKABLE) || habbo.hasRight(Permission.ACC_SUPPORTTOOL) || room.getRoomInfo().isRoomOwner(habbo))) {
|
if (!(habbo.hasPermissionRight(Permission.ACC_UNKICKABLE) || habbo.hasPermissionRight(Permission.ACC_SUPPORTTOOL) || room.getRoomInfo().isRoomOwner(habbo))) {
|
||||||
room.kickHabbo(habbo, false);
|
room.kickHabbo(habbo, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ public class WordFilter {
|
|||||||
|
|
||||||
public String filter(String message, Habbo habbo) {
|
public String filter(String message, Habbo habbo) {
|
||||||
String filteredMessage = message;
|
String filteredMessage = message;
|
||||||
if (!Emulator.getConfig().getBoolean("hotel.wordfilter.enabled", true) || (habbo != null && habbo.hasRight(Permission.ACC_CHAT_NO_FILTER))) {
|
if (!Emulator.getConfig().getBoolean("hotel.wordfilter.enabled", true) || (habbo != null && habbo.hasPermissionRight(Permission.ACC_CHAT_NO_FILTER))) {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
if (Emulator.getConfig().getBoolean("hotel.wordfilter.normalise")) {
|
if (Emulator.getConfig().getBoolean("hotel.wordfilter.normalise")) {
|
||||||
|
@ -19,7 +19,7 @@ public class NavigatorHotelFilter extends NavigatorFilter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SearchResultList> getResult(Habbo habbo) {
|
public List<SearchResultList> getResult(Habbo habbo) {
|
||||||
boolean showInvisible = habbo.hasRight(Permission.ACC_ENTERANYROOM) || habbo.hasRight(Permission.ACC_ANYROOMOWNER);
|
boolean showInvisible = habbo.hasPermissionRight(Permission.ACC_ENTERANYROOM) || habbo.hasPermissionRight(Permission.ACC_ANYROOMOWNER);
|
||||||
List<SearchResultList> resultLists = new ArrayList<>();
|
List<SearchResultList> resultLists = new ArrayList<>();
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -41,7 +41,7 @@ public class NavigatorHotelFilter extends NavigatorFilter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SearchResultList> getResult(Habbo habbo, NavigatorFilterField filterField, String value, int roomCategory) {
|
public List<SearchResultList> getResult(Habbo habbo, NavigatorFilterField filterField, String value, int roomCategory) {
|
||||||
boolean showInvisible = habbo.hasRight(Permission.ACC_ENTERANYROOM) || habbo.hasRight(Permission.ACC_ANYROOMOWNER);
|
boolean showInvisible = habbo.hasPermissionRight(Permission.ACC_ENTERANYROOM) || habbo.hasPermissionRight(Permission.ACC_ANYROOMOWNER);
|
||||||
if (!filterField.getDatabaseQuery().isEmpty()) {
|
if (!filterField.getDatabaseQuery().isEmpty()) {
|
||||||
List<SearchResultList> resultLists = new ArrayList<>();
|
List<SearchResultList> resultLists = new ArrayList<>();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -16,7 +16,7 @@ public class NavigatorPublicFilter extends NavigatorFilter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SearchResultList> getResult(Habbo habbo) {
|
public List<SearchResultList> getResult(Habbo habbo) {
|
||||||
boolean showInvisible = habbo.hasRight(Permission.ACC_ENTERANYROOM) || habbo.hasRight(Permission.ACC_ANYROOMOWNER);
|
boolean showInvisible = habbo.hasPermissionRight(Permission.ACC_ENTERANYROOM) || habbo.hasPermissionRight(Permission.ACC_ANYROOMOWNER);
|
||||||
List<SearchResultList> resultLists = new ArrayList<>();
|
List<SearchResultList> resultLists = new ArrayList<>();
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
@ -16,7 +16,7 @@ public class NavigatorRoomAdsFilter extends NavigatorFilter {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SearchResultList> getResult(Habbo habbo) {
|
public List<SearchResultList> getResult(Habbo habbo) {
|
||||||
boolean showInvisible = habbo.hasRight(Permission.ACC_ENTERANYROOM) || habbo.hasRight(Permission.ACC_ANYROOMOWNER);
|
boolean showInvisible = habbo.hasPermissionRight(Permission.ACC_ENTERANYROOM) || habbo.hasPermissionRight(Permission.ACC_ANYROOMOWNER);
|
||||||
List<SearchResultList> resultList = new ArrayList<>();
|
List<SearchResultList> resultList = new ArrayList<>();
|
||||||
resultList.add(new SearchResultList(0, "categories", "", SearchAction.NONE, habbo.getHabboStats().getNavigatorWindowSettings().getListModeForCategory("categories", ListMode.LIST), habbo.getHabboStats().getNavigatorWindowSettings().getDisplayModeForCategory("official-root", DisplayMode.VISIBLE), Emulator.getGameEnvironment().getNavigatorManager().getRoomsForCategory("categories", habbo), false, showInvisible, DisplayOrder.ACTIVITY, 0));
|
resultList.add(new SearchResultList(0, "categories", "", SearchAction.NONE, habbo.getHabboStats().getNavigatorWindowSettings().getListModeForCategory("categories", ListMode.LIST), habbo.getHabboStats().getNavigatorWindowSettings().getDisplayModeForCategory("official-root", DisplayMode.VISIBLE), Emulator.getGameEnvironment().getNavigatorManager().getRoomsForCategory("categories", habbo), false, showInvisible, DisplayOrder.ACTIVITY, 0));
|
||||||
return resultList;
|
return resultList;
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
package com.eu.habbo.habbohotel.permissions;
|
package com.eu.habbo.habbohotel.permissions;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Getter
|
||||||
public class PermissionCommand {
|
public class PermissionCommand {
|
||||||
@Getter
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
private final String description;
|
private final String description;
|
||||||
@Getter
|
|
||||||
private final String[] keys;
|
private final String[] keys;
|
||||||
|
|
||||||
public PermissionCommand(ResultSet set) throws SQLException {
|
public PermissionCommand(ResultSet set) throws SQLException {
|
||||||
|
@ -4,7 +4,10 @@ import com.eu.habbo.Emulator;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.sql.*;
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
@ -29,8 +32,8 @@ public class PermissionGroup {
|
|||||||
private final String prefix;
|
private final String prefix;
|
||||||
@Getter
|
@Getter
|
||||||
private final String prefixColor;
|
private final String prefixColor;
|
||||||
private final Map<PermissionCommand, PermissionSetting> commands;
|
private final Map<String, PermissionSetting> commands;
|
||||||
private final Map<PermissionRight, PermissionSetting> rights;
|
private final Map<String, PermissionSetting> rights;
|
||||||
|
|
||||||
@Getter final Map<Integer, PermissionCurrencyTimer> timers;
|
@Getter final Map<Integer, PermissionCurrencyTimer> timers;
|
||||||
|
|
||||||
@ -57,13 +60,19 @@ public class PermissionGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadCommands(Map<String, PermissionCommand> commandsAvailable) {
|
private void loadCommands(Map<String, PermissionCommand> commandsAvailable) {
|
||||||
|
this.commands.clear();
|
||||||
|
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM permission_group_commands WHERE group_id = ?")) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM permission_group_commands WHERE group_id = ?")) {
|
||||||
statement.setInt(1, this.id);
|
statement.setInt(1, this.id);
|
||||||
try(ResultSet set = statement.executeQuery()) {
|
try(ResultSet set = statement.executeQuery()) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
String commandName = set.getString("command_name");
|
String commandName = set.getString("command_name");
|
||||||
PermissionCommand command = commandsAvailable.values().stream().filter(commandAvailable -> commandAvailable.getName().equalsIgnoreCase(commandName)).findFirst().orElse(null);
|
PermissionCommand command = commandsAvailable.values().stream().filter(commandAvailable -> commandAvailable.getName().equalsIgnoreCase(commandName)).findFirst().orElse(null);
|
||||||
this.commands.put(command, PermissionSetting.fromString(set.getString("setting_type")));
|
|
||||||
|
if(command != null) {
|
||||||
|
PermissionSetting setting = PermissionSetting.fromString(set.getString("setting_type"));
|
||||||
|
this.commands.put(command.getName(), setting);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
@ -72,13 +81,18 @@ public class PermissionGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadRights(Map<String, PermissionRight> rightsAvailable) {
|
private void loadRights(Map<String, PermissionRight> rightsAvailable) {
|
||||||
|
this.rights.clear();
|
||||||
|
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM permission_group_rights WHERE group_id = ?")) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM permission_group_rights WHERE group_id = ?")) {
|
||||||
statement.setInt(1, this.id);
|
statement.setInt(1, this.id);
|
||||||
try(ResultSet set = statement.executeQuery()) {
|
try(ResultSet set = statement.executeQuery()) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
String rightName = set.getString("right_name");
|
String rightName = set.getString("right_name");
|
||||||
PermissionRight right = rightsAvailable.values().stream().filter(rightAvailable -> rightAvailable.getName().equalsIgnoreCase(rightName)).findFirst().orElse(null);
|
PermissionRight right = rightsAvailable.values().stream().filter(rightAvailable -> rightAvailable.getName().equalsIgnoreCase(rightName)).findFirst().orElse(null);
|
||||||
this.rights.put(right, PermissionSetting.fromString(set.getString("setting_type")));
|
|
||||||
|
if(right != null) {
|
||||||
|
this.rights.put(right.getName(), PermissionSetting.fromString(set.getString("setting_type")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
@ -87,6 +101,8 @@ public class PermissionGroup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadTimers() {
|
private void loadTimers() {
|
||||||
|
this.timers.clear();
|
||||||
|
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM permission_group_timers WHERE group_id = ? ORDER BY id ASC")) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("SELECT * FROM permission_group_timers WHERE group_id = ? ORDER BY id ASC")) {
|
||||||
statement.setInt(1, this.id);
|
statement.setInt(1, this.id);
|
||||||
try(ResultSet set = statement.executeQuery()) {
|
try(ResultSet set = statement.executeQuery()) {
|
||||||
@ -112,22 +128,22 @@ public class PermissionGroup {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
PermissionSetting setting = this.commands.get(command);
|
if(this.commands.containsKey(command.getName())) {
|
||||||
return setting == PermissionSetting.ALLOWED || (setting == PermissionSetting.HAS_ROOM_RIGHTS && hasRoomRights);
|
PermissionSetting setting = this.commands.get(command.getName());
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasCommand(String name, boolean hasRoomRights) {
|
if(setting == null) {
|
||||||
PermissionCommand command = Emulator.getGameEnvironment().getPermissionsManager().getCommand(name);
|
return false;
|
||||||
if (this.commands.containsKey(command)) {
|
}
|
||||||
PermissionSetting setting = this.commands.get(command);
|
|
||||||
return (setting == PermissionSetting.ALLOWED || (setting == PermissionSetting.HAS_ROOM_RIGHTS && hasRoomRights));
|
return setting == PermissionSetting.ALLOWED || (setting == PermissionSetting.HAS_ROOM_RIGHTS && hasRoomRights);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasRight(String name, boolean hasRoomRights) {
|
public boolean hasPermissionRight(String name, boolean hasRoomRights) {
|
||||||
PermissionRight right = Emulator.getGameEnvironment().getPermissionsManager().getRight(name);
|
PermissionRight right = Emulator.getGameEnvironment().getPermissionsManager().getRight(name);
|
||||||
if(this.rights.containsKey(right)) {
|
if(right != null && this.rights.containsKey(right)) {
|
||||||
PermissionSetting setting = this.rights.get(right);
|
PermissionSetting setting = this.rights.get(right);
|
||||||
return (setting == PermissionSetting.ALLOWED || (setting == PermissionSetting.HAS_ROOM_RIGHTS && hasRoomRights));
|
return (setting == PermissionSetting.ALLOWED || (setting == PermissionSetting.HAS_ROOM_RIGHTS && hasRoomRights));
|
||||||
}
|
}
|
||||||
@ -143,14 +159,14 @@ public class PermissionGroup {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PermissionCommand> getCommands() {
|
public List<String> getCommands() {
|
||||||
Collection<PermissionCommand> fixedCommands = Emulator.getGameEnvironment().getPermissionsManager().getFixedCommands();
|
Collection<String> fixedCommands = Emulator.getGameEnvironment().getPermissionsManager().getFixedCommands();
|
||||||
Set<PermissionCommand> commands = this.commands.keySet();
|
Set<String> commands = this.commands.keySet();
|
||||||
|
|
||||||
return Stream.concat(fixedCommands.stream(), commands.stream()).collect(Collectors.toList());
|
return Stream.concat(fixedCommands.stream(), commands.stream()).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<PermissionRight> getRights() {
|
public Set<String> getRights() {
|
||||||
return this.rights.keySet();
|
return this.rights.keySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,12 +10,14 @@ import java.sql.SQLException;
|
|||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class PermissionsManager {
|
public class PermissionsManager {
|
||||||
private final Map<Integer, PermissionGroup> permissionGroups;
|
private final ConcurrentHashMap<Integer, PermissionGroup> permissionGroups;
|
||||||
private final Map<String, PermissionCommand> permissionCommands;
|
private final Map<String, PermissionCommand> permissionCommands;
|
||||||
private final Map<String, PermissionCommand> fixedCommands;
|
private final Map<String, PermissionCommand> fixedCommands;
|
||||||
private final Map<String, PermissionRight> permissionRights;
|
private final Map<String, PermissionRight> permissionRights;
|
||||||
@ -23,7 +25,7 @@ public class PermissionsManager {
|
|||||||
|
|
||||||
public PermissionsManager() {
|
public PermissionsManager() {
|
||||||
long millis = System.currentTimeMillis();
|
long millis = System.currentTimeMillis();
|
||||||
this.permissionGroups = new HashMap<>();
|
this.permissionGroups = new ConcurrentHashMap<>();
|
||||||
this.permissionCommands = new HashMap<>();
|
this.permissionCommands = new HashMap<>();
|
||||||
this.fixedCommands = new HashMap<>();
|
this.fixedCommands = new HashMap<>();
|
||||||
this.permissionRights = new HashMap<>();
|
this.permissionRights = new HashMap<>();
|
||||||
@ -37,21 +39,34 @@ public class PermissionsManager {
|
|||||||
this.loadPermissionRights();
|
this.loadPermissionRights();
|
||||||
this.loadPermissionGroups();
|
this.loadPermissionGroups();
|
||||||
this.loadEnables();
|
this.loadEnables();
|
||||||
|
|
||||||
log.info(this.permissionGroups.size() + " ranks, " + this.permissionCommands.size() + " commands " + this.permissionRights.size() + " rights -> Loaded!");
|
log.info(this.permissionGroups.size() + " ranks, " + this.permissionCommands.size() + " commands " + this.permissionRights.size() + " rights -> Loaded!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load permission groups information, commands and rights
|
||||||
|
*/
|
||||||
private void loadPermissionGroups() {
|
private void loadPermissionGroups() {
|
||||||
|
HashSet<Integer> currentGroupIds = new HashSet<>();
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM permission_groups ORDER BY id ASC")) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM permission_groups ORDER BY id ASC")) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
PermissionGroup permissionGroup = new PermissionGroup(set, this.permissionCommands, this.permissionRights);
|
PermissionGroup permissionGroup = new PermissionGroup(set, this.permissionCommands, this.permissionRights);
|
||||||
this.permissionGroups.put(permissionGroup.getId(), permissionGroup);
|
this.permissionGroups.put(permissionGroup.getId(), permissionGroup);
|
||||||
|
currentGroupIds.add(permissionGroup.getId());
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error("Caught SQL exception", e);
|
log.error("Caught SQL exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.permissionGroups.entrySet().removeIf(entry -> !currentGroupIds.contains(entry.getKey()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load every available command in the database
|
||||||
|
*/
|
||||||
private void loadPermissionCommands() {
|
private void loadPermissionCommands() {
|
||||||
|
this.permissionCommands.clear();
|
||||||
|
|
||||||
this.loadFixedCommands();
|
this.loadFixedCommands();
|
||||||
|
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM permission_commands")) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM permission_commands")) {
|
||||||
@ -62,8 +77,14 @@ public class PermissionsManager {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error("Caught SQL exception", e);
|
log.error("Caught SQL exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.info("Loaded {} available commands!", this.permissionCommands.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load fixed commands, any command that doesn't require a permission
|
||||||
|
* these commands are always available for any user
|
||||||
|
*/
|
||||||
private void loadFixedCommands() {
|
private void loadFixedCommands() {
|
||||||
String[] fixedCommandNames = {
|
String[] fixedCommandNames = {
|
||||||
"cmd_about",
|
"cmd_about",
|
||||||
@ -75,7 +96,8 @@ public class PermissionsManager {
|
|||||||
"cmd_mute_pets",
|
"cmd_mute_pets",
|
||||||
"cmd_plugins",
|
"cmd_plugins",
|
||||||
"cmd_sit",
|
"cmd_sit",
|
||||||
"cmd_stand"
|
"cmd_stand",
|
||||||
|
"cmd_test"
|
||||||
};
|
};
|
||||||
|
|
||||||
for(String command : fixedCommandNames) {
|
for(String command : fixedCommandNames) {
|
||||||
@ -86,11 +108,19 @@ public class PermissionsManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a fixed command through plugins if you want to include a fixed command
|
||||||
|
* on main source make use of `loadFixedCommands()` instead
|
||||||
|
*
|
||||||
|
* @param fixedCommand A command that will be always available to any user
|
||||||
|
*/
|
||||||
public void addFixedCommand(PermissionCommand fixedCommand) {
|
public void addFixedCommand(PermissionCommand fixedCommand) {
|
||||||
this.fixedCommands.put(fixedCommand.getName(), fixedCommand);
|
this.fixedCommands.put(fixedCommand.getName(), fixedCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadPermissionRights() {
|
private void loadPermissionRights() {
|
||||||
|
this.permissionRights.clear();
|
||||||
|
|
||||||
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM permission_rights")) {
|
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); Statement statement = connection.createStatement(); ResultSet set = statement.executeQuery("SELECT * FROM permission_rights")) {
|
||||||
while (set.next()) {
|
while (set.next()) {
|
||||||
PermissionRight permissionRight = new PermissionRight(set);
|
PermissionRight permissionRight = new PermissionRight(set);
|
||||||
@ -99,6 +129,8 @@ public class PermissionsManager {
|
|||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
log.error("Caught SQL exception", e);
|
log.error("Caught SQL exception", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.info("Loaded {} available rights!", this.permissionRights.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadEnables() {
|
private void loadEnables() {
|
||||||
@ -140,8 +172,8 @@ public class PermissionsManager {
|
|||||||
.orElseGet(() -> null);
|
.orElseGet(() -> null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<PermissionCommand> getFixedCommands() {
|
public Collection<String> getFixedCommands() {
|
||||||
return this.fixedCommands.values();
|
return this.fixedCommands.keySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFixedCommand(String name) {
|
public boolean isFixedCommand(String name) {
|
||||||
|
@ -55,7 +55,6 @@ import com.eu.habbo.plugin.events.users.UserRolledEvent;
|
|||||||
import com.eu.habbo.plugin.events.users.UsernameTalkEvent;
|
import com.eu.habbo.plugin.events.users.UsernameTalkEvent;
|
||||||
import com.eu.habbo.threading.runnables.YouAreAPirate;
|
import com.eu.habbo.threading.runnables.YouAreAPirate;
|
||||||
import gnu.trove.TCollections;
|
import gnu.trove.TCollections;
|
||||||
import gnu.trove.iterator.TIntObjectIterator;
|
|
||||||
import gnu.trove.map.TIntIntMap;
|
import gnu.trove.map.TIntIntMap;
|
||||||
import gnu.trove.map.TIntObjectMap;
|
import gnu.trove.map.TIntObjectMap;
|
||||||
import gnu.trove.map.hash.TIntIntHashMap;
|
import gnu.trove.map.hash.TIntIntHashMap;
|
||||||
@ -91,7 +90,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
@Getter
|
@Getter
|
||||||
private final RoomRightsManager roomRightsManager;
|
private final RoomRightsManager roomRightsManager;
|
||||||
@Getter
|
@Getter
|
||||||
private TraxManager traxManager;
|
private RoomTraxManager roomTraxManager;
|
||||||
private static final String CAUGHT_EXCEPTION = "Caught exception";
|
private static final String CAUGHT_EXCEPTION = "Caught exception";
|
||||||
public static final Comparator<Room> SORT_SCORE = (o1, o2) -> o2.roomInfo.getScore() - o1.roomInfo.getScore();
|
public static final Comparator<Room> SORT_SCORE = (o1, o2) -> o2.roomInfo.getScore() - o1.roomInfo.getScore();
|
||||||
public static final Comparator<Room> SORT_ID = (o1, o2) -> o2.roomInfo.getId() - o1.roomInfo.getId();
|
public static final Comparator<Room> SORT_ID = (o1, o2) -> o2.roomInfo.getId() - o1.roomInfo.getId();
|
||||||
@ -122,7 +121,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
private final TIntIntMap furniOwnerCount;
|
private final TIntIntMap furniOwnerCount;
|
||||||
@Getter
|
@Getter
|
||||||
private final THashSet<String> wordFilterWords;
|
private final THashSet<String> wordFilterWords;
|
||||||
private final TIntObjectMap<RoomItem> roomItems;
|
|
||||||
private final Object loadLock = new Object();
|
private final Object loadLock = new Object();
|
||||||
//Use appropriately. Could potentially cause memory leaks when used incorrectly.
|
//Use appropriately. Could potentially cause memory leaks when used incorrectly.
|
||||||
public volatile boolean preventUnloading = false;
|
public volatile boolean preventUnloading = false;
|
||||||
@ -206,7 +204,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
this.allowEffects = true;
|
this.allowEffects = true;
|
||||||
this.furniOwnerNames = TCollections.synchronizedMap(new TIntObjectHashMap<>(0));
|
this.furniOwnerNames = TCollections.synchronizedMap(new TIntObjectHashMap<>(0));
|
||||||
this.furniOwnerCount = TCollections.synchronizedMap(new TIntIntHashMap(0));
|
this.furniOwnerCount = TCollections.synchronizedMap(new TIntIntHashMap(0));
|
||||||
this.roomItems = TCollections.synchronizedMap(new TIntObjectHashMap<>(0));
|
|
||||||
this.wordFilterWords = new THashSet<>(0);
|
this.wordFilterWords = new THashSet<>(0);
|
||||||
|
|
||||||
this.mutedHabbos = new TIntIntHashMap();
|
this.mutedHabbos = new TIntIntHashMap();
|
||||||
@ -232,10 +229,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
|
|
||||||
this.loadLayout();
|
this.loadLayout();
|
||||||
this.roomRightsManager.load(connection);
|
this.roomRightsManager.load(connection);
|
||||||
|
|
||||||
//TODO Deprecated
|
|
||||||
this.loadItems(connection);
|
|
||||||
|
|
||||||
this.roomItemManager.load(connection);
|
this.roomItemManager.load(connection);
|
||||||
this.loadHeightmap();
|
this.loadHeightmap();
|
||||||
this.roomUnitManager.load(connection);
|
this.roomUnitManager.load(connection);
|
||||||
@ -249,10 +242,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
log.error(CAUGHT_EXCEPTION, e);
|
log.error(CAUGHT_EXCEPTION, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.traxManager = new TraxManager(this);
|
this.roomTraxManager = new RoomTraxManager(this);
|
||||||
|
|
||||||
if (this.roomInfo.isJukeboxEnabled()) {
|
if (this.roomInfo.isJukeboxEnabled()) {
|
||||||
this.traxManager.play(0);
|
this.roomTraxManager.play(0);
|
||||||
for (RoomItem item : this.roomSpecialTypes.getItemsOfType(InteractionJukeBox.class)) {
|
for (RoomItem item : this.roomSpecialTypes.getItemsOfType(InteractionJukeBox.class)) {
|
||||||
this.updateItem(item.setExtradata("1"));
|
this.updateItem(item.setExtradata("1"));
|
||||||
}
|
}
|
||||||
@ -299,28 +292,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void loadItems(Connection connection) {
|
|
||||||
this.roomItems.clear();
|
|
||||||
|
|
||||||
try (PreparedStatement statement = connection.prepareStatement("SELECT * FROM items WHERE room_id = ?")) {
|
|
||||||
statement.setInt(1, this.roomInfo.getId());
|
|
||||||
try (ResultSet set = statement.executeQuery()) {
|
|
||||||
while (set.next()) {
|
|
||||||
RoomItem item = Emulator.getGameEnvironment().getItemManager().loadHabboItem(set);
|
|
||||||
this.getRoomItemManager().addRoomItem(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
log.error(CAUGHT_SQL_EXCEPTION, e);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(CAUGHT_EXCEPTION, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.getRoomItemManager().getCurrentItems().size() > Room.MAXIMUM_FURNI) {
|
|
||||||
log.error("Room ID: {} has exceeded the furniture limit ({} > {}).", this.roomInfo.getId(), this.getRoomItemManager().getCurrentItems().size(), Room.MAXIMUM_FURNI);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private synchronized void loadWordFilter(Connection connection) {
|
private synchronized void loadWordFilter(Connection connection) {
|
||||||
this.wordFilterWords.clear();
|
this.wordFilterWords.clear();
|
||||||
|
|
||||||
@ -406,25 +377,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean tileWalkable(RoomTile t) {
|
|
||||||
return this.tileWalkable(t.getX(), t.getY());
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean tileWalkable(short x, short y) {
|
|
||||||
boolean walkable = this.layout.tileWalkable(x, y);
|
|
||||||
RoomTile tile = this.getLayout().getTile(x, y);
|
|
||||||
|
|
||||||
if ((walkable && tile != null) && (this.roomUnitManager.areRoomUnitsAt(tile) && !this.roomInfo.isAllowWalkthrough())) {
|
|
||||||
walkable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return walkable;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateHabbo(Habbo habbo) {
|
|
||||||
this.updateRoomUnit(habbo.getRoomUnit());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void updateRoomUnit(RoomUnit roomUnit) {
|
public void updateRoomUnit(RoomUnit roomUnit) {
|
||||||
RoomItem item = this.roomItemManager.getTopItemAt(roomUnit.getCurrentPosition().getX(), roomUnit.getCurrentPosition().getY());
|
RoomItem item = this.roomItemManager.getTopItemAt(roomUnit.getCurrentPosition().getX(), roomUnit.getCurrentPosition().getY());
|
||||||
|
|
||||||
@ -566,8 +518,8 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
if (this.loaded) {
|
if (this.loaded) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (this.traxManager != null && !this.traxManager.disposed()) {
|
if (this.roomTraxManager != null && !this.roomTraxManager.disposed()) {
|
||||||
this.traxManager.dispose();
|
this.roomTraxManager.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.roomCycleTask.cancel(false);
|
this.roomCycleTask.cancel(false);
|
||||||
@ -592,35 +544,17 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
|
|
||||||
this.roomUnitManager.removeAllPetsExceptRoomOwner();
|
this.roomUnitManager.removeAllPetsExceptRoomOwner();
|
||||||
|
|
||||||
synchronized (this.roomItems) {
|
this.roomItemManager.dispose();
|
||||||
TIntObjectIterator<RoomItem> iterator = this.roomItems.iterator();
|
|
||||||
|
|
||||||
|
|
||||||
for (int i = this.roomItems.size(); i-- > 0; ) {
|
|
||||||
try {
|
|
||||||
iterator.advance();
|
|
||||||
|
|
||||||
if (iterator.value().needsUpdate())
|
|
||||||
iterator.value().run();
|
|
||||||
} catch (NoSuchElementException e) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.roomSpecialTypes != null) {
|
if (this.roomSpecialTypes != null) {
|
||||||
this.roomSpecialTypes.dispose();
|
this.roomSpecialTypes.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (this.roomItems) {
|
|
||||||
this.roomItems.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (this.habboQueue) {
|
synchronized (this.habboQueue) {
|
||||||
this.habboQueue.clear();
|
this.habboQueue.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.roomUnitManager.dispose(this);
|
this.roomUnitManager.dispose();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(CAUGHT_EXCEPTION, e);
|
log.error(CAUGHT_EXCEPTION, e);
|
||||||
}
|
}
|
||||||
@ -851,6 +785,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.cycleRoomUnit(habbo.getRoomUnit())) {
|
if (this.cycleRoomUnit(habbo.getRoomUnit())) {
|
||||||
|
habbo.getRoomUnit().setStatusUpdateNeeded(false);
|
||||||
updatedUnit.add(habbo.getRoomUnit());
|
updatedUnit.add(habbo.getRoomUnit());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -883,6 +818,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
|
|
||||||
|
|
||||||
if (this.cycleRoomUnit(bot.getRoomUnit())) {
|
if (this.cycleRoomUnit(bot.getRoomUnit())) {
|
||||||
|
bot.getRoomUnit().setStatusUpdateNeeded(false);
|
||||||
updatedUnit.add(bot.getRoomUnit());
|
updatedUnit.add(bot.getRoomUnit());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -905,6 +841,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.cycleRoomUnit(pet.getRoomUnit())) {
|
if (this.cycleRoomUnit(pet.getRoomUnit())) {
|
||||||
|
pet.getRoomUnit().setStatusUpdateNeeded(false);
|
||||||
updatedUnit.add(pet.getRoomUnit());
|
updatedUnit.add(pet.getRoomUnit());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -938,7 +875,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
|
|
||||||
RoomItem newRoller = null;
|
RoomItem newRoller = null;
|
||||||
|
|
||||||
RoomTile rollerTile = this.getLayout().getTile(roller.getX(), roller.getY());
|
RoomTile rollerTile = this.layout.getTile(roller.getX(), roller.getY());
|
||||||
|
|
||||||
if (rollerTile == null)
|
if (rollerTile == null)
|
||||||
return true;
|
return true;
|
||||||
@ -1164,7 +1101,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
this.sendComposer(new UserUpdateComposer(updatedUnit).compose());
|
this.sendComposer(new UserUpdateComposer(updatedUnit).compose());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.traxManager.cycle();
|
this.roomTraxManager.cycle();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (this.roomIdleCycles < 60)
|
if (this.roomIdleCycles < 60)
|
||||||
@ -1199,32 +1136,23 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean cycleRoomUnit(RoomUnit unit) {
|
private boolean cycleRoomUnit(RoomUnit unit) {
|
||||||
boolean update = unit.isStatusUpdateNeeded();
|
//Si esta caminando y su path no es nulo ni esta vacio
|
||||||
|
|
||||||
if (unit.hasStatus(RoomUnitStatus.SIGN)) {
|
|
||||||
this.sendComposer(new UserUpdateComposer(unit).compose());
|
|
||||||
unit.removeStatus(RoomUnitStatus.SIGN);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (unit.isWalking() && unit.getPath() != null && !unit.getPath().isEmpty()) {
|
if (unit.isWalking() && unit.getPath() != null && !unit.getPath().isEmpty()) {
|
||||||
if (!unit.cycle(this)) {
|
unit.cycle(this);
|
||||||
return true;
|
//Si no esta caminando o su path tiene errores
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
//Y tiene el status de move, quitaselo y ocupa update
|
||||||
if (unit.hasStatus(RoomUnitStatus.MOVE) && !unit.isAnimateWalk()) {
|
if (unit.hasStatus(RoomUnitStatus.MOVE) && !unit.isAnimateWalk()) {
|
||||||
unit.removeStatus(RoomUnitStatus.MOVE);
|
unit.removeStatus(RoomUnitStatus.MOVE);
|
||||||
|
|
||||||
update = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!unit.isWalking() && !unit.isCmdSitEnabled()) {
|
if (!unit.isWalking() && !unit.isCmdSitEnabled()) {
|
||||||
RoomTile thisTile = this.getLayout().getTile(unit.getCurrentPosition().getX(), unit.getCurrentPosition().getY());
|
RoomTile thisTile = this.layout.getTile(unit.getCurrentPosition().getX(), unit.getCurrentPosition().getY());
|
||||||
RoomItem topItem = this.roomItemManager.getTallestChair(thisTile);
|
RoomItem topItem = this.roomItemManager.getTallestChair(thisTile);
|
||||||
|
|
||||||
if (topItem == null || !topItem.getBaseItem().allowSit()) {
|
if (topItem == null || !topItem.getBaseItem().allowSit()) {
|
||||||
if (unit.hasStatus(RoomUnitStatus.SIT)) {
|
if (unit.hasStatus(RoomUnitStatus.SIT)) {
|
||||||
unit.removeStatus(RoomUnitStatus.SIT);
|
unit.removeStatus(RoomUnitStatus.SIT);
|
||||||
update = true;
|
|
||||||
}
|
}
|
||||||
} else if (thisTile.getState() == RoomTileState.SIT && (!unit.hasStatus(RoomUnitStatus.SIT) || unit.isSitUpdate())) {
|
} else if (thisTile.getState() == RoomTileState.SIT && (!unit.hasStatus(RoomUnitStatus.SIT) || unit.isSitUpdate())) {
|
||||||
if(unit instanceof RoomAvatar roomAvatar) {
|
if(unit instanceof RoomAvatar roomAvatar) {
|
||||||
@ -1245,7 +1173,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
if (topItem == null || !topItem.getBaseItem().allowLay()) {
|
if (topItem == null || !topItem.getBaseItem().allowLay()) {
|
||||||
if (unit.hasStatus(RoomUnitStatus.LAY)) {
|
if (unit.hasStatus(RoomUnitStatus.LAY)) {
|
||||||
unit.removeStatus(RoomUnitStatus.LAY);
|
unit.removeStatus(RoomUnitStatus.LAY);
|
||||||
update = true;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!unit.hasStatus(RoomUnitStatus.LAY)) {
|
if (!unit.hasStatus(RoomUnitStatus.LAY)) {
|
||||||
@ -1257,16 +1184,11 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
} else {
|
} else {
|
||||||
unit.setLocation(this.layout.getTile(topItem.getX(), unit.getCurrentPosition().getY()));
|
unit.setLocation(this.layout.getTile(topItem.getX(), unit.getCurrentPosition().getY()));
|
||||||
}
|
}
|
||||||
update = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (update) {
|
return unit.isStatusUpdateNeeded();
|
||||||
unit.setStatusUpdateNeeded(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return update;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDiagonalMoveEnabled(boolean moveDiagonally) {
|
public void setDiagonalMoveEnabled(boolean moveDiagonally) {
|
||||||
@ -1441,7 +1363,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
THashSet<Habbo> habbos = new THashSet<>();
|
THashSet<Habbo> habbos = new THashSet<>();
|
||||||
for (short x = item.getX(); x < item.getX() + item.getBaseItem().getLength(); x++) {
|
for (short x = item.getX(); x < item.getX() + item.getBaseItem().getLength(); x++) {
|
||||||
for (short y = item.getY(); y < item.getY() + item.getBaseItem().getWidth(); y++) {
|
for (short y = item.getY(); y < item.getY() + item.getBaseItem().getWidth(); y++) {
|
||||||
RoomTile tile = this.getLayout().getTile(x, y);
|
RoomTile tile = this.layout.getTile(x, y);
|
||||||
habbos.addAll(this.roomUnitManager.getHabbosAt(tile));
|
habbos.addAll(this.roomUnitManager.getHabbosAt(tile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1453,7 +1375,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
THashSet<Bot> bots = new THashSet<>();
|
THashSet<Bot> bots = new THashSet<>();
|
||||||
for (short x = item.getX(); x < item.getX() + item.getBaseItem().getLength(); x++) {
|
for (short x = item.getX(); x < item.getX() + item.getBaseItem().getLength(); x++) {
|
||||||
for (short y = item.getY(); y < item.getY() + item.getBaseItem().getWidth(); y++) {
|
for (short y = item.getY(); y < item.getY() + item.getBaseItem().getWidth(); y++) {
|
||||||
RoomTile tile = this.getLayout().getTile(x, y);
|
RoomTile tile = this.layout.getTile(x, y);
|
||||||
bots.addAll(this.roomUnitManager.getBotsAt(tile));
|
bots.addAll(this.roomUnitManager.getBotsAt(tile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1465,7 +1387,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
THashSet<Pet> pets = new THashSet<>();
|
THashSet<Pet> pets = new THashSet<>();
|
||||||
for (short x = item.getX(); x < item.getX() + item.getBaseItem().getLength(); x++) {
|
for (short x = item.getX(); x < item.getX() + item.getBaseItem().getLength(); x++) {
|
||||||
for (short y = item.getY(); y < item.getY() + item.getBaseItem().getWidth(); y++) {
|
for (short y = item.getY(); y < item.getY() + item.getBaseItem().getWidth(); y++) {
|
||||||
RoomTile tile = this.getLayout().getTile(x, y);
|
RoomTile tile = this.layout.getTile(x, y);
|
||||||
pets.addAll(this.roomUnitManager.getPetsAt(tile));
|
pets.addAll(this.roomUnitManager.getPetsAt(tile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1601,7 +1523,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
if (roomChatMessage == null || roomChatMessage.getMessage() == null || roomChatMessage.getMessage().equals(""))
|
if (roomChatMessage == null || roomChatMessage.getMessage() == null || roomChatMessage.getMessage().equals(""))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!habbo.hasRight(Permission.ACC_NOMUTE) && (!MUTEAREA_CAN_WHISPER || chatType != RoomChatType.WHISPER)) {
|
if (!habbo.hasPermissionRight(Permission.ACC_NOMUTE) && (!MUTEAREA_CAN_WHISPER || chatType != RoomChatType.WHISPER)) {
|
||||||
for (RoomItem area : this.getRoomSpecialTypes().getItemsOfType(InteractionMuteArea.class)) {
|
for (RoomItem area : this.getRoomSpecialTypes().getItemsOfType(InteractionMuteArea.class)) {
|
||||||
if (((InteractionMuteArea) area).inSquare(habbo.getRoomUnit().getCurrentPosition())) {
|
if (((InteractionMuteArea) area).inSquare(habbo.getRoomUnit().getCurrentPosition())) {
|
||||||
return;
|
return;
|
||||||
@ -1609,13 +1531,13 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.wordFilterWords.isEmpty() && !habbo.hasRight(Permission.ACC_CHAT_NO_FILTER)) {
|
if (!this.wordFilterWords.isEmpty() && !habbo.hasPermissionRight(Permission.ACC_CHAT_NO_FILTER)) {
|
||||||
for (String string : this.wordFilterWords) {
|
for (String string : this.wordFilterWords) {
|
||||||
roomChatMessage.setMessage(roomChatMessage.getMessage().replaceAll("(?i)" + Pattern.quote(string), "bobba"));
|
roomChatMessage.setMessage(roomChatMessage.getMessage().replaceAll("(?i)" + Pattern.quote(string), "bobba"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!habbo.hasRight(Permission.ACC_NOMUTE)) {
|
if (!habbo.hasPermissionRight(Permission.ACC_NOMUTE)) {
|
||||||
if (this.isMuted() && !this.roomRightsManager.hasRights(habbo)) {
|
if (this.isMuted() && !this.roomRightsManager.hasRights(habbo)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1641,7 +1563,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!habbo.hasRight(Permission.ACC_CHAT_NO_FLOOD)) {
|
if (!habbo.hasPermissionRight(Permission.ACC_CHAT_NO_FLOOD)) {
|
||||||
final int chatCounter = habbo.getHabboStats().getChatCounter().addAndGet(1);
|
final int chatCounter = habbo.getHabboStats().getChatCounter().addAndGet(1);
|
||||||
|
|
||||||
if (chatCounter > 3) {
|
if (chatCounter > 3) {
|
||||||
@ -1705,13 +1627,13 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (h.hasRight(Permission.ACC_SEE_WHISPERS)) {
|
if (h.hasPermissionRight(Permission.ACC_SEE_WHISPERS)) {
|
||||||
h.getClient().sendResponse(staffMessage);
|
h.getClient().sendResponse(staffMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (chatType == RoomChatType.TALK) {
|
} else if (chatType == RoomChatType.TALK) {
|
||||||
ServerMessage message = new ChatMessageComposer(roomChatMessage).compose();
|
ServerMessage message = new ChatMessageComposer(roomChatMessage).compose();
|
||||||
boolean noChatLimit = habbo.hasRight(Permission.ACC_CHAT_NO_LIMIT);
|
boolean noChatLimit = habbo.hasPermissionRight(Permission.ACC_CHAT_NO_LIMIT);
|
||||||
|
|
||||||
for (Habbo h : this.roomUnitManager.getRoomHabbos()) {
|
for (Habbo h : this.roomUnitManager.getRoomHabbos()) {
|
||||||
if ((h.getRoomUnit().getCurrentPosition().distance(habbo.getRoomUnit().getCurrentPosition()) <= this.roomInfo.getChatDistance() ||
|
if ((h.getRoomUnit().getCurrentPosition().distance(habbo.getRoomUnit().getCurrentPosition()) <= this.roomInfo.getChatDistance() ||
|
||||||
@ -1813,7 +1735,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
* @param tentRectangle The whole tent area from where the sending Habbo is saying something
|
* @param tentRectangle The whole tent area from where the sending Habbo is saying something
|
||||||
*/
|
*/
|
||||||
private void showTentChatMessageOutsideTentIfPermitted(Habbo receivingHabbo, RoomChatMessage roomChatMessage, Rectangle tentRectangle) {
|
private void showTentChatMessageOutsideTentIfPermitted(Habbo receivingHabbo, RoomChatMessage roomChatMessage, Rectangle tentRectangle) {
|
||||||
if (receivingHabbo != null && receivingHabbo.hasRight(Permission.ACC_SEE_TENTCHAT) && tentRectangle != null && !RoomLayout.tileInSquare(tentRectangle, receivingHabbo.getRoomUnit().getCurrentPosition())) {
|
if (receivingHabbo != null && receivingHabbo.hasPermissionRight(Permission.ACC_SEE_TENTCHAT) && tentRectangle != null && !RoomLayout.tileInSquare(tentRectangle, receivingHabbo.getRoomUnit().getCurrentPosition())) {
|
||||||
RoomChatMessage staffChatMessage = new RoomChatMessage(roomChatMessage);
|
RoomChatMessage staffChatMessage = new RoomChatMessage(roomChatMessage);
|
||||||
staffChatMessage.setMessage("[" + Emulator.getTexts().getValue("hotel.room.tent.prefix") + "] " + staffChatMessage.getMessage());
|
staffChatMessage.setMessage("[" + Emulator.getTexts().getValue("hotel.room.tent.prefix") + "] " + staffChatMessage.getMessage());
|
||||||
final ServerMessage staffMessage = new WhisperMessageComposer(staffChatMessage).compose();
|
final ServerMessage staffMessage = new WhisperMessageComposer(staffChatMessage).compose();
|
||||||
@ -1869,7 +1791,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double getStackHeight(short x, short y, boolean calculateHeightmap, RoomItem exclude) {
|
public double getStackHeight(short x, short y, boolean calculateHeightmap, RoomItem exclude) {
|
||||||
|
|
||||||
if (x < 0 || y < 0 || this.layout == null)
|
if (x < 0 || y < 0 || this.layout == null)
|
||||||
return calculateHeightmap ? Short.MAX_VALUE : 0.0;
|
return calculateHeightmap ? Short.MAX_VALUE : 0.0;
|
||||||
|
|
||||||
@ -1922,7 +1843,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSitOrLayAt(int x, int y) {
|
public boolean canSitOrLayAt(int x, int y) {
|
||||||
RoomTile tile = this.getLayout().getTile((short) x, (short) y);
|
RoomTile tile = this.layout.getTile((short) x, (short) y);
|
||||||
|
|
||||||
if(tile == null) {
|
if(tile == null) {
|
||||||
return false;
|
return false;
|
||||||
@ -1937,7 +1858,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canSitAt(int x, int y) {
|
public boolean canSitAt(int x, int y) {
|
||||||
RoomTile tile = this.getLayout().getTile((short) x, (short) y);
|
RoomTile tile = this.layout.getTile((short) x, (short) y);
|
||||||
|
|
||||||
if(tile == null) {
|
if(tile == null) {
|
||||||
return false;
|
return false;
|
||||||
@ -2110,7 +2031,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
public boolean isBanned(Habbo habbo) {
|
public boolean isBanned(Habbo habbo) {
|
||||||
RoomBan ban = this.bannedHabbos.get(habbo.getHabboInfo().getId());
|
RoomBan ban = this.bannedHabbos.get(habbo.getHabboInfo().getId());
|
||||||
|
|
||||||
boolean banned = ban != null && ban.getEndTimestamp() > Emulator.getIntUnixTimestamp() && !habbo.hasRight(Permission.ACC_ANYROOMOWNER) && !habbo.hasRight(Permission.ACC_ENTERANYROOM);
|
boolean banned = ban != null && ban.getEndTimestamp() > Emulator.getIntUnixTimestamp() && !habbo.hasPermissionRight(Permission.ACC_ANYROOMOWNER) && !habbo.hasPermissionRight(Permission.ACC_ENTERANYROOM);
|
||||||
|
|
||||||
if (!banned && ban != null) {
|
if (!banned && ban != null) {
|
||||||
this.unbanHabbo(habbo.getHabboInfo().getId());
|
this.unbanHabbo(habbo.getHabboInfo().getId());
|
||||||
@ -2135,7 +2056,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
if (item != null && item.getRoomId() == this.roomInfo.getId() && item.getBaseItem() != null) {
|
if (item != null && item.getRoomId() == this.roomInfo.getId() && item.getBaseItem() != null) {
|
||||||
if (item.getBaseItem().getType() == FurnitureType.FLOOR) {
|
if (item.getBaseItem().getType() == FurnitureType.FLOOR) {
|
||||||
this.sendComposer(new ObjectUpdateMessageComposer(item).compose());
|
this.sendComposer(new ObjectUpdateMessageComposer(item).compose());
|
||||||
this.updateTiles(this.getLayout().getTilesAt(this.layout.getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation()));
|
this.updateTiles(this.layout.getTilesAt(this.layout.getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation()));
|
||||||
} else if (item.getBaseItem().getType() == FurnitureType.WALL) {
|
} else if (item.getBaseItem().getType() == FurnitureType.WALL) {
|
||||||
this.sendComposer(new ItemUpdateMessageComposer(item).compose());
|
this.sendComposer(new ItemUpdateMessageComposer(item).compose());
|
||||||
}
|
}
|
||||||
@ -2153,7 +2074,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
if (item.getBaseItem().getType() == FurnitureType.FLOOR) {
|
if (item.getBaseItem().getType() == FurnitureType.FLOOR) {
|
||||||
if (this.layout == null) return;
|
if (this.layout == null) return;
|
||||||
|
|
||||||
this.updateTiles(this.getLayout().getTilesAt(this.layout.getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation()));
|
this.updateTiles(this.layout.getTilesAt(this.layout.getTile(item.getX(), item.getY()), item.getBaseItem().getWidth(), item.getBaseItem().getLength(), item.getRotation()));
|
||||||
|
|
||||||
if (item instanceof InteractionMultiHeight interactionMultiHeight) {
|
if (item instanceof InteractionMultiHeight interactionMultiHeight) {
|
||||||
interactionMultiHeight.updateUnitsOnItem(this);
|
interactionMultiHeight.updateUnitsOnItem(this);
|
||||||
@ -2168,7 +2089,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
public int getUserUniqueFurniCount(int userId) {
|
public int getUserUniqueFurniCount(int userId) {
|
||||||
THashSet<Item> items = new THashSet<>();
|
THashSet<Item> items = new THashSet<>();
|
||||||
|
|
||||||
for (RoomItem item : this.roomItems.valueCollection()) {
|
for (RoomItem item : this.roomItemManager.getCurrentItems().values()) {
|
||||||
if (!items.contains(item.getBaseItem()) && item.getOwnerId() == userId) items.add(item.getBaseItem());
|
if (!items.contains(item.getBaseItem()) && item.getOwnerId() == userId) items.add(item.getBaseItem());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2193,16 +2114,10 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
|
|
||||||
public void refreshGuildColors(Guild guild) {
|
public void refreshGuildColors(Guild guild) {
|
||||||
if (guild.getRoomId() == this.roomInfo.getId()) {
|
if (guild.getRoomId() == this.roomInfo.getId()) {
|
||||||
TIntObjectIterator<RoomItem> iterator = this.roomItems.iterator();
|
Iterator<RoomItem> iterator = this.roomItemManager.getCurrentItems().values().iterator();
|
||||||
|
|
||||||
for (int i = this.roomItemManager.getCurrentItems().size(); i-- > 0; ) {
|
for (int i = this.roomItemManager.getCurrentItems().size(); i-- > 0; ) {
|
||||||
try {
|
RoomItem roomItem = iterator.next();
|
||||||
iterator.advance();
|
|
||||||
} catch (Exception e) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
RoomItem roomItem = iterator.value();
|
|
||||||
|
|
||||||
if (roomItem instanceof InteractionGuildFurni interactionGuildFurni && interactionGuildFurni.getGuildId() == guild.getId()) {
|
if (roomItem instanceof InteractionGuildFurni interactionGuildFurni && interactionGuildFurni.getGuildId() == guild.getId()) {
|
||||||
this.updateItem(roomItem);
|
this.updateItem(roomItem);
|
||||||
@ -2214,7 +2129,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
public void refreshGuildRightsInRoom() {
|
public void refreshGuildRightsInRoom() {
|
||||||
for (Habbo habbo : this.roomUnitManager.getRoomHabbos()) {
|
for (Habbo habbo : this.roomUnitManager.getRoomHabbos()) {
|
||||||
if ((habbo.getRoomUnit().getRoom() == this && habbo.getHabboInfo().getId() != this.roomInfo.getOwnerInfo().getId())
|
if ((habbo.getRoomUnit().getRoom() == this && habbo.getHabboInfo().getId() != this.roomInfo.getOwnerInfo().getId())
|
||||||
&& (!(habbo.hasRight(Permission.ACC_ANYROOMOWNER) || habbo.hasRight(Permission.ACC_MOVEROTATE))))
|
&& (!(habbo.hasPermissionRight(Permission.ACC_ANYROOMOWNER) || habbo.hasPermissionRight(Permission.ACC_MOVEROTATE))))
|
||||||
this.getRoomRightsManager().refreshRightsForHabbo(habbo);
|
this.getRoomRightsManager().refreshRightsForHabbo(habbo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable {
|
|||||||
this.bubble = RoomChatMessageBubbles.NORMAL;
|
this.bubble = RoomChatMessageBubbles.NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!message.client.getHabbo().hasRight(Permission.ACC_ANYCHATCOLOR)) {
|
if (!message.client.getHabbo().hasPermissionRight(Permission.ACC_ANYCHATCOLOR)) {
|
||||||
for (Integer i : RoomChatMessage.BANNED_BUBBLES) {
|
for (Integer i : RoomChatMessage.BANNED_BUBBLES) {
|
||||||
if (i == this.bubble.getType()) {
|
if (i == this.bubble.getType()) {
|
||||||
this.bubble = RoomChatMessageBubbles.NORMAL;
|
this.bubble = RoomChatMessageBubbles.NORMAL;
|
||||||
@ -155,7 +155,7 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable {
|
|||||||
@Override
|
@Override
|
||||||
public void serialize(ServerMessage message) {
|
public void serialize(ServerMessage message) {
|
||||||
if (this.habbo != null && this.bubble.isOverridable()) {
|
if (this.habbo != null && this.bubble.isOverridable()) {
|
||||||
if (!this.habbo.hasRight(Permission.ACC_ANYCHATCOLOR)) {
|
if (!this.habbo.hasPermissionRight(Permission.ACC_ANYCHATCOLOR)) {
|
||||||
for (Integer i : RoomChatMessage.BANNED_BUBBLES) {
|
for (Integer i : RoomChatMessage.BANNED_BUBBLES) {
|
||||||
if (i == this.bubble.getType()) {
|
if (i == this.bubble.getType()) {
|
||||||
this.bubble = RoomChatMessageBubbles.NORMAL;
|
this.bubble = RoomChatMessageBubbles.NORMAL;
|
||||||
@ -166,7 +166,7 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!this.getBubble().getPermission().isEmpty()) {
|
if (!this.getBubble().getPermission().isEmpty()) {
|
||||||
if (this.habbo != null && !this.habbo.hasRight(this.getBubble().getPermission())) {
|
if (this.habbo != null && !this.habbo.hasPermissionRight(this.getBubble().getPermission())) {
|
||||||
this.bubble = RoomChatMessageBubbles.NORMAL;
|
this.bubble = RoomChatMessageBubbles.NORMAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -191,7 +191,7 @@ public class RoomChatMessage implements Runnable, ISerialize, DatabaseLoggable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Emulator.getConfig().getBoolean("hotel.wordfilter.enabled", true) && Emulator.getConfig().getBoolean("hotel.wordfilter.rooms")) {
|
if (Emulator.getConfig().getBoolean("hotel.wordfilter.enabled", true) && Emulator.getConfig().getBoolean("hotel.wordfilter.rooms")) {
|
||||||
if (!this.habbo.hasRight(Permission.ACC_CHAT_NO_FILTER)) {
|
if (!this.habbo.hasPermissionRight(Permission.ACC_CHAT_NO_FILTER)) {
|
||||||
if (!Emulator.getGameEnvironment().getWordFilter().autoReportCheck(this)) {
|
if (!Emulator.getGameEnvironment().getWordFilter().autoReportCheck(this)) {
|
||||||
if (!Emulator.getGameEnvironment().getWordFilter().hideMessageCheck(this.message)) {
|
if (!Emulator.getGameEnvironment().getWordFilter().hideMessageCheck(this.message)) {
|
||||||
Emulator.getGameEnvironment().getWordFilter().filter(this, this.habbo);
|
Emulator.getGameEnvironment().getWordFilter().filter(this, this.habbo);
|
||||||
|
@ -197,7 +197,7 @@ public class RoomInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRoomOwner(Habbo owner) {
|
public boolean isRoomOwner(Habbo owner) {
|
||||||
return this.ownerInfo.getId() == owner.getHabboInfo().getId() || owner.hasRight(Permission.ACC_ANYROOMOWNER);
|
return this.ownerInfo.getId() == owner.getHabboInfo().getId() || owner.hasPermissionRight(Permission.ACC_ANYROOMOWNER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] filterAnything() {
|
public String[] filterAnything() {
|
||||||
|
@ -232,7 +232,7 @@ public class RoomItemManager {
|
|||||||
return FurnitureMovementError.MAX_SOUNDFURNI;
|
return FurnitureMovementError.MAX_SOUNDFURNI;
|
||||||
} else if (tile == null || tile.getState() == RoomTileState.INVALID) {
|
} else if (tile == null || tile.getState() == RoomTileState.INVALID) {
|
||||||
return FurnitureMovementError.INVALID_MOVE;
|
return FurnitureMovementError.INVALID_MOVE;
|
||||||
} else if (this.room.getRoomRightsManager().hasRights(habbo) || this.room.getGuildRightLevel(habbo).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS) || habbo.hasRight(Permission.ACC_MOVEROTATE)) {
|
} else if (this.room.getRoomRightsManager().hasRights(habbo) || this.room.getGuildRightLevel(habbo).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS) || habbo.hasPermissionRight(Permission.ACC_MOVEROTATE)) {
|
||||||
return FurnitureMovementError.NONE;
|
return FurnitureMovementError.NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1089,4 +1089,15 @@ public class RoomItemManager {
|
|||||||
this.addUndefined(item);
|
this.addUndefined(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dispose() {
|
||||||
|
this.currentItems.values().parallelStream()
|
||||||
|
.filter(RoomItem::needsUpdate)
|
||||||
|
.forEach(roomItem -> {
|
||||||
|
roomItem.run();
|
||||||
|
this.currentItems.remove(roomItem.getId());
|
||||||
|
});
|
||||||
|
|
||||||
|
this.currentItems.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,8 @@ package com.eu.habbo.habbohotel.rooms;
|
|||||||
import com.eu.habbo.Emulator;
|
import com.eu.habbo.Emulator;
|
||||||
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
import com.eu.habbo.habbohotel.rooms.entities.units.RoomUnit;
|
||||||
import gnu.trove.set.hash.THashSet;
|
import gnu.trove.set.hash.THashSet;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@ -17,16 +19,30 @@ public class RoomLayout {
|
|||||||
public static double MAXIMUM_STEP_HEIGHT = 1.1;
|
public static double MAXIMUM_STEP_HEIGHT = 1.1;
|
||||||
public static boolean ALLOW_FALLING = true;
|
public static boolean ALLOW_FALLING = true;
|
||||||
public boolean CANMOVEDIAGONALY = true;
|
public boolean CANMOVEDIAGONALY = true;
|
||||||
|
@Getter
|
||||||
private String name;
|
private String name;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private short doorX;
|
private short doorX;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private short doorY;
|
private short doorY;
|
||||||
|
@Getter
|
||||||
private short doorZ;
|
private short doorZ;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private int doorDirection;
|
private int doorDirection;
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
private String heightmap;
|
private String heightmap;
|
||||||
|
@Getter
|
||||||
private int mapSize;
|
private int mapSize;
|
||||||
|
@Getter
|
||||||
private int mapSizeX;
|
private int mapSizeX;
|
||||||
|
@Getter
|
||||||
private int mapSizeY;
|
private int mapSizeY;
|
||||||
private RoomTile[][] roomTiles;
|
private RoomTile[][] roomTiles;
|
||||||
|
@Getter
|
||||||
private RoomTile doorTile;
|
private RoomTile doorTile;
|
||||||
private final Room room;
|
private final Room room;
|
||||||
|
|
||||||
@ -143,62 +159,6 @@ public class RoomLayout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public short getDoorX() {
|
|
||||||
return this.doorX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDoorX(short doorX) {
|
|
||||||
this.doorX = doorX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public short getDoorY() {
|
|
||||||
return this.doorY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDoorY(short doorY) {
|
|
||||||
this.doorY = doorY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getDoorZ() {
|
|
||||||
return this.doorZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RoomTile getDoorTile() {
|
|
||||||
return this.doorTile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getDoorDirection() {
|
|
||||||
return this.doorDirection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDoorDirection(int doorDirection) {
|
|
||||||
this.doorDirection = doorDirection;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getHeightmap() {
|
|
||||||
return this.heightmap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHeightmap(String heightMap) {
|
|
||||||
this.heightmap = heightMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMapSize() {
|
|
||||||
return this.mapSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMapSizeX() {
|
|
||||||
return this.mapSizeX;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMapSizeY() {
|
|
||||||
return this.mapSizeY;
|
|
||||||
}
|
|
||||||
|
|
||||||
public short getHeightAtSquare(int x, int y) {
|
public short getHeightAtSquare(int x, int y) {
|
||||||
if (x < 0 ||
|
if (x < 0 ||
|
||||||
y < 0 ||
|
y < 0 ||
|
||||||
@ -241,8 +201,19 @@ public class RoomLayout {
|
|||||||
return !(x < 0 || y < 0 || x >= this.getMapSizeX() || y >= this.getMapSizeY());
|
return !(x < 0 || y < 0 || x >= this.getMapSizeX() || y >= this.getMapSizeY());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean tileWalkable(RoomTile tile) {
|
||||||
|
return this.tileWalkable(tile.getX(), tile.getY());
|
||||||
|
}
|
||||||
|
|
||||||
public boolean tileWalkable(short x, short y) {
|
public boolean tileWalkable(short x, short y) {
|
||||||
return this.tileExists(x, y) && this.roomTiles[x][y].getState() == RoomTileState.OPEN && this.roomTiles[x][y].isWalkable();
|
boolean walkable = false;
|
||||||
|
|
||||||
|
if(this.tileExists(x, y)) {
|
||||||
|
RoomTile tile = this.getTile(x, y);
|
||||||
|
walkable = tile.getState().equals(RoomTileState.OPEN) && tile.isWalkable() && (this.room.getRoomUnitManager().areRoomUnitsAt(tile) && !this.room.getRoomInfo().isAllowWalkthrough());
|
||||||
|
}
|
||||||
|
|
||||||
|
return walkable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isVoidTile(short x, short y) {
|
public boolean isVoidTile(short x, short y) {
|
||||||
|
@ -491,13 +491,13 @@ public class RoomManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//If Habbo is banned AND doesn't have Permissions can't enter to room
|
//If Habbo is banned AND doesn't have Permissions can't enter to room
|
||||||
if (room.isBanned(habbo) && !room.getRoomInfo().isRoomOwner(habbo) && !habbo.hasRight(Permission.ACC_ENTERANYROOM)) {
|
if (room.isBanned(habbo) && !room.getRoomInfo().isRoomOwner(habbo) && !habbo.hasPermissionRight(Permission.ACC_ENTERANYROOM)) {
|
||||||
habbo.getClient().sendResponse(new CantConnectMessageComposer(CantConnectMessageComposer.ROOM_ERROR_BANNED));
|
habbo.getClient().sendResponse(new CantConnectMessageComposer(CantConnectMessageComposer.ROOM_ERROR_BANNED));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//If room is full AND user doesn't have Permissions can't enter to room
|
//If room is full AND user doesn't have Permissions can't enter to room
|
||||||
if (room.getRoomUnitManager().getRoomHabbosCount() >= room.getRoomInfo().getMaxUsers() && !room.getRoomRightsManager().hasRights(habbo) && !habbo.hasRight(Permission.ACC_FULLROOMS)) {
|
if (room.getRoomUnitManager().getRoomHabbosCount() >= room.getRoomInfo().getMaxUsers() && !room.getRoomRightsManager().hasRights(habbo) && !habbo.hasPermissionRight(Permission.ACC_FULLROOMS)) {
|
||||||
habbo.getClient().sendResponse(new CantConnectMessageComposer(CantConnectMessageComposer.ROOM_ERROR_GUESTROOM_FULL));
|
habbo.getClient().sendResponse(new CantConnectMessageComposer(CantConnectMessageComposer.ROOM_ERROR_GUESTROOM_FULL));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -517,7 +517,7 @@ public class RoomManager {
|
|||||||
* If habbo has permissions open room
|
* If habbo has permissions open room
|
||||||
* If habbo has guild rights open room
|
* If habbo has guild rights open room
|
||||||
*/
|
*/
|
||||||
if (forceEnter || room.getRoomInfo().isRoomOwner(habbo) || room.getRoomInfo().getState() == RoomState.OPEN || habbo.hasRight(Permission.ACC_ENTERANYROOM) || room.getRoomRightsManager().hasRights(habbo) || (room.getRoomInfo().getState().equals(RoomState.INVISIBLE) && room.getRoomRightsManager().hasRights(habbo)) || (room.getRoomInfo().hasGuild() && room.getGuildRightLevel(habbo).isGreaterThan(RoomRightLevels.GUILD_RIGHTS))) {
|
if (forceEnter || room.getRoomInfo().isRoomOwner(habbo) || room.getRoomInfo().getState() == RoomState.OPEN || habbo.hasPermissionRight(Permission.ACC_ENTERANYROOM) || room.getRoomRightsManager().hasRights(habbo) || (room.getRoomInfo().getState().equals(RoomState.INVISIBLE) && room.getRoomRightsManager().hasRights(habbo)) || (room.getRoomInfo().hasGuild() && room.getGuildRightLevel(habbo).isGreaterThan(RoomRightLevels.GUILD_RIGHTS))) {
|
||||||
this.openRoom(habbo, room, spawnLocation);
|
this.openRoom(habbo, room, spawnLocation);
|
||||||
} else if (room.getRoomInfo().getState() == RoomState.LOCKED) {
|
} else if (room.getRoomInfo().getState() == RoomState.LOCKED) {
|
||||||
boolean habbosWithRights = false;
|
boolean habbosWithRights = false;
|
||||||
@ -627,7 +627,7 @@ public class RoomManager {
|
|||||||
|
|
||||||
habbo.getClient().sendResponse(new RoomRatingComposer(room.getRoomInfo().getScore(), !this.hasVotedForRoom(habbo, room)));
|
habbo.getClient().sendResponse(new RoomRatingComposer(room.getRoomInfo().getScore(), !this.hasVotedForRoom(habbo, room)));
|
||||||
|
|
||||||
roomHabbo.setFastWalkEnabled(roomHabbo.isFastWalkEnabled() && habbo.hasCommand("cmd_fastwalk", room.getRoomRightsManager().hasRights(habbo)));
|
roomHabbo.setFastWalkEnabled(roomHabbo.isFastWalkEnabled() && habbo.canExecuteCommand("cmd_fastwalk", room.getRoomRightsManager().hasRights(habbo)));
|
||||||
|
|
||||||
if (room.isPromoted()) {
|
if (room.isPromoted()) {
|
||||||
habbo.getClient().sendResponse(new RoomEventComposer(room, room.getPromotion()));
|
habbo.getClient().sendResponse(new RoomEventComposer(room, room.getPromotion()));
|
||||||
@ -1368,7 +1368,7 @@ public class RoomManager {
|
|||||||
|
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
if (habbo.hasRight(Permission.ACC_UNKICKABLE)) {
|
if (habbo.hasPermissionRight(Permission.ACC_UNKICKABLE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1377,7 +1377,7 @@ public class RoomManager {
|
|||||||
HabboInfo info = HabboManager.getOfflineHabboInfo(userId);
|
HabboInfo info = HabboManager.getOfflineHabboInfo(userId);
|
||||||
|
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
if (info.getPermissionGroup().hasRight(Permission.ACC_UNKICKABLE, false)) {
|
if (info.getPermissionGroup().hasPermissionRight(Permission.ACC_UNKICKABLE, false)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
name = info.getUsername();
|
name = info.getUsername();
|
||||||
|
@ -186,7 +186,7 @@ public class RoomRightsManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (habbo.hasRight(Permission.ACC_ANYROOMOWNER) || this.room.getRoomInfo().isRoomOwner(habbo)) {
|
if (habbo.hasPermissionRight(Permission.ACC_ANYROOMOWNER) || this.room.getRoomInfo().isRoomOwner(habbo)) {
|
||||||
habbo.getClient().sendResponse(new YouAreOwnerMessageComposer());
|
habbo.getClient().sendResponse(new YouAreOwnerMessageComposer());
|
||||||
flatCtrl = RoomRightLevels.MODERATOR;
|
flatCtrl = RoomRightLevels.MODERATOR;
|
||||||
} else if (this.hasRights(habbo) && !this.room.getRoomInfo().hasGuild()) {
|
} else if (this.hasRights(habbo) && !this.room.getRoomInfo().hasGuild()) {
|
||||||
|
@ -29,7 +29,7 @@ import java.util.List;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TraxManager implements Disposable {
|
public class RoomTraxManager implements Disposable {
|
||||||
public static int NORMAL_JUKEBOX_LIMIT = 10;
|
public static int NORMAL_JUKEBOX_LIMIT = 10;
|
||||||
public static int LARGE_JUKEBOX_LIMIT = 20;
|
public static int LARGE_JUKEBOX_LIMIT = 20;
|
||||||
private final Room room;
|
private final Room room;
|
||||||
@ -47,7 +47,7 @@ public class TraxManager implements Disposable {
|
|||||||
|
|
||||||
private boolean disposed = false;
|
private boolean disposed = false;
|
||||||
|
|
||||||
public TraxManager(Room room) {
|
public RoomTraxManager(Room room) {
|
||||||
this.room = room;
|
this.room = room;
|
||||||
|
|
||||||
//Check if room has a Jukebox already on DB
|
//Check if room has a Jukebox already on DB
|
@ -416,12 +416,12 @@ public class RoomUnitManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dispose(Room room) {
|
public void dispose() {
|
||||||
for(Habbo habbo : this.currentRoomHabbos.values()) {
|
for(Habbo habbo : this.currentRoomHabbos.values()) {
|
||||||
Emulator.getGameEnvironment().getRoomManager().leaveRoom(habbo, room);
|
Emulator.getGameEnvironment().getRoomManager().leaveRoom(habbo, this.room);
|
||||||
}
|
}
|
||||||
|
|
||||||
room.sendComposer(new CloseConnectionMessageComposer().compose());
|
this.room.sendComposer(new CloseConnectionMessageComposer().compose());
|
||||||
|
|
||||||
this.currentRoomHabbos.clear();
|
this.currentRoomHabbos.clear();
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ public abstract class RoomEntity implements IRoomEntity {
|
|||||||
public synchronized void incrementTilesMoved() {
|
public synchronized void incrementTilesMoved() {
|
||||||
this.tilesMoved++;
|
this.tilesMoved++;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void decrementTilesMoved() {
|
public synchronized void decrementTilesMoved() {
|
||||||
this.tilesMoved--;
|
this.tilesMoved--;
|
||||||
}
|
}
|
||||||
|
@ -263,8 +263,12 @@ public abstract class RoomUnit extends RoomEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public RoomUnit removeStatus(RoomUnitStatus key) {
|
public RoomUnit removeStatus(RoomUnitStatus key) {
|
||||||
this.statuses.remove(key);
|
String statusRemoved = this.statuses.remove(key);
|
||||||
this.statusUpdateNeeded = true;
|
|
||||||
|
if(statusRemoved != null) {
|
||||||
|
this.statusUpdateNeeded = true;
|
||||||
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,11 @@ public class RoomAvatar extends RoomUnit {
|
|||||||
@Override
|
@Override
|
||||||
public boolean cycle(Room room) {
|
public boolean cycle(Room room) {
|
||||||
try {
|
try {
|
||||||
|
if (this.hasStatus(RoomUnitStatus.SIGN)) {
|
||||||
|
this.getRoom().sendComposer(new UserUpdateComposer(this).compose());
|
||||||
|
this.removeStatus(RoomUnitStatus.SIGN);
|
||||||
|
}
|
||||||
|
|
||||||
Habbo habboT = room.getRoomUnitManager().getHabboByRoomUnit(this);
|
Habbo habboT = room.getRoomUnitManager().getHabboByRoomUnit(this);
|
||||||
|
|
||||||
if (!this.isWalking() && !this.isKicked() && this.removeStatus(RoomUnitStatus.MOVE) == null && habboT != null) {
|
if (!this.isWalking() && !this.isKicked() && this.removeStatus(RoomUnitStatus.MOVE) == null && habboT != null) {
|
||||||
@ -66,9 +71,6 @@ public class RoomAvatar extends RoomUnit {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.removeStatus(RoomUnitStatus.SIT) != null || this.removeStatus(RoomUnitStatus.MOVE) != null || this.removeStatus(RoomUnitStatus.LAY) != null)
|
|
||||||
this.setStatusUpdateNeeded(true);
|
|
||||||
|
|
||||||
for (Map.Entry<RoomUnitStatus, String> set : this.getStatuses().entrySet()) {
|
for (Map.Entry<RoomUnitStatus, String> set : this.getStatuses().entrySet()) {
|
||||||
if (set.getKey().isRemoveWhenWalking()) {
|
if (set.getKey().isRemoveWhenWalking()) {
|
||||||
this.removeStatus(set.getKey());
|
this.removeStatus(set.getKey());
|
||||||
@ -76,27 +78,28 @@ public class RoomAvatar extends RoomUnit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.getPath() == null || this.getPath().isEmpty()) {
|
if (this.getPath() == null || this.getPath().isEmpty()) {
|
||||||
this.setStatusUpdateNeeded(true);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean canFastWalk = habboT == null || habboT.getHabboInfo().getRiding() == null;
|
boolean canFastWalk = habboT == null || habboT.getHabboInfo().getRiding() == null;
|
||||||
|
|
||||||
RoomTile next = this.getPath().poll();
|
RoomTile next = this.getPath().poll();
|
||||||
boolean overrideChecks = next != null && this.canOverrideTile(next);
|
|
||||||
|
boolean overrideTile = next != null && this.canOverrideTile(next);
|
||||||
|
|
||||||
if (this.getPath().isEmpty()) {
|
if (this.getPath().isEmpty()) {
|
||||||
this.setSitUpdate(true);
|
this.setSitUpdate(true);
|
||||||
|
|
||||||
if (next != null && room.getRoomUnitManager().areRoomUnitsAt(next) && !overrideChecks) {
|
if (next != null && room.getRoomUnitManager().areRoomUnitsAt(next) && !overrideTile) {
|
||||||
this.setStatusUpdateNeeded(false);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Deque<RoomTile> peekPath = room.getLayout().findPath(this.getCurrentPosition(), this.getPath().peek(), this.getGoalLocation(), this);
|
Deque<RoomTile> peekPath = room.getLayout().findPath(this.getCurrentPosition(), this.getPath().peek(), this.getGoalLocation(), this);
|
||||||
|
|
||||||
if (peekPath == null) peekPath = new LinkedList<>();
|
if (peekPath == null) {
|
||||||
|
peekPath = new LinkedList<>();
|
||||||
|
}
|
||||||
|
|
||||||
if (peekPath.size() >= 3) {
|
if (peekPath.size() >= 3) {
|
||||||
if (this.getPath().isEmpty()) {
|
if (this.getPath().isEmpty()) {
|
||||||
@ -156,14 +159,13 @@ public class RoomAvatar extends RoomUnit {
|
|||||||
RoomItem item = room.getRoomItemManager().getTopItemAt(next.getX(), next.getY());
|
RoomItem item = room.getRoomItemManager().getTopItemAt(next.getX(), next.getY());
|
||||||
|
|
||||||
double height = next.getStackHeight() - this.getCurrentPosition().getStackHeight();
|
double height = next.getStackHeight() - this.getCurrentPosition().getStackHeight();
|
||||||
if (!room.tileWalkable(next) || (!RoomLayout.ALLOW_FALLING && height < -RoomLayout.MAXIMUM_STEP_HEIGHT) || (next.getState() == RoomTileState.OPEN && height > RoomLayout.MAXIMUM_STEP_HEIGHT)) {
|
|
||||||
this.setRoom(room);
|
if (!room.getLayout().tileWalkable(next) || (!RoomLayout.ALLOW_FALLING && height < -RoomLayout.MAXIMUM_STEP_HEIGHT) || (next.getState() == RoomTileState.OPEN && height > RoomLayout.MAXIMUM_STEP_HEIGHT)) {
|
||||||
this.getPath().clear();
|
this.getPath().clear();
|
||||||
this.findPath();
|
this.findPath();
|
||||||
|
|
||||||
if (this.getPath().isEmpty()) {
|
if (this.getPath().isEmpty()) {
|
||||||
this.removeStatus(RoomUnitStatus.MOVE);
|
this.removeStatus(RoomUnitStatus.MOVE);
|
||||||
this.setStatusUpdateNeeded(false);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
next = this.getPath().pop();
|
next = this.getPath().pop();
|
||||||
@ -179,9 +181,8 @@ public class RoomAvatar extends RoomUnit {
|
|||||||
item = tallestChair;
|
item = tallestChair;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (next.equals(this.getGoalLocation()) && next.getState() == RoomTileState.SIT && !overrideChecks && (item == null || item.getZ() - this.getCurrentZ() > RoomLayout.MAXIMUM_STEP_HEIGHT)) {
|
if (next.equals(this.getGoalLocation()) && next.getState() == RoomTileState.SIT && !overrideTile && (item == null || item.getZ() - this.getCurrentZ() > RoomLayout.MAXIMUM_STEP_HEIGHT)) {
|
||||||
this.removeStatus(RoomUnitStatus.MOVE);
|
this.removeStatus(RoomUnitStatus.MOVE);
|
||||||
this.setStatusUpdateNeeded(false);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +200,7 @@ public class RoomAvatar extends RoomUnit {
|
|||||||
this.incrementTilesMoved();
|
this.incrementTilesMoved();
|
||||||
|
|
||||||
RoomRotation oldRotation = this.getBodyRotation();
|
RoomRotation oldRotation = this.getBodyRotation();
|
||||||
|
|
||||||
this.setRotation(RoomRotation.values()[Rotation.Calculate(this.getCurrentPosition().getX(), this.getCurrentPosition().getY(), next.getX(), next.getY())]);
|
this.setRotation(RoomRotation.values()[Rotation.Calculate(this.getCurrentPosition().getX(), this.getCurrentPosition().getY(), next.getX(), next.getY())]);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
if (item != roomItem || !RoomLayout.pointInSquare(item.getX(), item.getY(), item.getX() + item.getBaseItem().getWidth() - 1, item.getY() + item.getBaseItem().getLength() - 1, this.getCurrentPosition().getX(), this.getCurrentPosition().getY())) {
|
if (item != roomItem || !RoomLayout.pointInSquare(item.getX(), item.getY(), item.getX() + item.getBaseItem().getWidth() - 1, item.getY() + item.getBaseItem().getLength() - 1, this.getCurrentPosition().getX(), this.getCurrentPosition().getY())) {
|
||||||
@ -215,7 +217,6 @@ public class RoomAvatar extends RoomUnit {
|
|||||||
conditionalGate.onRejected(this, this.getRoom(), new Object[]{});
|
conditionalGate.onRejected(this, this.getRoom(), new Object[]{});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setStatusUpdateNeeded(false);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -273,12 +274,10 @@ public class RoomAvatar extends RoomUnit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setStatusUpdateNeeded(false);
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Caught exception", e);
|
log.error("Caught exception", e);
|
||||||
this.setStatusUpdateNeeded(false);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ public class RoomPet extends RoomUnit {
|
|||||||
RoomItem item = room.getRoomItemManager().getTopItemAt(next.getX(), next.getY());
|
RoomItem item = room.getRoomItemManager().getTopItemAt(next.getX(), next.getY());
|
||||||
|
|
||||||
double height = next.getStackHeight() - this.getCurrentPosition().getStackHeight();
|
double height = next.getStackHeight() - this.getCurrentPosition().getStackHeight();
|
||||||
if (!room.tileWalkable(next) || (!RoomLayout.ALLOW_FALLING && height < -RoomLayout.MAXIMUM_STEP_HEIGHT) || (next.getState() == RoomTileState.OPEN && height > RoomLayout.MAXIMUM_STEP_HEIGHT)) {
|
if (!room.getLayout().tileWalkable(next) || (!RoomLayout.ALLOW_FALLING && height < -RoomLayout.MAXIMUM_STEP_HEIGHT) || (next.getState() == RoomTileState.OPEN && height > RoomLayout.MAXIMUM_STEP_HEIGHT)) {
|
||||||
this.setRoom(room);
|
this.setRoom(room);
|
||||||
this.getPath().clear();
|
this.getPath().clear();
|
||||||
this.findPath();
|
this.findPath();
|
||||||
|
@ -193,28 +193,19 @@ public class Habbo extends Unit implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean canExecuteCommand(String key) {
|
public boolean canExecuteCommand(String key) {
|
||||||
return this.getHabboInfo().getPermissionGroup().canExecuteCommand(key, false);
|
return this.canExecuteCommand(key, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canExecuteCommand(String key, boolean hasRoomRights) {
|
public boolean canExecuteCommand(String key, boolean hasRoomRights) {
|
||||||
return this.getHabboInfo().getPermissionGroup().canExecuteCommand(key, hasRoomRights);
|
return this.getHabboInfo().getPermissionGroup().canExecuteCommand(key, hasRoomRights);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasCommand(String key) {
|
public boolean hasPermissionRight(String key) {
|
||||||
return this.hasCommand(key, false);
|
return this.hasPermissionRight(key, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasPermissionRight(String key, boolean hasRoomRights) {
|
||||||
public boolean hasCommand(String name, boolean hasRoomRights) {
|
return this.getHabboInfo().getPermissionGroup().hasPermissionRight(key, hasRoomRights);
|
||||||
return this.getHabboInfo().getPermissionGroup().hasCommand(name, hasRoomRights);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasRight(String key) {
|
|
||||||
return this.hasRight(key, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasRight(String key, boolean hasRoomRights) {
|
|
||||||
return this.getHabboInfo().getPermissionGroup().hasRight(key, hasRoomRights);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -403,7 +394,7 @@ public class Habbo extends Unit implements Runnable {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.hasRight(Permission.ACC_NO_MUTE)) {
|
if (!this.hasPermissionRight(Permission.ACC_NO_MUTE)) {
|
||||||
int remaining = this.habboStats.addMuteTime(seconds);
|
int remaining = this.habboStats.addMuteTime(seconds);
|
||||||
this.client.sendResponse(new FloodControlMessageComposer(remaining));
|
this.client.sendResponse(new FloodControlMessageComposer(remaining));
|
||||||
this.client.sendResponse(new RemainingMutePeriodComposer(remaining));
|
this.client.sendResponse(new RemainingMutePeriodComposer(remaining));
|
||||||
|
@ -177,7 +177,7 @@ public class HabboManager {
|
|||||||
public void sendPacketToHabbosWithPermission(ServerMessage message, String perm) {
|
public void sendPacketToHabbosWithPermission(ServerMessage message, String perm) {
|
||||||
synchronized (this.onlineHabbos) {
|
synchronized (this.onlineHabbos) {
|
||||||
for (Habbo habbo : this.onlineHabbos.values()) {
|
for (Habbo habbo : this.onlineHabbos.values()) {
|
||||||
if (habbo.hasRight(perm)) {
|
if (habbo.hasPermissionRight(perm)) {
|
||||||
habbo.getClient().sendResponse(message);
|
habbo.getClient().sendResponse(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -262,7 +262,7 @@ public class HabboManager {
|
|||||||
habbo.getClient().sendResponse(new UserRightsMessageComposer(habbo));
|
habbo.getClient().sendResponse(new UserRightsMessageComposer(habbo));
|
||||||
habbo.getClient().sendResponse(new UserPerksComposer(habbo));
|
habbo.getClient().sendResponse(new UserPerksComposer(habbo));
|
||||||
|
|
||||||
if (habbo.hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (habbo.hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
habbo.getClient().sendResponse(new ModeratorInitMessageComposer(habbo));
|
habbo.getClient().sendResponse(new ModeratorInitMessageComposer(habbo));
|
||||||
}
|
}
|
||||||
habbo.getHabboInfo().run();
|
habbo.getHabboInfo().run();
|
||||||
|
@ -12,7 +12,7 @@ import com.eu.habbo.plugin.events.support.SupportUserAlertedReason;
|
|||||||
public class AmbassadorAlertEvent extends MessageHandler {
|
public class AmbassadorAlertEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_AMBASSADOR)) {
|
if (!this.client.getHabbo().hasPermissionRight(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}"));
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import com.eu.habbo.messages.outgoing.rooms.RoomForwardMessageComposer;
|
|||||||
public class FollowFriendEvent extends MessageHandler {
|
public class FollowFriendEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_AMBASSADOR)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_AMBASSADOR)) {
|
||||||
String username = this.packet.readString();
|
String username = this.packet.readString();
|
||||||
|
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(username);
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(username);
|
||||||
|
@ -10,7 +10,7 @@ import com.eu.habbo.util.crypto.ZIP;
|
|||||||
public class RenderRoomEvent extends MessageHandler {
|
public class RenderRoomEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_CAMERA)) {
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_CAMERA)) {
|
||||||
this.client.getHabbo().alert(Emulator.getTexts().getValue("camera.permission"));
|
this.client.getHabbo().alert(Emulator.getTexts().getValue("camera.permission"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import com.eu.habbo.util.crypto.ZIP;
|
|||||||
public class RenderRoomThumbnailEvent extends MessageHandler {
|
public class RenderRoomThumbnailEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_CAMERA)) {
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_CAMERA)) {
|
||||||
this.client.getHabbo().alert(Emulator.getTexts().getValue("camera.permission"));
|
this.client.getHabbo().alert(Emulator.getTexts().getValue("camera.permission"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -19,10 +19,10 @@ public abstract class PurchaseEvent extends MessageHandler {
|
|||||||
if (this.client.getHabbo().getHabboInfo().getCredits() < totalCredits)
|
if (this.client.getHabbo().getHabboInfo().getCredits() < totalCredits)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_INFINITE_CREDITS))
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_INFINITE_CREDITS))
|
||||||
this.client.getHabbo().giveCredits(-totalCredits);
|
this.client.getHabbo().giveCredits(-totalCredits);
|
||||||
|
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_INFINITE_POINTS))
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_INFINITE_POINTS))
|
||||||
this.client.getHabbo().givePoints(deal.getPointsType(), -totalDuckets);
|
this.client.getHabbo().givePoints(deal.getPointsType(), -totalDuckets);
|
||||||
|
|
||||||
|
|
||||||
|
@ -347,15 +347,15 @@ public class PurchaseFromCatalogAsGiftEvent extends MessageHandler {
|
|||||||
AchievementManager.progressAchievement(userId, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GiftReceiver"));
|
AchievementManager.progressAchievement(userId, Emulator.getGameEnvironment().getAchievementManager().getAchievement("GiftReceiver"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_INFINITE_CREDITS)) {
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_INFINITE_CREDITS)) {
|
||||||
if (totalCredits > 0) {
|
if (totalCredits > 0) {
|
||||||
this.client.getHabbo().giveCredits(-totalCredits);
|
this.client.getHabbo().giveCredits(-totalCredits);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (totalPoints > 0) {
|
if (totalPoints > 0) {
|
||||||
if (item.getPointsType() == 0 && !this.client.getHabbo().hasRight(Permission.ACC_INFINITE_PIXELS)) {
|
if (item.getPointsType() == 0 && !this.client.getHabbo().hasPermissionRight(Permission.ACC_INFINITE_PIXELS)) {
|
||||||
this.client.getHabbo().givePixels(-totalPoints);
|
this.client.getHabbo().givePixels(-totalPoints);
|
||||||
} else if (!this.client.getHabbo().hasRight(Permission.ACC_INFINITE_POINTS)) {
|
} else if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_INFINITE_POINTS)) {
|
||||||
this.client.getHabbo().givePoints(item.getPointsType(), -totalPoints);
|
this.client.getHabbo().givePoints(item.getPointsType(), -totalPoints);
|
||||||
}
|
}
|
||||||
this.client.sendResponse(new HabboActivityPointNotificationMessageComposer(this.client.getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -totalPoints, item.getPointsType()));
|
this.client.sendResponse(new HabboActivityPointNotificationMessageComposer(this.client.getHabbo().getHabboInfo().getCurrencyAmount(item.getPointsType()), -totalPoints, item.getPointsType()));
|
||||||
|
@ -100,11 +100,11 @@ public class PurchaseFromCatalogEvent extends PurchaseEvent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
((RoomBundleLayout) page).buyRoom(this.client.getHabbo());
|
((RoomBundleLayout) page).buyRoom(this.client.getHabbo());
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_INFINITE_CREDITS)) { //if the player has this perm disabled
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_INFINITE_CREDITS)) { //if the player has this perm disabled
|
||||||
this.client.getHabbo().getHabboInfo().addCredits(-roomBundleItem.getCredits()); // takes their credits away
|
this.client.getHabbo().getHabboInfo().addCredits(-roomBundleItem.getCredits()); // takes their credits away
|
||||||
this.client.sendResponse(new CreditBalanceComposer(this.client.getHabbo())); // Sends the updated currency composer window
|
this.client.sendResponse(new CreditBalanceComposer(this.client.getHabbo())); // Sends the updated currency composer window
|
||||||
}
|
}
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_INFINITE_POINTS)) { //if the player has this perm disabled
|
if (!this.client.getHabbo().hasPermissionRight(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.getHabbo().getHabboInfo().addCurrencyAmount(roomBundleItem.getPointsType(), -roomBundleItem.getPoints()); // takes their points away
|
||||||
this.client.sendResponse(new ActivityPointsMessageComposer(this.client.getHabbo())); // Sends the updated currency composer window
|
this.client.sendResponse(new ActivityPointsMessageComposer(this.client.getHabbo())); // Sends the updated currency composer window
|
||||||
}
|
}
|
||||||
@ -172,13 +172,13 @@ public class PurchaseFromCatalogEvent extends PurchaseEvent {
|
|||||||
item = page.getCatalogItem(itemId);
|
item = page.getCatalogItem(itemId);
|
||||||
// temp patch, can a dev with better knowledge than me look into this asap pls.
|
// temp patch, can a dev with better knowledge than me look into this asap pls.
|
||||||
if (page instanceof BotsLayout) {
|
if (page instanceof BotsLayout) {
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_UNLIMITED_BOTS) && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) {
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_UNLIMITED_BOTS) && this.client.getHabbo().getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) {
|
||||||
this.client.getHabbo().alert(Emulator.getTexts().getValue("error.bots.max.inventory").replace("%amount%", BotManager.MAXIMUM_BOT_INVENTORY_SIZE + ""));
|
this.client.getHabbo().alert(Emulator.getTexts().getValue("error.bots.max.inventory").replace("%amount%", BotManager.MAXIMUM_BOT_INVENTORY_SIZE + ""));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (page instanceof PetsLayout) { // checks it's the petlayout
|
if (page instanceof PetsLayout) { // checks it's the petlayout
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_UNLIMITED_PETS) && this.client.getHabbo().getInventory().getPetsComponent().getPets().size() >= PetManager.MAXIMUM_PET_INVENTORY_SIZE) {
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_UNLIMITED_PETS) && this.client.getHabbo().getInventory().getPetsComponent().getPets().size() >= PetManager.MAXIMUM_PET_INVENTORY_SIZE) {
|
||||||
this.client.getHabbo().alert(Emulator.getTexts().getValue("error.pets.max.inventory").replace("%amount%", PetManager.MAXIMUM_PET_INVENTORY_SIZE + ""));
|
this.client.getHabbo().alert(Emulator.getTexts().getValue("error.pets.max.inventory").replace("%amount%", PetManager.MAXIMUM_PET_INVENTORY_SIZE + ""));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ public class PresentOpenEvent extends MessageHandler {
|
|||||||
if (room == null)
|
if (room == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (room.getRoomInfo().getOwnerInfo().getId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)) {
|
if (room.getRoomInfo().getOwnerInfo().getId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermissionRight(Permission.ACC_ANYROOMOWNER)) {
|
||||||
int id = this.packet.readInt();
|
int id = this.packet.readInt();
|
||||||
RoomItem item = room.getRoomItemManager().getRoomItemById(id);
|
RoomItem item = room.getRoomItemManager().getRoomItemById(id);
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public class UpdateFloorPropertiesEvent extends MessageHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_FLOORPLAN_EDITOR)) {
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_FLOORPLAN_EDITOR)) {
|
||||||
this.client.sendResponse(new HabboBroadcastMessageComposer(Emulator.getTexts().getValue("floorplan.permission")));
|
this.client.sendResponse(new HabboBroadcastMessageComposer(Emulator.getTexts().getValue("floorplan.permission")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ public class UpdateFloorPropertiesEvent extends MessageHandler {
|
|||||||
if (room == null)
|
if (room == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (room.getRoomInfo().getOwnerInfo().getId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)) {
|
if (room.getRoomInfo().getOwnerInfo().getId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermissionRight(Permission.ACC_ANYROOMOWNER)) {
|
||||||
StringJoiner errors = new StringJoiner("<br />");
|
StringJoiner errors = new StringJoiner("<br />");
|
||||||
String map = this.packet.readString();
|
String map = this.packet.readString();
|
||||||
map = map.replace("X", "x");
|
map = map.replace("X", "x");
|
||||||
|
@ -65,12 +65,12 @@ public class AcceptFriendEvent extends MessageHandler {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.client.getHabbo().getMessenger().getFriends().size() >= this.client.getHabbo().getHabboStats().getMaxFriends() && !this.client.getHabbo().hasRight(Permission.ACC_INFINITE_FRIENDS)) {
|
if(this.client.getHabbo().getMessenger().getFriends().size() >= this.client.getHabbo().getHabboStats().getMaxFriends() && !this.client.getHabbo().hasPermissionRight(Permission.ACC_INFINITE_FRIENDS)) {
|
||||||
this.client.sendResponse(new MessengerErrorComposer(MessengerErrorComposer.FRIEND_LIST_OWN_FULL));
|
this.client.sendResponse(new MessengerErrorComposer(MessengerErrorComposer.FRIEND_LIST_OWN_FULL));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(target.getMessenger().getFriends().size() >= target.getHabboStats().getMaxFriends() && !target.hasRight(Permission.ACC_INFINITE_FRIENDS)) {
|
if(target.getMessenger().getFriends().size() >= target.getHabboStats().getMaxFriends() && !target.hasPermissionRight(Permission.ACC_INFINITE_FRIENDS)) {
|
||||||
this.client.sendResponse(new MessengerErrorComposer(MessengerErrorComposer.FRIEND_LIST_TARGET_FULL));
|
this.client.sendResponse(new MessengerErrorComposer(MessengerErrorComposer.FRIEND_LIST_TARGET_FULL));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -64,13 +64,13 @@ public class RequestFriendEvent extends MessageHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// You can only have x friends
|
// You can only have x friends
|
||||||
if (this.client.getHabbo().getMessenger().getFriends().values().size() >= this.client.getHabbo().getHabboStats().getMaxFriends() && !this.client.getHabbo().hasRight(Permission.ACC_INFINITE_FRIENDS)) {
|
if (this.client.getHabbo().getMessenger().getFriends().values().size() >= this.client.getHabbo().getHabboStats().getMaxFriends() && !this.client.getHabbo().hasPermissionRight(Permission.ACC_INFINITE_FRIENDS)) {
|
||||||
this.client.sendResponse(new MessengerErrorComposer(MessengerErrorComposer.FRIEND_LIST_OWN_FULL));
|
this.client.sendResponse(new MessengerErrorComposer(MessengerErrorComposer.FRIEND_LIST_OWN_FULL));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if targets friendlist is full
|
// Check if targets friendlist is full
|
||||||
if (targetHabbo.getMessenger().getFriends().values().size() >= targetHabbo.getHabboStats().getMaxFriends() && !targetHabbo.hasRight(Permission.ACC_INFINITE_FRIENDS)) {
|
if (targetHabbo.getMessenger().getFriends().values().size() >= targetHabbo.getHabboStats().getMaxFriends() && !targetHabbo.hasPermissionRight(Permission.ACC_INFINITE_FRIENDS)) {
|
||||||
this.client.sendResponse(new MessengerErrorComposer(MessengerErrorComposer.FRIEND_LIST_TARGET_FULL));
|
this.client.sendResponse(new MessengerErrorComposer(MessengerErrorComposer.FRIEND_LIST_TARGET_FULL));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ public class VisitUserEvent extends MessageHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (habbo.getHabboStats().isBlockFollowing() && !this.client.getHabbo().hasRight(Permission.ACC_CAN_STALK)) {
|
if (habbo.getHabboStats().isBlockFollowing() && !this.client.getHabbo().hasPermissionRight(Permission.ACC_CAN_STALK)) {
|
||||||
this.client.sendResponse(new FollowFriendFailedComposer(FollowFriendFailedComposer.FRIEND_BLOCKED_STALKING));
|
this.client.sendResponse(new FollowFriendFailedComposer(FollowFriendFailedComposer.FRIEND_BLOCKED_STALKING));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -15,13 +15,13 @@ public class GuideSessionOnDutyUpdateEvent extends MessageHandler {
|
|||||||
boolean helperRequests = this.packet.readBoolean();
|
boolean helperRequests = this.packet.readBoolean();
|
||||||
boolean bullyReports = this.packet.readBoolean();
|
boolean bullyReports = this.packet.readBoolean();
|
||||||
|
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_HELPER_USE_GUIDE_TOOL))
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_HELPER_USE_GUIDE_TOOL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (helperRequests && !this.client.getHabbo().hasRight(Permission.ACC_HELPER_GIVE_GUIDE_TOURS))
|
if (helperRequests && !this.client.getHabbo().hasPermissionRight(Permission.ACC_HELPER_GIVE_GUIDE_TOURS))
|
||||||
helperRequests = false;
|
helperRequests = false;
|
||||||
|
|
||||||
if (bullyReports && !this.client.getHabbo().hasRight(Permission.ACC_HELPER_JUDGE_CHAT_REVIEWS))
|
if (bullyReports && !this.client.getHabbo().hasPermissionRight(Permission.ACC_HELPER_JUDGE_CHAT_REVIEWS))
|
||||||
bullyReports = false;
|
bullyReports = false;
|
||||||
|
|
||||||
if (helperRequests) {
|
if (helperRequests) {
|
||||||
|
@ -18,7 +18,7 @@ public class AddAdminRightsToMemberEvent extends MessageHandler {
|
|||||||
|
|
||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
|
|
||||||
if (guild != null && (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN))) {
|
if (guild != null && (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN))) {
|
||||||
Emulator.getGameEnvironment().getGuildManager().setAdmin(guild, userId);
|
Emulator.getGameEnvironment().getGuildManager().setAdmin(guild, userId);
|
||||||
|
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
|
@ -30,7 +30,7 @@ public class ApproveMembershipRequestEvent extends MessageHandler {
|
|||||||
else userInfo = habbo.getHabboInfo();
|
else userInfo = habbo.getHabboInfo();
|
||||||
|
|
||||||
|
|
||||||
if (userInfo == null || groupMember == null || userId == this.client.getHabbo().getHabboInfo().getId() || (!this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN) && guild.getOwnerId() != this.client.getHabbo().getHabboInfo().getId() && !groupMember.getRank().equals(GuildRank.ADMIN) && !groupMember.getRank().equals(GuildRank.OWNER)))
|
if (userInfo == null || groupMember == null || userId == this.client.getHabbo().getHabboInfo().getId() || (!this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN) && guild.getOwnerId() != this.client.getHabbo().getHabboInfo().getId() && !groupMember.getRank().equals(GuildRank.ADMIN) && !groupMember.getRank().equals(GuildRank.OWNER)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!userInfo.getHabboStats().hasGuild(guild.getId())) {
|
if (!userInfo.getHabboStats().hasGuild(guild.getId())) {
|
||||||
|
@ -31,7 +31,7 @@ public class CreateGuildEvent extends GuildBadgeEvent {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_INFINITE_CREDITS)) {
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_INFINITE_CREDITS)) {
|
||||||
int guildPrice = Emulator.getConfig().getInt("catalog.guild.price");
|
int guildPrice = Emulator.getConfig().getInt("catalog.guild.price");
|
||||||
if (this.client.getHabbo().getHabboInfo().getCredits() >= guildPrice) {
|
if (this.client.getHabbo().getHabboInfo().getCredits() >= guildPrice) {
|
||||||
this.client.getHabbo().giveCredits(-guildPrice);
|
this.client.getHabbo().giveCredits(-guildPrice);
|
||||||
|
@ -20,7 +20,7 @@ public class DeactivateGuildEvent extends MessageHandler {
|
|||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
|
|
||||||
if (guild != null) {
|
if (guild != null) {
|
||||||
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN)) //TODO Add staff permission override.
|
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN)) //TODO Add staff permission override.
|
||||||
{
|
{
|
||||||
THashSet<GuildMember> members = Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild.getId());
|
THashSet<GuildMember> members = Emulator.getGameEnvironment().getGuildManager().getGuildMembers(guild.getId());
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ public class GetGuildMembersEvent extends MessageHandler {
|
|||||||
Guild g = Emulator.getGameEnvironment().getGuildManager().getGuild(groupId);
|
Guild g = Emulator.getGameEnvironment().getGuildManager().getGuild(groupId);
|
||||||
|
|
||||||
if (g != null) {
|
if (g != null) {
|
||||||
boolean isAdmin = this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN);
|
boolean isAdmin = this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN);
|
||||||
if (!isAdmin && this.client.getHabbo().getHabboStats().hasGuild(g.getId())) {
|
if (!isAdmin && this.client.getHabbo().getHabboStats().hasGuild(g.getId())) {
|
||||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(g, this.client.getHabbo());
|
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(g, this.client.getHabbo());
|
||||||
isAdmin = member != null && (member.getRank().equals(GuildRank.OWNER) || member.getRank().equals(GuildRank.ADMIN));
|
isAdmin = member != null && (member.getRank().equals(GuildRank.OWNER) || member.getRank().equals(GuildRank.ADMIN));
|
||||||
|
@ -19,7 +19,7 @@ public class GetMemberGuildItemCountEvent extends MessageHandler {
|
|||||||
|
|
||||||
if (guild == null) return;
|
if (guild == null) return;
|
||||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
|
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) || member.getRank().equals(GuildRank.ADMIN))) || this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN)) {
|
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || (member != null && (member.getRank().equals(GuildRank.OWNER) || member.getRank().equals(GuildRank.ADMIN))) || this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN)) {
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(guild.getRoomId());
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
|
@ -24,7 +24,7 @@ public class KickMemberEvent extends MessageHandler {
|
|||||||
|
|
||||||
if (guild != null) {
|
if (guild != null) {
|
||||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
|
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) || member.getRank().equals(GuildRank.ADMIN) || this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN)) {
|
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.OWNER) || member.getRank().equals(GuildRank.ADMIN) || this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN)) {
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
GuildRemovedMemberEvent removedMemberEvent = new GuildRemovedMemberEvent(guild, userId, habbo);
|
GuildRemovedMemberEvent removedMemberEvent = new GuildRemovedMemberEvent(guild, userId, habbo);
|
||||||
Emulator.getPluginManager().fireEvent(removedMemberEvent);
|
Emulator.getPluginManager().fireEvent(removedMemberEvent);
|
||||||
|
@ -23,7 +23,7 @@ public class RejectMembershipRequestEvent extends MessageHandler {
|
|||||||
|
|
||||||
if (guild != null) {
|
if (guild != null) {
|
||||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guild, this.client.getHabbo());
|
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.ADMIN)|| member.getRank().equals(GuildRank.OWNER) || this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN)) {
|
if (userId == this.client.getHabbo().getHabboInfo().getId() || guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.ADMIN)|| member.getRank().equals(GuildRank.OWNER) || this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN)) {
|
||||||
guild.decreaseRequestCount();
|
guild.decreaseRequestCount();
|
||||||
Emulator.getGameEnvironment().getGuildManager().removeMember(guild, userId);
|
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, "")));
|
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, "")));
|
||||||
|
@ -19,7 +19,7 @@ public class RemoveAdminRightsFromMemberEvent extends MessageHandler {
|
|||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
|
|
||||||
if (guild != null) {
|
if (guild != null) {
|
||||||
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN)) {
|
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN)) {
|
||||||
int userId = this.packet.readInt();
|
int userId = this.packet.readInt();
|
||||||
|
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getActiveRoomById(guild.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getActiveRoomById(guild.getRoomId());
|
||||||
|
@ -13,7 +13,7 @@ public class UpdateGuildBadgeEvent extends GuildBadgeEvent {
|
|||||||
|
|
||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
if (guild != null) {
|
if (guild != null) {
|
||||||
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN)) {
|
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN)) {
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getActiveRoomById(guild.getRoomId());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getActiveRoomById(guild.getRoomId());
|
||||||
|
|
||||||
if (room == null || room.getRoomInfo().getId() != guild.getRoomId())
|
if (room == null || room.getRoomInfo().getId() != guild.getRoomId())
|
||||||
|
@ -15,7 +15,7 @@ public class UpdateGuildColorsEvent extends MessageHandler {
|
|||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
|
|
||||||
if (guild != null) {
|
if (guild != null) {
|
||||||
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN)) {
|
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN)) {
|
||||||
GuildChangedColorsEvent colorsEvent = new GuildChangedColorsEvent(guild, this.packet.readInt(), this.packet.readInt());
|
GuildChangedColorsEvent colorsEvent = new GuildChangedColorsEvent(guild, this.packet.readInt(), this.packet.readInt());
|
||||||
Emulator.getPluginManager().fireEvent(colorsEvent);
|
Emulator.getPluginManager().fireEvent(colorsEvent);
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ public class UpdateGuildIdentityEvent extends MessageHandler {
|
|||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
|
|
||||||
if (guild != null) {
|
if (guild != null) {
|
||||||
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN)) {
|
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN)) {
|
||||||
GuildChangedNameEvent nameEvent = new GuildChangedNameEvent(guild, this.packet.readString(), this.packet.readString());
|
GuildChangedNameEvent nameEvent = new GuildChangedNameEvent(guild, this.packet.readString(), this.packet.readString());
|
||||||
Emulator.getPluginManager().fireEvent(nameEvent);
|
Emulator.getPluginManager().fireEvent(nameEvent);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ public class UpdateGuildSettingsEvent extends MessageHandler {
|
|||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
|
|
||||||
if (guild != null) {
|
if (guild != null) {
|
||||||
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasRight(Permission.ACC_GUILD_ADMIN)) {
|
if (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || this.client.getHabbo().hasPermissionRight(Permission.ACC_GUILD_ADMIN)) {
|
||||||
GuildChangedSettingsEvent settingsEvent = new GuildChangedSettingsEvent(guild, this.packet.readInt(), this.packet.readInt() == 0);
|
GuildChangedSettingsEvent settingsEvent = new GuildChangedSettingsEvent(guild, this.packet.readInt(), this.packet.readInt() == 0);
|
||||||
Emulator.getPluginManager().fireEvent(settingsEvent);
|
Emulator.getPluginManager().fireEvent(settingsEvent);
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ public class GetMessagesEvent extends MessageHandler {
|
|||||||
|
|
||||||
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
Guild guild = Emulator.getGameEnvironment().getGuildManager().getGuild(guildId);
|
||||||
ForumThread thread = ForumThread.getById(threadId);
|
ForumThread thread = ForumThread.getById(threadId);
|
||||||
boolean hasStaffPermissions = this.client.getHabbo().hasRight(Permission.ACC_MODTOOL_TICKET_Q);
|
boolean hasStaffPermissions = this.client.getHabbo().hasPermissionRight(Permission.ACC_MODTOOL_TICKET_Q);
|
||||||
if (guild == null || thread == null) {
|
if (guild == null || thread == null) {
|
||||||
this.client.sendResponse(new ErrorReportComposer(404));
|
this.client.sendResponse(new ErrorReportComposer(404));
|
||||||
return;
|
return;
|
||||||
|
@ -37,7 +37,7 @@ public class ModerateMessageEvent extends MessageHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean hasStaffPermissions = this.client.getHabbo().hasRight(Permission.ACC_MODTOOL_TICKET_Q);
|
boolean hasStaffPermissions = this.client.getHabbo().hasPermissionRight(Permission.ACC_MODTOOL_TICKET_Q);
|
||||||
|
|
||||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
|
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
|
||||||
if (member == null) {
|
if (member == null) {
|
||||||
|
@ -33,7 +33,7 @@ public class ModerateThreadEvent extends MessageHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
|
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
|
||||||
boolean hasStaffPerms = this.client.getHabbo().hasRight(Permission.ACC_MODTOOL_TICKET_Q); // check for if they have staff perm
|
boolean hasStaffPerms = this.client.getHabbo().hasPermissionRight(Permission.ACC_MODTOOL_TICKET_Q); // check for if they have staff perm
|
||||||
boolean isGuildAdmin = (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.ADMIN));
|
boolean isGuildAdmin = (guild.getOwnerId() == this.client.getHabbo().getHabboInfo().getId() || member.getRank().equals(GuildRank.ADMIN));
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public class PostMessageEvent extends MessageHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isStaff = this.client.getHabbo().hasRight(Permission.ACC_MODTOOL_TICKET_Q);
|
boolean isStaff = this.client.getHabbo().hasPermissionRight(Permission.ACC_MODTOOL_TICKET_Q);
|
||||||
|
|
||||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
|
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ public class UpdateThreadEvent extends MessageHandler {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isStaff = this.client.getHabbo().hasRight(Permission.ACC_MODTOOL_TICKET_Q);
|
boolean isStaff = this.client.getHabbo().hasPermissionRight(Permission.ACC_MODTOOL_TICKET_Q);
|
||||||
|
|
||||||
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
|
GuildMember member = Emulator.getGameEnvironment().getGuildManager().getGuildMember(guildId, this.client.getHabbo().getHabboInfo().getId());
|
||||||
if (member == null) {
|
if (member == null) {
|
||||||
|
@ -217,7 +217,7 @@ public class SSOTicketEvent extends MessageHandler {
|
|||||||
|
|
||||||
messages.add(new ScrSendUserInfoComposer(this.client.getHabbo(), SubscriptionHabboClub.HABBO_CLUB, ScrSendUserInfoComposer.RESPONSE_TYPE_LOGIN).compose());
|
messages.add(new ScrSendUserInfoComposer(this.client.getHabbo(), SubscriptionHabboClub.HABBO_CLUB, ScrSendUserInfoComposer.RESPONSE_TYPE_LOGIN).compose());
|
||||||
|
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
messages.add(new ModeratorInitMessageComposer(this.client.getHabbo()).compose());
|
messages.add(new ModeratorInitMessageComposer(this.client.getHabbo()).compose());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import com.eu.habbo.messages.incoming.MessageHandler;
|
|||||||
public class CloseIssueDefaultActionEvent extends MessageHandler {
|
public class CloseIssueDefaultActionEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
int issueId = this.packet.readInt();
|
int issueId = this.packet.readInt();
|
||||||
int unknown = this.packet.readInt();
|
int unknown = this.packet.readInt();
|
||||||
int category = this.packet.readInt();
|
int category = this.packet.readInt();
|
||||||
|
@ -10,7 +10,7 @@ import com.eu.habbo.messages.incoming.MessageHandler;
|
|||||||
public class CloseIssuesEvent extends MessageHandler {
|
public class CloseIssuesEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
int state = this.packet.readInt();
|
int state = this.packet.readInt();
|
||||||
int something = this.packet.readInt();
|
int something = this.packet.readInt();
|
||||||
int ticketId = this.packet.readInt();
|
int ticketId = this.packet.readInt();
|
||||||
|
@ -15,7 +15,7 @@ import java.util.stream.Collectors;
|
|||||||
public class GetCfhChatlogEvent extends MessageHandler {
|
public class GetCfhChatlogEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
ModToolIssue issue = Emulator.getGameEnvironment().getModToolManager().getTicket(this.packet.readInt());
|
ModToolIssue issue = Emulator.getGameEnvironment().getModToolManager().getTicket(this.packet.readInt());
|
||||||
|
|
||||||
if (issue != null) {
|
if (issue != null) {
|
||||||
|
@ -10,7 +10,7 @@ import com.eu.habbo.messages.outgoing.modtool.ModeratorRoomInfoComposer;
|
|||||||
public class GetModeratorRoomInfoEvent extends MessageHandler {
|
public class GetModeratorRoomInfoEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
int roomId = this.packet.readInt();
|
int roomId = this.packet.readInt();
|
||||||
|
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getActiveRoomById(roomId);
|
Room room = Emulator.getGameEnvironment().getRoomManager().getActiveRoomById(roomId);
|
||||||
|
@ -9,7 +9,7 @@ import com.eu.habbo.messages.incoming.MessageHandler;
|
|||||||
public class GetModeratorUserInfoEvent extends MessageHandler {
|
public class GetModeratorUserInfoEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
ModToolManager.requestUserInfo(this.client, this.packet);
|
ModToolManager.requestUserInfo(this.client, this.packet);
|
||||||
} else {
|
} else {
|
||||||
ScripterManager.scripterDetected(this.client, Emulator.getTexts().getValue("scripter.warning.userinfo").replace("%username%", this.client.getHabbo().getHabboInfo().getUsername()));
|
ScripterManager.scripterDetected(this.client, Emulator.getTexts().getValue("scripter.warning.userinfo").replace("%username%", this.client.getHabbo().getHabboInfo().getUsername()));
|
||||||
|
@ -10,7 +10,7 @@ import com.eu.habbo.messages.outgoing.modtool.RoomChatlogComposer;
|
|||||||
public class GetRoomChatlogEvent extends MessageHandler {
|
public class GetRoomChatlogEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
this.packet.readInt();
|
this.packet.readInt();
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getActiveRoomById(this.packet.readInt());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getActiveRoomById(this.packet.readInt());
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import com.eu.habbo.messages.outgoing.modtool.RoomVisitsComposer;
|
|||||||
public class GetRoomVisitsEvent extends MessageHandler {
|
public class GetRoomVisitsEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
int userId = this.packet.readInt();
|
int userId = this.packet.readInt();
|
||||||
|
|
||||||
HabboInfo habboInfo = Emulator.getGameEnvironment().getHabboManager().getHabboInfo(userId);
|
HabboInfo habboInfo = Emulator.getGameEnvironment().getHabboManager().getHabboInfo(userId);
|
||||||
|
@ -10,7 +10,7 @@ import com.eu.habbo.messages.outgoing.modtool.UserChatlogComposer;
|
|||||||
public class GetUserChatlogEvent extends MessageHandler {
|
public class GetUserChatlogEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
int userId = this.packet.readInt();
|
int userId = this.packet.readInt();
|
||||||
String username = HabboManager.getOfflineHabboInfo(userId).getUsername();
|
String username = HabboManager.getOfflineHabboInfo(userId).getUsername();
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ public class ModAlertEvent extends MessageHandler {
|
|||||||
String message = this.packet.readString();
|
String message = this.packet.readString();
|
||||||
int cfhTopic = this.packet.readInt();
|
int cfhTopic = this.packet.readInt();
|
||||||
|
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) return;
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) return;
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
|
|
||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
|
@ -52,7 +52,7 @@ public class ModBanEvent extends MessageHandler {
|
|||||||
case BAN_AVATAR_ONLY_100_YEARS:
|
case BAN_AVATAR_ONLY_100_YEARS:
|
||||||
duration = Emulator.getIntUnixTimestamp();
|
duration = Emulator.getIntUnixTimestamp();
|
||||||
}
|
}
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
ScripterManager.scripterDetected(this.client, Emulator.getTexts().getValue("scripter.warning.modtools.ban").replace("%username%", this.client.getHabbo().getHabboInfo().getUsername()));
|
ScripterManager.scripterDetected(this.client, Emulator.getTexts().getValue("scripter.warning.modtools.ban").replace("%username%", this.client.getHabbo().getHabboInfo().getUsername()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import com.eu.habbo.plugin.events.support.SupportUserAlertedReason;
|
|||||||
public class ModMessageEvent extends MessageHandler {
|
public class ModMessageEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
Habbo alertedUser = Emulator.getGameEnvironment().getHabboManager().getHabbo(this.packet.readInt());
|
Habbo alertedUser = Emulator.getGameEnvironment().getHabboManager().getHabbo(this.packet.readInt());
|
||||||
|
|
||||||
if (alertedUser != null)
|
if (alertedUser != null)
|
||||||
|
@ -20,7 +20,7 @@ public class ModMuteEvent extends MessageHandler {
|
|||||||
String message = this.packet.readString();
|
String message = this.packet.readString();
|
||||||
int cfhTopic = this.packet.readInt();
|
int cfhTopic = this.packet.readInt();
|
||||||
|
|
||||||
if (!this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) return;
|
if (!this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) return;
|
||||||
|
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
if (habbo == null) {
|
if (habbo == null) {
|
||||||
|
@ -11,7 +11,7 @@ import com.eu.habbo.messages.outgoing.modtool.RoomChatlogComposer;
|
|||||||
public class ModToolRequestRoomUserChatlogEvent extends MessageHandler {
|
public class ModToolRequestRoomUserChatlogEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
int userId = this.packet.readInt();
|
int userId = this.packet.readInt();
|
||||||
|
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
|
@ -9,7 +9,7 @@ import com.eu.habbo.threading.runnables.UpdateModToolIssue;
|
|||||||
public class ModToolSanctionEvent extends MessageHandler {
|
public class ModToolSanctionEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
int ticketId = this.packet.readInt();
|
int ticketId = this.packet.readInt();
|
||||||
int unknownInt = this.packet.readInt();
|
int unknownInt = this.packet.readInt();
|
||||||
int categoryId = this.packet.readInt();
|
int categoryId = this.packet.readInt();
|
||||||
|
@ -10,7 +10,7 @@ import com.eu.habbo.plugin.events.support.SupportUserAlertedReason;
|
|||||||
public class ModToolWarnEvent extends MessageHandler {
|
public class ModToolWarnEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
Habbo alertedUser = Emulator.getGameEnvironment().getHabboManager().getHabbo(this.packet.readInt());
|
Habbo alertedUser = Emulator.getGameEnvironment().getHabboManager().getHabbo(this.packet.readInt());
|
||||||
|
|
||||||
if (alertedUser != null)
|
if (alertedUser != null)
|
||||||
|
@ -19,7 +19,7 @@ public class ModTradingLockEvent extends MessageHandler {
|
|||||||
int duration = this.packet.readInt();
|
int duration = this.packet.readInt();
|
||||||
int cfhTopic = this.packet.readInt();
|
int cfhTopic = this.packet.readInt();
|
||||||
|
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
Habbo habbo = Emulator.getGameEnvironment().getHabboManager().getHabbo(userId);
|
||||||
|
|
||||||
if (habbo != null) {
|
if (habbo != null) {
|
||||||
|
@ -9,7 +9,7 @@ import com.eu.habbo.messages.incoming.MessageHandler;
|
|||||||
public class ModerateRoomEvent extends MessageHandler {
|
public class ModerateRoomEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
Room room = Emulator.getGameEnvironment().getRoomManager().getActiveRoomById(this.packet.readInt());
|
Room room = Emulator.getGameEnvironment().getRoomManager().getActiveRoomById(this.packet.readInt());
|
||||||
|
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
|
@ -9,7 +9,7 @@ import com.eu.habbo.messages.incoming.MessageHandler;
|
|||||||
public class ModeratorActionEvent extends MessageHandler {
|
public class ModeratorActionEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
int type = this.packet.readInt();
|
int type = this.packet.readInt();
|
||||||
|
|
||||||
Room room = this.client.getHabbo().getRoomUnit().getRoom();
|
Room room = this.client.getHabbo().getRoomUnit().getRoom();
|
||||||
|
@ -13,7 +13,7 @@ public class PickIssuesEvent extends MessageHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle() {
|
public void handle() {
|
||||||
if (this.client.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL)) {
|
if (this.client.getHabbo().hasPermissionRight(Permission.ACC_SUPPORTTOOL)) {
|
||||||
this.packet.readInt();
|
this.packet.readInt();
|
||||||
ModToolIssue issue = Emulator.getGameEnvironment().getModToolManager().getTicket(this.packet.readInt());
|
ModToolIssue issue = Emulator.getGameEnvironment().getModToolManager().getTicket(this.packet.readInt());
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user