Merge branch 'ms4/refactor-permissions' into 'ms4/dev'

Finished Implementing New Permissions System

See merge request morningstar/Arcturus-Community!68
This commit is contained in:
Oliver 2023-06-05 16:40:42 +00:00
commit 3bb8ce1624
268 changed files with 1700 additions and 1303 deletions

View File

@ -216,6 +216,11 @@
<version>${org.mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.10.2</version>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,265 @@
/*
Navicat Premium Data Transfer
Source Server : phpmyadmin
Source Server Type : MySQL
Source Server Version : 100121
Source Host : localhost:3306
Source Schema : aurora
Target Server Type : MySQL
Target Server Version : 100121
File Encoding : 65001
Date: 03/06/2023 00:32:13
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for permission_commands
-- ----------------------------
DROP TABLE IF EXISTS `permission_commands`;
CREATE TABLE `permission_commands` (
`name` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`description` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT NULL,
`keys` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
PRIMARY KEY (`name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = ascii COLLATE = ascii_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of permission_commands
-- ----------------------------
INSERT INTO `permission_commands` VALUES ('cmd_add_youtube_playlist', ':update_youtube - Update YouTube playlist.', 'update_youtube;update_youtube_playlists');
INSERT INTO `permission_commands` VALUES ('cmd_alert', ':alert - Alert an user with a message.', 'alert;warning');
INSERT INTO `permission_commands` VALUES ('cmd_allow_trading', ':tradelock - Toggle the tradelock for a user.', 'tradelock;blocktrading;disabletrade');
INSERT INTO `permission_commands` VALUES ('cmd_badge', ':badge - Give or remove a badge from a user.', 'badge;givebadge');
INSERT INTO `permission_commands` VALUES ('cmd_ban', ':ban - Ban a user, you may specify time.', 'ban');
INSERT INTO `permission_commands` VALUES ('cmd_block_alert', ':ignore_alerts - Hotel alerts don\'t show anymore.', 'blockalerts;blockalert;ignorealerts;ignore_alerts');
INSERT INTO `permission_commands` VALUES ('cmd_bots', ':bots_info - Get bots info from current room.', 'bots;bots_info');
INSERT INTO `permission_commands` VALUES ('cmd_bundle', ':bundle - Bundle this room', 'bundle;roombundle');
INSERT INTO `permission_commands` VALUES ('cmd_calendar', ':calendar - Open calendar', 'calendar');
INSERT INTO `permission_commands` VALUES ('cmd_changename', ':change_name - Change username.', 'changename;flagme;change_name;namechange');
INSERT INTO `permission_commands` VALUES ('cmd_chatcolor', ':chat <chat_id> - Change chat bubble', 'chat;chatcolor');
INSERT INTO `permission_commands` VALUES ('cmd_control', ':control <username> - Take control over other user.', 'control');
INSERT INTO `permission_commands` VALUES ('cmd_coords', ':coords - Show your coordinates', 'coords;cordinates;coordinates;position');
INSERT INTO `permission_commands` VALUES ('cmd_credits', ':credits <username> <amount> - Give credits to user.', 'credits;coins');
INSERT INTO `permission_commands` VALUES ('cmd_diagonal', ':diagonal - Toggle diagonal walk.', 'diagonal;disablediagonal;diagonally');
INSERT INTO `permission_commands` VALUES ('cmd_disconnect', ':disconnect <username>- Disconnect a user', 'dc;disconnect');
INSERT INTO `permission_commands` VALUES ('cmd_duckets', ':duckets <username> <amount> - Give duckets to user.', 'pixels;duckets');
INSERT INTO `permission_commands` VALUES ('cmd_ejectall', ':ejectall', 'ejectall;ejectfurni');
INSERT INTO `permission_commands` VALUES ('cmd_empty', ':empty <username>', 'empty');
INSERT INTO `permission_commands` VALUES ('cmd_empty_bots', ':emptybots', 'emptybots;empty_bots;deletebots');
INSERT INTO `permission_commands` VALUES ('cmd_empty_pets', ':emptypets', 'emptypets;empty_pets;deletepets');
INSERT INTO `permission_commands` VALUES ('cmd_enable', ':enable <effect id>', 'enable;effect');
INSERT INTO `permission_commands` VALUES ('cmd_event', ':event <message>', 'event;roomevent');
INSERT INTO `permission_commands` VALUES ('cmd_faceless', ':faceless', 'faceless;face');
INSERT INTO `permission_commands` VALUES ('cmd_fastwalk', ':fastwalk', 'fastwalk;supersonic');
INSERT INTO `permission_commands` VALUES ('cmd_filterword', ':filter <word> [replacement]', 'filter;banword;filterword');
INSERT INTO `permission_commands` VALUES ('cmd_freeze', ':freeze <username>', 'freeze');
INSERT INTO `permission_commands` VALUES ('cmd_freeze_bots', ':freezebots', 'freeze_bot;freezebot;freezebots;freeze_bots');
INSERT INTO `permission_commands` VALUES ('cmd_gift', ':gift <username> <itemid>', 'gift');
INSERT INTO `permission_commands` VALUES ('cmd_give_rank', ':giverank <username> <rank>', 'giverank;setrank;give_rank;set_rank');
INSERT INTO `permission_commands` VALUES ('cmd_ha', ':ha <message>', 'hotelalert;ha');
INSERT INTO `permission_commands` VALUES ('cmd_hal', ':hal <url> <message>', 'hal;halink');
INSERT INTO `permission_commands` VALUES ('cmd_hand_item', ':handitem <itemid>', 'handitem;item;hand');
INSERT INTO `permission_commands` VALUES ('cmd_happy_hour', ':happyhour', 'happyhour;happy_hour');
INSERT INTO `permission_commands` VALUES ('cmd_hide_wired', ':hide_wired - Hide wired from room.', 'hidewired;hidemywired;wiredbegone;hide_wired');
INSERT INTO `permission_commands` VALUES ('cmd_invisible', ':invisible', 'invisible;hideme');
INSERT INTO `permission_commands` VALUES ('cmd_ip_ban', ':ipban <username> [reason]', 'ipban;banip;ip_ban;ban_ip');
INSERT INTO `permission_commands` VALUES ('cmd_machine_ban', ':machineban <username> [reason]', 'machineban;banmachine;banmac;macban');
INSERT INTO `permission_commands` VALUES ('cmd_mass_badge', ':mass_badge <badge>', 'massbadge;hotelbadge;mass_badge');
INSERT INTO `permission_commands` VALUES ('cmd_mass_credits', ':mass_credits <amount>', 'mass_credits;masscredits');
INSERT INTO `permission_commands` VALUES ('cmd_mass_duckets', ':mass_duckets <amount>', 'mass_duckets;massduckets;mass_pixels;masspixels');
INSERT INTO `permission_commands` VALUES ('cmd_mass_gift', ':mass_gift <itemid>', 'massgift;mass_gift');
INSERT INTO `permission_commands` VALUES ('cmd_mass_points', ':mass_points <amount> [type]', 'mass_points;masspoints');
INSERT INTO `permission_commands` VALUES ('cmd_mimic', ':mimic <username>', 'mimic;copy');
INSERT INTO `permission_commands` VALUES ('cmd_moonwalk', ':moonwalk', 'moonwalk;mj;moon_walk');
INSERT INTO `permission_commands` VALUES ('cmd_multi', ':multi', 'multi');
INSERT INTO `permission_commands` VALUES ('cmd_mute', ':mute <username>', 'mute;shutup');
INSERT INTO `permission_commands` VALUES ('cmd_pet_info', ':petinfo <petname>', 'pet;pet_info;petinfo');
INSERT INTO `permission_commands` VALUES ('cmd_pick_all', ':pickall - Pick all furni from current room.', 'pickall;pickupall');
INSERT INTO `permission_commands` VALUES ('cmd_points', ':points <username> <amount> [type]', 'diamonds;points');
INSERT INTO `permission_commands` VALUES ('cmd_promote_offer', ':promoteoffer <offer_id> [info]', 'promoteoffer;promotetargetoffer;promote_offer');
INSERT INTO `permission_commands` VALUES ('cmd_pull', ':pull <username>', 'pull');
INSERT INTO `permission_commands` VALUES ('cmd_push', ':push <username>', 'push');
INSERT INTO `permission_commands` VALUES ('cmd_redeem', ':redeem', 'redeem;exchange');
INSERT INTO `permission_commands` VALUES ('cmd_reload_room', ':reload_room', 'reload_room;reload;reloadroom');
INSERT INTO `permission_commands` VALUES ('cmd_required_custom', 'My description', '1');
INSERT INTO `permission_commands` VALUES ('cmd_rights', ':rights - Show my rights.', 'rights;acc_rights');
INSERT INTO `permission_commands` VALUES ('cmd_room_alert', ':room_alert <message>', 'roomalert;room_alert;ra');
INSERT INTO `permission_commands` VALUES ('cmd_room_badge', ':room_badge <badge>', 'roombadge;room_badge');
INSERT INTO `permission_commands` VALUES ('cmd_room_credits', ':room_credits <amount>', 'roomcredits;room_credits;roomcoins;room_coins');
INSERT INTO `permission_commands` VALUES ('cmd_room_dance', ':room_dance - Make everybody dance in the room.', 'danceall;room_dance;roomdance');
INSERT INTO `permission_commands` VALUES ('cmd_room_duckets', ':room_duckets <amount>', 'roompixels;room_pixels;roomduckets;room_duckets');
INSERT INTO `permission_commands` VALUES ('cmd_room_effect', ':room_effect [effect id]', 'roomeffect;room_effect');
INSERT INTO `permission_commands` VALUES ('cmd_room_gift', ':room_gift <item_id> [message]', 'roomgift;room_gift');
INSERT INTO `permission_commands` VALUES ('cmd_room_item', ':room_item [itemid]', 'roomitem;room_item');
INSERT INTO `permission_commands` VALUES ('cmd_room_kick', ':room_kick <message>', 'room_kick;kickall;roomkick;kick_all');
INSERT INTO `permission_commands` VALUES ('cmd_room_mute', ':room_mute', 'roommute;room_mute');
INSERT INTO `permission_commands` VALUES ('cmd_room_points', ':room_points <amount>', 'roompoints;room_points');
INSERT INTO `permission_commands` VALUES ('cmd_say', ':say <username> <text>', 'say;makesay');
INSERT INTO `permission_commands` VALUES ('cmd_say_all', ':sayall <message>', 'sayall;say_all');
INSERT INTO `permission_commands` VALUES ('cmd_set_max', ':setmax <amount>', 'setmax;set_max');
INSERT INTO `permission_commands` VALUES ('cmd_set_poll', ':setpoll <id>', 'setpoll;set_poll');
INSERT INTO `permission_commands` VALUES ('cmd_set_speed', ':setspeed <speed>', 'speed;setspeed');
INSERT INTO `permission_commands` VALUES ('cmd_shout', ':makeshout <username> <text>', 'makeshout');
INSERT INTO `permission_commands` VALUES ('cmd_shout_all', ':shoutall <message>', 'shoutall;shout_all;roomshout;room_shout');
INSERT INTO `permission_commands` VALUES ('cmd_shutdown', ':shutdown', 'stop;shutdown');
INSERT INTO `permission_commands` VALUES ('cmd_sitdown', ':sitdown', 'sitall;sitdown');
INSERT INTO `permission_commands` VALUES ('cmd_soft_kick', ':softkick', 'softkick');
INSERT INTO `permission_commands` VALUES ('cmd_staff_alert', ':staff_alert <message>', 'sa;staffalert;staff_alert');
INSERT INTO `permission_commands` VALUES ('cmd_staff_online', ':staff_online <min_rank>', 'staffonline;staffs;staff_online');
INSERT INTO `permission_commands` VALUES ('cmd_staff_summon', ':staff_summon <rank_id>', 'staffsummon;staff_summon;summonrank');
INSERT INTO `permission_commands` VALUES ('cmd_stalk', ':stalk <username>', 'stalk;follow;rape');
INSERT INTO `permission_commands` VALUES ('cmd_subscription', ':subscription', 'subscription;sub');
INSERT INTO `permission_commands` VALUES ('cmd_summon', ':summon <username>', 'summon');
INSERT INTO `permission_commands` VALUES ('cmd_super_ban', ':superban <username> [reason]', 'superban;megaban');
INSERT INTO `permission_commands` VALUES ('cmd_super_pull', ':super_pull <username>', 'spull;superpull;super_pull');
INSERT INTO `permission_commands` VALUES ('cmd_take_badge', ':takebadge <username> <badge>', 'takebadge;take_badge;remove_badge;removebadge');
INSERT INTO `permission_commands` VALUES ('cmd_talk', ':talk <username> <message>', 'talk');
INSERT INTO `permission_commands` VALUES ('cmd_teleport', ':teleport', 'tele;teleport');
INSERT INTO `permission_commands` VALUES ('cmd_transform', ':transform <name> <race> <color>', 'transform;becomepet');
INSERT INTO `permission_commands` VALUES ('cmd_unban', ':unban <username>', 'unban');
INSERT INTO `permission_commands` VALUES ('cmd_unload', ':unload', 'crash;unload');
INSERT INTO `permission_commands` VALUES ('cmd_unmute', ':unmute <username>', 'unmute');
INSERT INTO `permission_commands` VALUES ('cmd_update_achievements', ':update_achievements', 'uach;update_achievements');
INSERT INTO `permission_commands` VALUES ('cmd_update_bots', ':update_bots', 'update_bots;updatebots');
INSERT INTO `permission_commands` VALUES ('cmd_update_catalogue', ':update_catalog', 'reload_catalogue;reload_cata;update_catalogue;update_cata;update_catalog;update_shop');
INSERT INTO `permission_commands` VALUES ('cmd_update_config', ':update_config', 'update_config;update_configuration');
INSERT INTO `permission_commands` VALUES ('cmd_update_guildparts', ':update_guild_parts', 'update_guildparts;update_guild_parts');
INSERT INTO `permission_commands` VALUES ('cmd_update_hotel_view', ':update_hotel_view', 'update_view;update_hotel_view;update_hotelview');
INSERT INTO `permission_commands` VALUES ('cmd_update_items', ':update_items', 'update_items;reload_items');
INSERT INTO `permission_commands` VALUES ('cmd_update_navigator', ':update_navigator', 'update_navigator;update_nav');
INSERT INTO `permission_commands` VALUES ('cmd_update_permissions', ':update_permissions', 'update_permissions;update_perms');
INSERT INTO `permission_commands` VALUES ('cmd_update_pet_data', ':update_petdata', 'update_pet_data;update_petdata');
INSERT INTO `permission_commands` VALUES ('cmd_update_plugins', ':update_plugins', 'update_plugins;updateplugins');
INSERT INTO `permission_commands` VALUES ('cmd_update_polls', ':update_polls', 'update_polls;reload_polls');
INSERT INTO `permission_commands` VALUES ('cmd_update_texts', ':update_texts', 'update_texts;reload_texts');
INSERT INTO `permission_commands` VALUES ('cmd_update_wordfilter', ':update_word_filter', 'update_wordfilter;update_filter;update_word_filter');
INSERT INTO `permission_commands` VALUES ('cmd_user_info', ':user_info <username>', 'userinfo;user_info');
INSERT INTO `permission_commands` VALUES ('cmd_word_quiz', ':wordquiz <question>', 'wordquiz;quiz');
-- ----------------------------
-- Table structure for permission_group_commands
-- ----------------------------
DROP TABLE IF EXISTS `permission_group_commands`;
CREATE TABLE `permission_group_commands` (
`group_id` int(11) NOT NULL,
`command_name` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`setting_type` enum('0','1','2') CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '1',
PRIMARY KEY (`group_id`, `command_name`) USING BTREE,
INDEX `FK_GroupCommands`(`command_name`) USING BTREE,
CONSTRAINT `FK_GroupCommands` FOREIGN KEY (`command_name`) REFERENCES `permission_commands` (`name`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `FK_Groups` FOREIGN KEY (`group_id`) REFERENCES `permission_groups` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = ascii COLLATE = ascii_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for permission_group_rights
-- ----------------------------
DROP TABLE IF EXISTS `permission_group_rights`;
CREATE TABLE `permission_group_rights` (
`group_id` int(11) NOT NULL,
`right_name` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`setting_type` enum('0','1','2') CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '1',
PRIMARY KEY (`group_id`, `right_name`) USING BTREE,
INDEX `FK_GroupRights`(`right_name`) USING BTREE,
CONSTRAINT `FK_GroupRights` FOREIGN KEY (`right_name`) REFERENCES `permission_rights` (`name`) ON DELETE RESTRICT ON UPDATE RESTRICT,
CONSTRAINT `FK_Group` FOREIGN KEY (`group_id`) REFERENCES `permission_groups` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE = InnoDB CHARACTER SET = ascii COLLATE = ascii_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for permission_group_timers
-- ----------------------------
DROP TABLE IF EXISTS `permission_group_timers`;
CREATE TABLE `permission_group_timers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`group_id` int(11) NULL DEFAULT NULL,
`currency_type` int(11) NULL DEFAULT NULL,
`amount` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = ascii COLLATE = ascii_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for permission_groups
-- ----------------------------
DROP TABLE IF EXISTS `permission_groups`;
CREATE TABLE `permission_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '',
`description` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '',
`level` int(11) NULL DEFAULT 1,
`prefix` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '',
`prefix_color` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '',
`badge` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '',
`room_effect` int(11) NULL DEFAULT 0,
`log_enabled` enum('0','1') CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 8 CHARACTER SET = ascii COLLATE = ascii_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Table structure for permission_rights
-- ----------------------------
DROP TABLE IF EXISTS `permission_rights`;
CREATE TABLE `permission_rights` (
`name` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`description` varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`name`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = ascii COLLATE = ascii_general_ci ROW_FORMAT = Compact;
-- ----------------------------
-- Records of permission_rights
-- ----------------------------
INSERT INTO `permission_rights` VALUES ('acc_ads_background', NULL);
INSERT INTO `permission_rights` VALUES ('acc_ambassador', NULL);
INSERT INTO `permission_rights` VALUES ('acc_anychatcolor', NULL);
INSERT INTO `permission_rights` VALUES ('acc_anyroomowner', NULL);
INSERT INTO `permission_rights` VALUES ('acc_calendar_force', NULL);
INSERT INTO `permission_rights` VALUES ('acc_camera', NULL);
INSERT INTO `permission_rights` VALUES ('acc_can_stalk', NULL);
INSERT INTO `permission_rights` VALUES ('acc_catalog_ids', NULL);
INSERT INTO `permission_rights` VALUES ('acc_chat_no_filter', NULL);
INSERT INTO `permission_rights` VALUES ('acc_chat_no_flood', NULL);
INSERT INTO `permission_rights` VALUES ('acc_chat_no_limit', NULL);
INSERT INTO `permission_rights` VALUES ('acc_empty_others', NULL);
INSERT INTO `permission_rights` VALUES ('acc_enable_others', NULL);
INSERT INTO `permission_rights` VALUES ('acc_enteranyroom', NULL);
INSERT INTO `permission_rights` VALUES ('acc_floorplan_editor', NULL);
INSERT INTO `permission_rights` VALUES ('acc_fullrooms', NULL);
INSERT INTO `permission_rights` VALUES ('acc_guildgate', NULL);
INSERT INTO `permission_rights` VALUES ('acc_guild_admin', NULL);
INSERT INTO `permission_rights` VALUES ('acc_helper_give_guide_tours', NULL);
INSERT INTO `permission_rights` VALUES ('acc_helper_judge_chat_reviews', NULL);
INSERT INTO `permission_rights` VALUES ('acc_helper_use_guide_tool', NULL);
INSERT INTO `permission_rights` VALUES ('acc_hide_ip', NULL);
INSERT INTO `permission_rights` VALUES ('acc_hide_mail', NULL);
INSERT INTO `permission_rights` VALUES ('acc_infinite_credits', NULL);
INSERT INTO `permission_rights` VALUES ('acc_infinite_friends', NULL);
INSERT INTO `permission_rights` VALUES ('acc_infinite_pixels', NULL);
INSERT INTO `permission_rights` VALUES ('acc_infinite_points', NULL);
INSERT INTO `permission_rights` VALUES ('acc_mimic_unredeemed', NULL);
INSERT INTO `permission_rights` VALUES ('acc_modtool_room_info', NULL);
INSERT INTO `permission_rights` VALUES ('acc_modtool_room_logs', NULL);
INSERT INTO `permission_rights` VALUES ('acc_modtool_ticket_q', NULL);
INSERT INTO `permission_rights` VALUES ('acc_modtool_user_alert', NULL);
INSERT INTO `permission_rights` VALUES ('acc_modtool_user_ban', NULL);
INSERT INTO `permission_rights` VALUES ('acc_modtool_user_logs', NULL);
INSERT INTO `permission_rights` VALUES ('acc_moverotate', NULL);
INSERT INTO `permission_rights` VALUES ('acc_nomute', NULL);
INSERT INTO `permission_rights` VALUES ('acc_not_mimiced', NULL);
INSERT INTO `permission_rights` VALUES ('acc_no_mute', NULL);
INSERT INTO `permission_rights` VALUES ('acc_placefurni', NULL);
INSERT INTO `permission_rights` VALUES ('acc_see_tentchat', NULL);
INSERT INTO `permission_rights` VALUES ('acc_see_whispers', NULL);
INSERT INTO `permission_rights` VALUES ('acc_staff_pick', NULL);
INSERT INTO `permission_rights` VALUES ('acc_superwired', NULL);
INSERT INTO `permission_rights` VALUES ('acc_supporttool', NULL);
INSERT INTO `permission_rights` VALUES ('acc_trade_anywhere', NULL);
INSERT INTO `permission_rights` VALUES ('acc_unkickable', NULL);
INSERT INTO `permission_rights` VALUES ('acc_unlimited_bots', NULL);
INSERT INTO `permission_rights` VALUES ('acc_unlimited_pets', NULL);
INSERT INTO `aurora`.`emulator_texts`(`key`, `value`) VALUES ('commands.generic.cmd_rights.text', 'Your Rights');
SET FOREIGN_KEY_CHECKS = 1;

View File

@ -9,7 +9,6 @@ import java.sql.SQLException;
@AllArgsConstructor
public class CommandLog implements DatabaseLoggable {
private static final String INSERT_QUERY = "INSERT INTO commandlogs (`user_id`, `timestamp`, `command`, `params`, `succes`) VALUES (?, ?, ?, ?, ?)";
private final int userId;

View File

@ -51,7 +51,7 @@ public class CreditsScheduler extends Scheduler {
if (habbo.getRoomUnit().isIdle() && IGNORE_IDLED)
continue;
habbo.giveCredits((int) (habbo.getHabboInfo().getRank().getCreditsTimerAmount() * (habbo.getHabboStats().hasActiveClub() ? HC_MODIFIER : 1.0)));
habbo.giveCredits((int) (habbo.getHabboInfo().getPermissionGroup().getTimerAmount(-1) * (habbo.getHabboStats().hasActiveClub() ? HC_MODIFIER : 1.0)));
}
} catch (Exception e) {
log.error("Caught exception", e);

View File

@ -61,7 +61,7 @@ public class GotwPointsScheduler extends Scheduler {
}
type = Emulator.getConfig().getInt("seasonal.currency." + GOTW_POINTS_NAME, -1);
if (found || type != -1) {
habbo.givePoints(type, (int)(habbo.getHabboInfo().getRank().getGotwTimerAmount() * (habbo.getHabboStats().hasActiveClub() ? HC_MODIFIER : 1.0)));
habbo.givePoints(type, (int)(habbo.getHabboInfo().getPermissionGroup().getTimerAmount(type) * (habbo.getHabboStats().hasActiveClub() ? HC_MODIFIER : 1.0)));
}
}
} catch (Exception e) {

View File

@ -46,7 +46,7 @@ public class PixelScheduler extends Scheduler {
if (habbo.getRoomUnit().isIdle() && IGNORE_IDLED)
continue;
habbo.givePixels((int)(habbo.getHabboInfo().getRank().getPixelsTimerAmount() * (habbo.getHabboStats().hasActiveClub() ? HC_MODIFIER : 1.0)));
habbo.givePixels((int)(habbo.getHabboInfo().getPermissionGroup().getTimerAmount(0) * (habbo.getHabboStats().hasActiveClub() ? HC_MODIFIER : 1.0)));
}
} catch (Exception e) {
log.error("Caught exception", e);

View File

@ -51,7 +51,7 @@ public class PointsScheduler extends Scheduler {
continue;
//habbo.givePoints(POINTS);
habbo.givePoints((int)(habbo.getHabboInfo().getRank().getDiamondsTimerAmount() * (habbo.getHabboStats().hasActiveClub() ? HC_MODIFIER : 1.0)));
habbo.givePoints((int)(habbo.getHabboInfo().getPermissionGroup().getTimerAmount(5) * (habbo.getHabboStats().hasActiveClub() ? HC_MODIFIER : 1.0)));
}
} catch (Exception e) {
log.error("Caught exception", e);

View File

@ -1,6 +1,7 @@
package com.eu.habbo.core.consolecommands;
import com.eu.habbo.habbohotel.commands.ShutdownCommand;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.list.ShutdownCommand;
public class ConsoleShutdownCommand extends ConsoleCommand {
public ConsoleShutdownCommand() {
@ -9,6 +10,6 @@ public class ConsoleShutdownCommand extends ConsoleCommand {
@Override
public void handle(String[] args) {
new ShutdownCommand().handle(null, args);
Emulator.getGameEnvironment().getCommandsManager().handleCommand(null, args.toString());
}
}

View File

@ -9,7 +9,7 @@ import com.eu.habbo.habbohotel.achievements.AchievementManager;
import com.eu.habbo.habbohotel.bots.BotManager;
import com.eu.habbo.habbohotel.campaign.CalendarManager;
import com.eu.habbo.habbohotel.catalog.CatalogManager;
import com.eu.habbo.habbohotel.commands.CommandHandler;
import com.eu.habbo.habbohotel.commands.CommandsManager;
import com.eu.habbo.habbohotel.crafting.CraftingManager;
import com.eu.habbo.habbohotel.guides.GuideManager;
import com.eu.habbo.habbohotel.guilds.GuildManager;
@ -37,7 +37,6 @@ public class GameEnvironment {
private PointsScheduler pointsScheduler;
private GotwPointsScheduler gotwPointsScheduler;
private SubscriptionScheduler subscriptionScheduler;
private HabboManager habboManager;
private NavigatorManager navigatorManager;
private GuildManager guildManager;
@ -45,7 +44,7 @@ public class GameEnvironment {
private CatalogManager catalogManager;
private HotelViewManager hotelViewManager;
private RoomManager roomManager;
private CommandHandler commandHandler;
private CommandsManager commandsManager;
private PermissionsManager permissionsManager;
private BotManager botManager;
private ModToolManager modToolManager;
@ -73,7 +72,7 @@ public class GameEnvironment {
this.catalogManager = new CatalogManager();
this.roomManager = new RoomManager();
this.navigatorManager = new NavigatorManager();
this.commandHandler = new CommandHandler();
this.commandsManager = new CommandsManager();
this.modToolManager = new ModToolManager();
this.modToolSanctions = new ModToolSanctions();
this.achievementManager = new AchievementManager();
@ -112,7 +111,7 @@ public class GameEnvironment {
this.gotwPointsScheduler.setDisposed(true);
this.craftingManager.dispose();
this.habboManager.dispose();
this.commandHandler.dispose();
this.commandsManager.dispose();
this.guildManager.dispose();
this.catalogManager.dispose();
this.roomManager.dispose();

View File

@ -104,8 +104,8 @@ public class BotManager {
return;
if (room != null && bot != null && habbo != null) {
if (room.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER) || habbo.hasPermission(Permission.ACC_PLACEFURNI)) {
if (room.getCurrentBots().size() >= Room.MAXIMUM_BOTS && !habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS)) {
if (room.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasRight(Permission.ACC_ANYROOMOWNER) || habbo.hasRight(Permission.ACC_PLACEFURNI)) {
if (room.getCurrentBots().size() >= Room.MAXIMUM_BOTS && !habbo.hasRight(Permission.ACC_UNLIMITED_BOTS)) {
habbo.getClient().sendResponse(new BotErrorComposer(BotErrorComposer.ROOM_ERROR_MAX_BOTS));
return;
}
@ -173,8 +173,8 @@ public class BotManager {
if (pickedUpEvent.isCancelled())
return;
if (habbo == null || (bot.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasPermission(Permission.ACC_ANYROOMOWNER))) {
if (habbo != null && !habbo.hasPermission(Permission.ACC_UNLIMITED_BOTS) && habbo.getInventory().getBotsComponent().getBots().size() >= BotManager.MAXIMUM_BOT_INVENTORY_SIZE) {
if (habbo == null || (bot.getOwnerId() == habbo.getHabboInfo().getId() || habbo.hasRight(Permission.ACC_ANYROOMOWNER))) {
if (habbo != null && !habbo.hasRight(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 + ""));
return;
}

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.campaign;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.events.calendar.CampaignCalendarDoorOpenedMessageComposer;
import com.eu.habbo.plugin.events.users.calendar.UserClaimRewardEvent;
@ -121,7 +122,7 @@ public class CalendarManager {
if (object == null) return;
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.hasPermission("acc_calendar_force")))) {
if (((daysBetween >= 0 && daysBetween <= campaign.getTotalDays()) && (((daysBetween - day <= 2 || !campaign.getLockExpired()) && daysBetween - day >= 0)) || (force && habbo.hasRight(Permission.ACC_CALENDAR_FORCE)))) {
if (Emulator.getPluginManager().fireEvent(new UserClaimRewardEvent(habbo, campaign, day, object, force)).isCancelled()) {
return;
}

View File

@ -43,7 +43,6 @@ import lombok.extern.slf4j.Slf4j;
import java.sql.*;
import java.util.*;
import java.util.stream.Collectors;
import static com.eu.habbo.database.DatabaseConstants.CAUGHT_SQL_EXCEPTION;
@ -618,7 +617,7 @@ public class CatalogManager {
this.catalogPages.get(parentId).childPages.forEachValue(object -> {
boolean isVisiblePage = object.visible;
boolean hasRightRank = object.getRank() <= habbo.getHabboInfo().getRank().getId();
boolean hasRightRank = object.getRank() <= habbo.getHabboInfo().getPermissionGroup().getId();
boolean clubRightsOkay = !object.isClubOnly() || habbo.getHabboInfo().getHabboStats().hasActiveClub();
@ -1051,12 +1050,12 @@ public class CatalogManager {
UserCatalogItemPurchasedEvent purchasedEvent = new UserCatalogItemPurchasedEvent(habbo, item, itemsList, totalCredits, totalPoints, badges);
Emulator.getPluginManager().fireEvent(purchasedEvent);
if (!free && !habbo.getClient().getHabbo().hasPermission(Permission.ACC_INFINITE_CREDITS) && purchasedEvent.getTotalCredits() > 0) {
if (!free && !habbo.getClient().getHabbo().hasRight(Permission.ACC_INFINITE_CREDITS) && purchasedEvent.getTotalCredits() > 0) {
habbo.getClient().getHabbo().getHabboInfo().addCredits(-purchasedEvent.getTotalCredits());
habbo.getClient().sendResponse(new CreditBalanceComposer(habbo.getClient().getHabbo()));
}
if (!free && !habbo.getClient().getHabbo().hasPermission(Permission.ACC_INFINITE_POINTS) && purchasedEvent.getTotalPoints() > 0) {
if (!free && !habbo.getClient().getHabbo().hasRight(Permission.ACC_INFINITE_POINTS) && purchasedEvent.getTotalPoints() > 0) {
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()));
}

View File

@ -1,20 +1,21 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.interfaces.ICommand;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
public abstract class Command {
public final String permission;
public final String[] keys;
public abstract class Command implements ICommand {
@Getter
private final String name;
public Command(String name) {
this.name = name;
}
public abstract boolean handle(GameClient gameClient, String[] params) throws Exception;
protected Habbo getHabbo(String username) {
return Emulator.getGameEnvironment().getHabboManager().getHabbo(username);
}
@ -42,4 +43,4 @@ public abstract class Command {
protected String booleanToIntString(boolean value) {
return value ? "1" : "0";
}
}
}

View File

@ -1,337 +0,0 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.core.CommandLog;
import com.eu.habbo.habbohotel.commands.badge.BadgeCommand;
import com.eu.habbo.habbohotel.commands.badge.MassBadgeCommand;
import com.eu.habbo.habbohotel.commands.badge.RoomBadgeCommand;
import com.eu.habbo.habbohotel.commands.badge.TakeBadgeCommand;
import com.eu.habbo.habbohotel.commands.bans.BanCommand;
import com.eu.habbo.habbohotel.commands.bans.IPBanCommand;
import com.eu.habbo.habbohotel.commands.bans.MachineBanCommand;
import com.eu.habbo.habbohotel.commands.bans.SuperbanCommand;
import com.eu.habbo.habbohotel.commands.credits.CreditsCommand;
import com.eu.habbo.habbohotel.commands.credits.MassCreditsCommand;
import com.eu.habbo.habbohotel.commands.credits.RoomCreditsCommand;
import com.eu.habbo.habbohotel.commands.gift.GiftCommand;
import com.eu.habbo.habbohotel.commands.gift.MassGiftCommand;
import com.eu.habbo.habbohotel.commands.pixels.MassPixelsCommand;
import com.eu.habbo.habbohotel.commands.pixels.PixelCommand;
import com.eu.habbo.habbohotel.commands.pixels.RoomPixelsCommand;
import com.eu.habbo.habbohotel.commands.points.MassPointsCommand;
import com.eu.habbo.habbohotel.commands.points.PointsCommand;
import com.eu.habbo.habbohotel.commands.points.RoomPointsCommand;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.permissions.PermissionSetting;
import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.PetCommand;
import com.eu.habbo.habbohotel.pets.PetVocalsType;
import com.eu.habbo.habbohotel.pets.RideablePet;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomRightLevels;
import com.eu.habbo.messages.outgoing.rooms.users.UserTypingMessageComposer;
import com.eu.habbo.plugin.events.users.UserCommandEvent;
import com.eu.habbo.plugin.events.users.UserExecuteCommandEvent;
import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.hash.THashMap;
import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.NoSuchElementException;
@Slf4j
public class CommandHandler {
private static final THashMap<String, Command> commands = new THashMap<>(5);
private static final Comparator<Command> ALPHABETICAL_ORDER = (c1, c2) -> {
int res = String.CASE_INSENSITIVE_ORDER.compare(c1.permission, c2.permission);
return (res != 0) ? res : c1.permission.compareTo(c2.permission);
};
public CommandHandler() {
long millis = System.currentTimeMillis();
this.reloadCommands();
log.info("Command Handler -> Loaded! (" + (System.currentTimeMillis() - millis) + " MS)");
}
public static void addCommand(Command command) {
if (command == null)
return;
commands.put(command.getClass().getName(), command);
}
public static void addCommand(Class<? extends Command> command) {
try {
//command.getConstructor().setAccessible(true);
addCommand(command.getDeclaredConstructor().newInstance());
log.debug("Added command: {}", command.getName());
} catch (Exception e) {
log.error("Caught exception", e);
}
}
public static boolean handleCommand(GameClient gameClient, String commandLine) {
if (gameClient != null) {
if (commandLine.startsWith(":")) {
commandLine = commandLine.replaceFirst(":", "");
String[] parts = commandLine.split(" ");
if (parts.length >= 1) {
for (Command command : commands.values()) {
for (String s : command.keys) {
if (s.equalsIgnoreCase(parts[0])) {
boolean succes = false;
if (command.permission == null || gameClient.getHabbo().hasPermission(command.permission, gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && (gameClient.getHabbo().getHabboInfo().getCurrentRoom().hasRights(gameClient.getHabbo())) || gameClient.getHabbo().hasPermission(Permission.ACC_PLACEFURNI) || (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildId() > 0 && gameClient.getHabbo().getHabboInfo().getCurrentRoom().getGuildRightLevel(gameClient.getHabbo()).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS)))) {
try {
UserExecuteCommandEvent userExecuteCommandEvent = new UserExecuteCommandEvent(gameClient.getHabbo(), command, parts);
Emulator.getPluginManager().fireEvent(userExecuteCommandEvent);
if(userExecuteCommandEvent.isCancelled()) {
return userExecuteCommandEvent.isSuccess();
}
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null)
gameClient.getHabbo().getHabboInfo().getCurrentRoom().sendComposer(new UserTypingMessageComposer(gameClient.getHabbo().getRoomUnit(), false).compose());
UserCommandEvent event = new UserCommandEvent(gameClient.getHabbo(), parts, command.handle(gameClient, parts));
Emulator.getPluginManager().fireEvent(event);
succes = event.succes;
} catch (Exception e) {
log.error("Caught exception", e);
}
if (gameClient.getHabbo().getHabboInfo().getRank().isLogCommands()) {
Emulator.getDatabaseLogger().store(new CommandLog(gameClient.getHabbo().getHabboInfo().getId(), command, commandLine, succes));
}
}
return succes;
}
}
}
}
} else {
String[] args = commandLine.split(" ");
if (args.length <= 1)
return false;
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom() != null) {
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room.getCurrentPets().isEmpty())
return false;
TIntObjectIterator<Pet> petIterator = room.getCurrentPets().iterator();
for (int j = room.getCurrentPets().size(); j-- > 0; ) {
try {
petIterator.advance();
} catch (NoSuchElementException e) {
break;
}
Pet pet = petIterator.value();
if (pet != null && pet.getName().equalsIgnoreCase(args[0])) {
StringBuilder s = new StringBuilder();
for (int i = 1; i < args.length; i++) {
s.append(args[i]).append(" ");
}
s = new StringBuilder(s.substring(0, s.length() - 1));
for (PetCommand command : pet.getPetData().getPetCommands()) {
if (command.getKey().equalsIgnoreCase(s.toString())) {
if (pet instanceof RideablePet rideablePet && ((RideablePet) pet).getRider() != null) {
if (rideablePet.getRider().getHabboInfo().getId() == gameClient.getHabbo().getHabboInfo().getId()) {
rideablePet.getRider().getHabboInfo().dismountPet();
}
break;
}
if (command.getLevel() <= pet.getLevel())
pet.handleCommand(command, gameClient.getHabbo(), args);
else
pet.say(pet.getPetData().randomVocal(PetVocalsType.UNKNOWN_COMMAND));
break;
}
}
}
}
}
}
}
return false;
}
public static Command getCommand(String key) {
for (Command command : commands.values()) {
for (String k : command.keys) {
if (key.equalsIgnoreCase(k)) {
return command;
}
}
}
return null;
}
public void reloadCommands() {
addCommand(new AboutCommand());
addCommand(new AlertCommand());
addCommand(new AllowTradingCommand());
addCommand(new ArcturusCommand());
addCommand(new BadgeCommand());
addCommand(new BanCommand());
addCommand(new BlockAlertCommand());
addCommand(new BotsCommand());
addCommand(new CalendarCommand());
addCommand(new ChangeNameCommand());
addCommand(new ChatTypeCommand());
addCommand(new CommandsCommand());
addCommand(new ConnectCameraCommand());
addCommand(new ControlCommand());
addCommand(new CoordsCommand());
addCommand(new CreditsCommand());
addCommand(new DiagonalCommand());
addCommand(new DisconnectCommand());
addCommand(new EjectAllCommand());
addCommand(new EmptyInventoryCommand());
addCommand(new EmptyBotsInventoryCommand());
addCommand(new EmptyPetsInventoryCommand());
addCommand(new EnableCommand());
addCommand(new EventCommand());
addCommand(new FacelessCommand());
addCommand(new FastwalkCommand());
addCommand(new FilterWordCommand());
addCommand(new FreezeBotsCommand());
addCommand(new FreezeCommand());
addCommand(new GiftCommand());
addCommand(new GiveRankCommand());
addCommand(new HabnamCommand());
addCommand(new HandItemCommand());
addCommand(new HappyHourCommand());
addCommand(new HideWiredCommand());
addCommand(new HotelAlertCommand());
addCommand(new HotelAlertLinkCommand());
addCommand(new InvisibleCommand());
addCommand(new IPBanCommand());
addCommand(new LayCommand());
addCommand(new MachineBanCommand());
addCommand(new MassBadgeCommand());
addCommand(new RoomBadgeCommand());
addCommand(new MassCreditsCommand());
addCommand(new MassGiftCommand());
addCommand(new MassPixelsCommand());
addCommand(new MassPointsCommand());
addCommand(new MimicCommand());
addCommand(new MoonwalkCommand());
addCommand(new MultiCommand());
addCommand(new MuteBotsCommand());
addCommand(new MuteCommand());
addCommand(new MutePetsCommand());
addCommand(new PetInfoCommand());
addCommand(new PickallCommand());
addCommand(new PixelCommand());
addCommand(new PluginsCommand());
addCommand(new PointsCommand());
addCommand(new PromoteTargetOfferCommand());
addCommand(new PullCommand());
addCommand(new PushCommand());
addCommand(new RedeemCommand());
addCommand(new ReloadRoomCommand());
addCommand(new RoomAlertCommand());
addCommand(new RoomBundleCommand());
addCommand(new RoomCreditsCommand());
addCommand(new RoomDanceCommand());
addCommand(new RoomEffectCommand());
addCommand(new RoomItemCommand());
addCommand(new RoomKickCommand());
addCommand(new RoomMuteCommand());
addCommand(new RoomPixelsCommand());
addCommand(new RoomPointsCommand());
addCommand(new SayAllCommand());
addCommand(new SayCommand());
addCommand(new SetMaxCommand());
addCommand(new SetPollCommand());
addCommand(new SetSpeedCommand());
addCommand(new ShoutAllCommand());
addCommand(new ShoutCommand());
addCommand(new ShutdownCommand());
addCommand(new SitCommand());
addCommand(new StandCommand());
addCommand(new SitDownCommand());
addCommand(new StaffAlertCommand());
addCommand(new StaffOnlineCommand());
addCommand(new StalkCommand());
addCommand(new SummonCommand());
addCommand(new SummonRankCommand());
addCommand(new SuperbanCommand());
addCommand(new SuperPullCommand());
addCommand(new TakeBadgeCommand());
addCommand(new TeleportCommand());
addCommand(new TransformCommand());
addCommand(new TrashCommand());
addCommand(new UnbanCommand());
addCommand(new UnloadRoomCommand());
addCommand(new UnmuteCommand());
addCommand(new UpdateAchievements());
addCommand(new UpdateBotsCommand());
addCommand(new UpdateCalendarCommand());
addCommand(new UpdateCatalogCommand());
addCommand(new UpdateConfigCommand());
addCommand(new UpdateGuildPartsCommand());
addCommand(new UpdateHotelViewCommand());
addCommand(new UpdateItemsCommand());
addCommand(new UpdateNavigatorCommand());
addCommand(new UpdatePermissionsCommand());
addCommand(new UpdatePetDataCommand());
addCommand(new UpdatePluginsCommand());
addCommand(new UpdatePollsCommand());
addCommand(new UpdateTextsCommand());
addCommand(new UpdateWordFilterCommand());
addCommand(new UserInfoCommand());
addCommand(new WordQuizCommand());
addCommand(new UpdateYoutubePlaylistsCommand());
addCommand(new AddYoutubePlaylistCommand());
addCommand(new SoftKickCommand());
addCommand(new SubscriptionCommand());
addCommand(new TestCommand());
}
public List<Command> getCommandsForRank(int rankId) {
List<Command> allowedCommands = new ArrayList<>();
if (Emulator.getGameEnvironment().getPermissionsManager().rankExists(rankId)) {
THashMap<String, Permission> permissions = Emulator.getGameEnvironment().getPermissionsManager().getRank(rankId).getPermissions();
for (Command command : commands.values()) {
if (allowedCommands.contains(command))
continue;
if (permissions.contains(command.permission) && permissions.get(command.permission).getSetting() != PermissionSetting.DISALLOWED) {
allowedCommands.add(command);
}
}
}
allowedCommands.sort(CommandHandler.ALPHABETICAL_ORDER);
return allowedCommands;
}
public void dispose() {
commands.clear();
log.info("Command Handler -> Disposed!");
}
}

View File

@ -1,27 +0,0 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import java.util.List;
public class CommandsCommand extends Command {
public CommandsCommand() {
super("cmd_commands", Emulator.getTexts().getValue("commands.keys.cmd_commands").split(";"));
}
@Override
public boolean handle(GameClient gameClient, String[] params) {
StringBuilder message = new StringBuilder(getTextsValue("commands.generic.cmd_commands.text"));
List<Command> commands = Emulator.getGameEnvironment().getCommandHandler().getCommandsForRank(gameClient.getHabbo().getHabboInfo().getRank().getId());
message.append("(").append(commands.size()).append("):\r\n");
for (Command c : commands) {
message.append(getTextsValue("commands.description." + c.permission, "commands.description." + c.permission)).append("\r");
}
gameClient.getHabbo().alert(new String[]{message.toString()});
return true;
}
}

View File

@ -0,0 +1,298 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.core.CommandLog;
import com.eu.habbo.habbohotel.commands.list.*;
import com.eu.habbo.habbohotel.commands.list.badge.*;
import com.eu.habbo.habbohotel.commands.list.bans.*;
import com.eu.habbo.habbohotel.commands.list.credits.*;
import com.eu.habbo.habbohotel.commands.list.gift.*;
import com.eu.habbo.habbohotel.commands.list.pixels.*;
import com.eu.habbo.habbohotel.commands.list.points.*;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.permissions.PermissionCommand;
import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.PetCommand;
import com.eu.habbo.habbohotel.pets.PetVocalsType;
import com.eu.habbo.habbohotel.pets.RideablePet;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomRightLevels;
import com.eu.habbo.messages.outgoing.rooms.users.UserTypingMessageComposer;
import com.eu.habbo.plugin.events.users.UserCommandEvent;
import com.eu.habbo.plugin.events.users.UserExecuteCommandEvent;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import java.util.HashMap;
import java.util.Map;
@Slf4j
public class CommandsManager {
@Getter
private static final Map<String, Command> commands = new HashMap<>();
public CommandsManager() {
long millis = System.currentTimeMillis();
this.reloadCommands();
log.info("Command Handler -> Loaded! ({} MS)", System.currentTimeMillis() - millis);
}
public static void addCommand(Command command) {
if(command != null) {
commands.put(command.getName(), command);
}
}
public static void addCommand(Class<? extends Command> commandClass) {
try {
addCommand(commandClass.getDeclaredConstructor().newInstance());
log.debug("Added command: {}", commandClass.getName());
} catch (Exception e) {
log.error("Caught exception", e);
}
}
public boolean handleCommand(GameClient gameClient, String commandLine) {
if (gameClient == null) {
return false;
}
if (commandLine.startsWith(":")) {
return this.handleChatCommand(gameClient, commandLine.substring(1));
} else {
return this.handlePetCommand(gameClient, commandLine);
}
}
private boolean handleChatCommand(GameClient gameClient, String commandLine) {
String[] parts = commandLine.split(" ");
if(parts.length < 1) {
return false;
}
String commandKey = parts[0];
Room currentRoom = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
boolean hasRights = currentRoom != null &&
(currentRoom.hasRights(gameClient.getHabbo())) ||
gameClient.getHabbo().hasRight(Permission.ACC_PLACEFURNI) ||
currentRoom.getGuildId() > 0 && currentRoom.getGuildRightLevel(gameClient.getHabbo()).isEqualOrGreaterThan(RoomRightLevels.GUILD_RIGHTS);
if (!gameClient.getHabbo().canExecuteCommand(commandKey, hasRights)) {
return false;
}
PermissionCommand permissionCommand = Emulator.getGameEnvironment().getPermissionsManager().getCommandByKey(commandKey);
if (permissionCommand == null || !commands.containsKey(permissionCommand.getName())) {
return false;
}
Command command = commands.get(permissionCommand.getName());
if(command == null) {
return false;
}
try {
UserExecuteCommandEvent userExecuteCommandEvent = new UserExecuteCommandEvent(gameClient.getHabbo(), command, parts);
Emulator.getPluginManager().fireEvent(userExecuteCommandEvent);
if(userExecuteCommandEvent.isCancelled()) {
return userExecuteCommandEvent.isSuccess();
}
if (currentRoom != null) {
currentRoom.sendComposer(new UserTypingMessageComposer(gameClient.getHabbo().getRoomUnit(), false).compose());
}
UserCommandEvent event = new UserCommandEvent(gameClient.getHabbo(), parts, command.handle(gameClient, parts));
Emulator.getPluginManager().fireEvent(event);
if(gameClient.getHabbo().getHabboInfo().getPermissionGroup().isLogEnabled()) {
Emulator.getDatabaseLogger().store(new CommandLog(gameClient.getHabbo().getHabboInfo().getId(), command, commandLine, event.succes));
}
return event.succes;
}
catch (Exception exception) {
log.error("Caught exception", exception);
}
return false;
}
private boolean handlePetCommand(GameClient gameClient, String commandLine) {
String[] args = commandLine.split(" ");
if (args.length <= 1 || gameClient.getHabbo().getHabboInfo().getCurrentRoom() == null) {
return false;
}
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room.getCurrentPets().isEmpty()) {
return false;
}
for(Pet pet : room.getCurrentPets().valueCollection()) {
if (pet != null && pet.getName().equalsIgnoreCase(args[0])) {
StringBuilder commandBuilder = new StringBuilder();
for (int i = 1; i < args.length; i++) {
commandBuilder.append(args[i]).append(" ");
}
String commandKey = commandBuilder.toString().trim();
for (PetCommand command : pet.getPetData().getPetCommands()) {
if (command.getKey().equalsIgnoreCase(commandKey)) {
if (pet instanceof RideablePet rideablePet && rideablePet.getRider() != null && rideablePet.getRider().getHabboInfo().getId() == gameClient.getHabbo().getHabboInfo().getId()) {
rideablePet.getRider().getHabboInfo().dismountPet();
break;
}
if (command.getLevel() <= pet.getLevel()) {
pet.handleCommand(command, gameClient.getHabbo(), args);
} else {
pet.say(pet.getPetData().randomVocal(PetVocalsType.UNKNOWN_COMMAND));
}
return true;
}
}
}
}
return false;
}
public void reloadCommands() {
addCommand(new AboutCommand());
addCommand(new AddYoutubePlaylistCommand());
addCommand(new AlertCommand());
addCommand(new AllowTradingCommand());
addCommand(new ArcturusCommand());
addCommand(new BadgeCommand());
addCommand(new BanCommand());
addCommand(new BlockAlertCommand());
addCommand(new BotsCommand());
addCommand(new CalendarCommand());
addCommand(new ChangeNameCommand());
addCommand(new ChatTypeCommand());
addCommand(new CommandsCommand());
addCommand(new ControlCommand());
addCommand(new CoordsCommand());
addCommand(new CreditsCommand());
addCommand(new DiagonalCommand());
addCommand(new DisconnectCommand());
addCommand(new EjectAllCommand());
addCommand(new EmptyInventoryCommand());
addCommand(new EmptyBotsInventoryCommand());
addCommand(new EmptyPetsInventoryCommand());
addCommand(new EnableCommand());
addCommand(new EventCommand());
addCommand(new FacelessCommand());
addCommand(new FastwalkCommand());
addCommand(new FilterWordCommand());
addCommand(new FreezeBotsCommand());
addCommand(new FreezeCommand());
addCommand(new GiftCommand());
addCommand(new GiveRankCommand());
addCommand(new HabnamCommand());
addCommand(new HandItemCommand());
addCommand(new HappyHourCommand());
addCommand(new HideWiredCommand());
addCommand(new HotelAlertCommand());
addCommand(new HotelAlertLinkCommand());
addCommand(new InvisibleCommand());
addCommand(new IPBanCommand());
addCommand(new LayCommand());
addCommand(new MachineBanCommand());
addCommand(new MassBadgeCommand());
addCommand(new RoomBadgeCommand());
addCommand(new MassCreditsCommand());
addCommand(new MassGiftCommand());
addCommand(new MassPixelsCommand());
addCommand(new MassPointsCommand());
addCommand(new MimicCommand());
addCommand(new MoonwalkCommand());
addCommand(new MultiCommand());
addCommand(new MuteBotsCommand());
addCommand(new MuteCommand());
addCommand(new MutePetsCommand());
addCommand(new PetInfoCommand());
addCommand(new PickallCommand());
addCommand(new PixelCommand());
addCommand(new PluginsCommand());
addCommand(new PointsCommand());
addCommand(new PromoteTargetOfferCommand());
addCommand(new PullCommand());
addCommand(new PushCommand());
addCommand(new RedeemCommand());
addCommand(new ReloadRoomCommand());
addCommand(new RightsCommand());
addCommand(new RoomAlertCommand());
addCommand(new RoomBundleCommand());
addCommand(new RoomCreditsCommand());
addCommand(new RoomDanceCommand());
addCommand(new RoomEffectCommand());
addCommand(new RoomItemCommand());
addCommand(new RoomKickCommand());
addCommand(new RoomMuteCommand());
addCommand(new RoomPixelsCommand());
addCommand(new RoomPointsCommand());
addCommand(new RoomSitCommand());
addCommand(new SayAllCommand());
addCommand(new SayCommand());
addCommand(new SetMaxCommand());
addCommand(new SetPollCommand());
addCommand(new SetSpeedCommand());
addCommand(new ShoutAllCommand());
addCommand(new ShoutCommand());
addCommand(new ShutdownCommand());
addCommand(new SitCommand());
addCommand(new StandCommand());
addCommand(new SoftKickCommand());
addCommand(new SubscriptionCommand());
addCommand(new StaffAlertCommand());
addCommand(new StaffOnlineCommand());
addCommand(new StalkCommand());
addCommand(new SummonCommand());
addCommand(new SummonRankCommand());
addCommand(new SuperbanCommand());
addCommand(new SuperPullCommand());
addCommand(new TakeBadgeCommand());
addCommand(new TeleportCommand());
addCommand(new TestCommand());
addCommand(new TransformCommand());
addCommand(new UnbanCommand());
addCommand(new UnloadRoomCommand());
addCommand(new UnmuteCommand());
addCommand(new UpdateAchievements());
addCommand(new UpdateBotsCommand());
addCommand(new UpdateCalendarCommand());
addCommand(new UpdateCatalogCommand());
addCommand(new UpdateConfigCommand());
addCommand(new UpdateGuildPartsCommand());
addCommand(new UpdateHotelViewCommand());
addCommand(new UpdateItemsCommand());
addCommand(new UpdateNavigatorCommand());
addCommand(new UpdatePermissionsCommand());
addCommand(new UpdatePetDataCommand());
addCommand(new UpdatePluginsCommand());
addCommand(new UpdatePollsCommand());
addCommand(new UpdateTextsCommand());
addCommand(new UpdateWordFilterCommand());
addCommand(new UpdateYoutubePlaylistsCommand());
addCommand(new UserInfoCommand());
addCommand(new WordQuizCommand());
}
public void dispose() {
commands.clear();
log.info("Command Handler -> Disposed!");
}
}

View File

@ -1,15 +0,0 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
public class ConnectCameraCommand extends Command {
public ConnectCameraCommand() {
super("cmd_connect_camera", Emulator.getTexts().getValue("commands.keys.cmd_connect_camera").split(";"));
}
@Override
public boolean handle(GameClient gameClient, String[] params) {
return false;
}
}

View File

@ -1,16 +0,0 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
public class TrashCommand extends Command {
public TrashCommand() {
super("cmd_trash", Emulator.getTexts().getValue("commands.keys.cmd_trash").split(";"));
}
@Override
public boolean handle(GameClient gameClient, String[] params) {
gameClient.getHabbo().whisper("Sorry. Lulz mode removed |");
return false;
}
}

View File

@ -1,23 +0,0 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
public class UnloadRoomCommand extends Command {
public UnloadRoomCommand() {
super("cmd_unload", Emulator.getTexts().getValue("commands.keys.cmd_unload").split(";"));
}
@Override
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo().getHabboInfo().getCurrentRoom().getOwnerId() == gameClient.getHabbo().getHabboInfo().getId() || gameClient.getHabbo().getHabboInfo().getRank().getId() > 4) {
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
room.dispose();
return true;
}
return false;
}
}

View File

@ -0,0 +1,8 @@
package com.eu.habbo.habbohotel.commands.interfaces;
import com.eu.habbo.habbohotel.gameclients.GameClient;
public interface ICommand {
String getName();
boolean handle(GameClient gameClient, String[] params) throws Exception;
}

View File

@ -1,18 +1,15 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.catalog.CatalogManager;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.messages.outgoing.generic.alerts.MOTDNotificationComposer;
import java.util.Collections;
import java.util.concurrent.TimeUnit;
public class AboutCommand extends Command {
public AboutCommand() {
super(null, new String[]{"about", "info", "online", "server"});
}
public static final String CREDITS = """
Arcturus Morningstar is an opensource project based on Arcturus By TheGeneral\s
The Following people have all contributed to this emulator:
@ -47,6 +44,11 @@ public class AboutCommand extends Command {
SenpaiDipper
Snaiker
Thijmen""";
public AboutCommand() {
super("cmd_about");
}
@Override
public boolean handle(GameClient gameClient, String[] params) {

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.items.YoutubeManager;
import lombok.extern.slf4j.Slf4j;
@ -11,9 +12,8 @@ import java.sql.SQLException;
@Slf4j
public class AddYoutubePlaylistCommand extends Command {
public AddYoutubePlaylistCommand() {
super("cmd_add_youtube_playlist", Emulator.getTexts().getValue("commands.keys.cmd_add_youtube_playlist").split(";"));
super("cmd_add_youtube_playlist");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
@ -9,9 +9,8 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class AlertCommand extends Command {
public AlertCommand() {
super("cmd_alert", Emulator.getTexts().getValue("commands.keys.cmd_alert").split(";"));
super("cmd_alert");
}
@Override

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.users.UserPerksComposer;
@ -10,7 +11,7 @@ import java.sql.PreparedStatement;
public class AllowTradingCommand extends Command {
public AllowTradingCommand() {
super("cmd_allow_trading", Emulator.getTexts().getValue("commands.keys.cmd_allow_trading").split(";"));
super("cmd_allow_trading");
}
@Override

View File

@ -1,11 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class ArcturusCommand extends Command {
public ArcturusCommand() {
super(null, new String[]{"arcturus", "emulator"});
super("cmd_arcturus");
}
@Override

View File

@ -1,12 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class BlockAlertCommand extends Command {
public BlockAlertCommand() {
super("cmd_blockalert", Emulator.getTexts().getValue("commands.keys.cmd_blockalert").split(";"));
super("cmd_block_alert");
}
@Override

View File

@ -1,12 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.bots.Bot;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
public class BotsCommand extends Command {
public BotsCommand() {
super("cmd_bots", Emulator.getTexts().getValue("commands.keys.cmd_bots").split(";"));
super("cmd_bots");
}
@Override

View File

@ -1,7 +1,8 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.campaign.CalendarCampaign;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.messages.outgoing.events.calendar.CampaignCalendarDataMessageComposer;
import com.eu.habbo.messages.outgoing.habboway.nux.InClientLinkMessageComposer;
@ -13,7 +14,7 @@ import static java.time.temporal.ChronoUnit.DAYS;
public class CalendarCommand extends Command {
public CalendarCommand() {
super("cmd_calendar", Emulator.getTexts().getValue("commands.keys.cmd_calendar").split(";"));
super("cmd_calendar");
}
@Override
@ -21,7 +22,7 @@ public class CalendarCommand extends Command {
if (Emulator.getConfig().getBoolean("hotel.calendar.enabled")) {
String campaignName = Emulator.getConfig().getValue("hotel.calendar.default");
if (params.length > 1 && gameClient.getHabbo().hasPermission("cmd_calendar_staff")) {
if (params.length > 1 && gameClient.getHabbo().hasCommand("cmd_calendar_staff")) {
campaignName = params[1];
}

View File

@ -1,13 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.users.UserObjectComposer;
public class ChangeNameCommand extends Command {
public ChangeNameCommand() {
super("cmd_changename", Emulator.getTexts().getValue("commands.keys.cmd_changename").split(";"));
super("cmd_change_name");
}
@Override

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -8,7 +9,7 @@ import com.eu.habbo.messages.outgoing.users.AccountPreferencesComposer;
public class ChatTypeCommand extends Command {
public ChatTypeCommand() {
super("cmd_chatcolor", Emulator.getTexts().getValue("commands.keys.cmd_chatcolor").split(";"));
super("cmd_chat_color");
}
@Override
@ -32,7 +33,7 @@ public class ChatTypeCommand extends Command {
return true;
}
if (!gameClient.getHabbo().hasPermission(Permission.ACC_ANYCHATCOLOR)) {
if (!gameClient.getHabbo().hasRight(Permission.ACC_ANYCHATCOLOR)) {
for (String s : Emulator.getConfig().getValue("commands.cmd_chatcolor.banned_numbers").split(";")) {
if (Integer.parseInt(s) == chatColor) {
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_chatcolor.banned"), RoomChatMessageBubbles.ALERT);

View File

@ -0,0 +1,33 @@
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.PermissionCommand;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class CommandsCommand extends Command {
public CommandsCommand() {
super("cmd_commands");
}
@Override
public boolean handle(GameClient gameClient, String[] params) {
StringBuilder message = new StringBuilder(getTextsValue("commands.generic.cmd_commands.text"));
List<PermissionCommand> commands = gameClient.getHabbo().getHabboInfo().getPermissionGroup().getCommands();
Collections.sort(commands, Comparator.comparing(PermissionCommand::getName));
message.append("(").append(commands.size()).append("):\r\n");
for(PermissionCommand command : commands) {
message.append(command.getDescription()).append("\r");
}
gameClient.getHabbo().alert(new String[]{message.toString()});
return true;
}
}

View File

@ -1,13 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
public class ControlCommand extends Command {
public ControlCommand() {
super("cmd_control", Emulator.getTexts().getValue("commands.keys.cmd_control").split(";"));
super("cmd_control");
}
@Override

View File

@ -1,14 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomTile;
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
public class CoordsCommand extends Command {
public CoordsCommand() {
super("cmd_coords", Emulator.getTexts().getValue("commands.keys.cmd_coords").split(";"));
super("cmd_coords");
}
@Override

View File

@ -1,12 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class DiagonalCommand extends Command {
public DiagonalCommand() {
super("cmd_diagonal", Emulator.getTexts().getValue("commands.keys.cmd_diagonal").split(";"));
super("cmd_diagonal");
}
@Override

View File

@ -1,13 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
public class DisconnectCommand extends Command {
public DisconnectCommand() {
super("cmd_disconnect", Emulator.getTexts().getValue("commands.keys.cmd_disconnect").split(";"));
super("cmd_disconnect");
}
@Override
@ -29,7 +29,7 @@ public class DisconnectCommand extends Command {
return true;
}
if (target.getHabboInfo().getRank().getId() > gameClient.getHabbo().getHabboInfo().getRank().getId()) {
if (target.getHabboInfo().getPermissionGroup().getLevel() > gameClient.getHabbo().getHabboInfo().getPermissionGroup().getLevel()) {
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_disconnect.higher_rank"), RoomChatMessageBubbles.ALERT);
return true;
}

View File

@ -1,13 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomRightLevels;
public class EjectAllCommand extends Command {
public EjectAllCommand() {
super("cmd_ejectall", Emulator.getTexts().getValue("commands.keys.cmd_ejectall").split(";"));
super("cmd_ejectall");
}
@Override

View File

@ -1,7 +1,8 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.bots.Bot;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -12,7 +13,7 @@ import gnu.trove.map.hash.TIntObjectHashMap;
public class EmptyBotsInventoryCommand extends Command {
public EmptyBotsInventoryCommand() {
super("cmd_empty_bots", Emulator.getTexts().getValue("commands.keys.cmd_empty_bots").split(";"));
super("cmd_empty_bots");
}
@Override
@ -31,7 +32,7 @@ public class EmptyBotsInventoryCommand extends Command {
if (params.length >= 2 && params[1].equalsIgnoreCase(getTextsValue("generic.yes"))) {
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasPermission(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
if (habbo != null) {
TIntObjectHashMap<Bot> bots = new TIntObjectHashMap<>();

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -14,7 +15,7 @@ import gnu.trove.map.hash.TIntObjectHashMap;
public class EmptyInventoryCommand extends Command {
public EmptyInventoryCommand() {
super("cmd_empty", Emulator.getTexts().getValue("commands.keys.cmd_empty").split(";"));
super("cmd_empty");
}
@Override
@ -33,7 +34,7 @@ public class EmptyInventoryCommand extends Command {
if (params.length >= 2 && params[1].equalsIgnoreCase(getTextsValue("generic.yes"))) {
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasPermission(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
if (habbo != null) {
TIntObjectMap<HabboItem> items = new TIntObjectHashMap<>();

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.pets.Pet;
@ -12,7 +13,7 @@ import gnu.trove.map.hash.TIntObjectHashMap;
public class EmptyPetsInventoryCommand extends Command {
public EmptyPetsInventoryCommand() {
super("cmd_empty_pets", Emulator.getTexts().getValue("commands.keys.cmd_empty_pets").split(";"));
super("cmd_empty_pets");
}
@Override
@ -31,7 +32,7 @@ public class EmptyPetsInventoryCommand extends Command {
if (params.length >= 2 && params[1].equalsIgnoreCase(getTextsValue("generic.yes"))) {
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasPermission(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
Habbo habbo = (params.length == 3 && gameClient.getHabbo().hasRight(Permission.ACC_EMPTY_OTHERS)) ? Emulator.getGameEnvironment().getHabboManager().getHabbo(params[2]) : gameClient.getHabbo();
if (habbo != null) {
TIntObjectHashMap<Pet> pets = new TIntObjectHashMap<>(habbo.getInventory().getPetsComponent().getPets());

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -10,7 +11,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class EnableCommand extends Command {
public EnableCommand() {
super("cmd_enable", Emulator.getTexts().getValue("commands.keys.cmd_enable").split(";"));
super("cmd_enable");
}
@Override
@ -30,10 +31,10 @@ public class EnableCommand extends Command {
if (target == null) {
return true;
}
if (target == gameClient.getHabbo() || gameClient.getHabbo().hasPermission(Permission.ACC_ENABLE_OTHERS)) {
if (target == gameClient.getHabbo() || gameClient.getHabbo().hasRight(Permission.ACC_ENABLE_OTHERS)) {
try {
if (target.getHabboInfo().getCurrentRoom() != null && target.getHabboInfo().getRiding() == null) {
if (Emulator.getGameEnvironment().getPermissionsManager().isEffectBlocked(effectId, target.getHabboInfo().getRank().getId())) {
if (Emulator.getGameEnvironment().getPermissionsManager().isEffectBlocked(effectId, target.getHabboInfo().getPermissionGroup().getId())) {
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_enable.not_allowed"), RoomChatMessageBubbles.ALERT);
return true;
}

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ServerMessage;
@ -12,7 +13,7 @@ import java.util.stream.IntStream;
public class EventCommand extends Command {
public EventCommand() {
super("cmd_event", Emulator.getTexts().getValue("commands.keys.cmd_event").split(";"));
super("cmd_event");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.messages.outgoing.rooms.users.UserChangeMessageComposer;
import com.eu.habbo.messages.outgoing.users.FigureUpdateComposer;
@ -8,7 +8,7 @@ import com.eu.habbo.messages.outgoing.users.FigureUpdateComposer;
public class FacelessCommand extends Command {
public FacelessCommand() {
super("cmd_faceless", Emulator.getTexts().getValue("commands.keys.cmd_faceless").split(";"));
super("cmd_faceless");
}
@Override

View File

@ -1,12 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
public class FastwalkCommand extends Command {
public FastwalkCommand() {
super("cmd_fastwalk", Emulator.getTexts().getValue("commands.keys.cmd_fastwalk").split(";"));
super("cmd_fastwalk");
}
@Override

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.modtool.WordFilter;
import com.eu.habbo.habbohotel.modtool.WordFilterWord;
@ -12,9 +13,8 @@ import java.sql.SQLException;
@Slf4j
public class FilterWordCommand extends Command {
public FilterWordCommand() {
super("cmd_filterword", Emulator.getTexts().getValue("commands.keys.cmd_filterword").split(";"));
super("cmd_filterword");
}
@Override

View File

@ -1,13 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class FreezeBotsCommand extends Command {
public FreezeBotsCommand() {
super("cmd_freeze_bots", Emulator.getTexts().getValue("commands.keys.cmd_freeze_bots").split(";"));
super("cmd_freeze_bots");
}
@Override
@ -17,7 +17,7 @@ public class FreezeBotsCommand extends Command {
}
if (gameClient.getHabbo().getHabboInfo().getId() == gameClient.getHabbo().getHabboInfo().getCurrentRoom().getOwnerId()
|| gameClient.getHabbo().hasPermission(Permission.ACC_ANYROOMOWNER)) {
|| gameClient.getHabbo().hasRight(Permission.ACC_ANYROOMOWNER)) {
gameClient.getHabbo().getHabboInfo().getCurrentRoom().setAllowBotsWalk(!gameClient.getHabbo().getHabboInfo().getCurrentRoom().isAllowBotsWalk());
gameClient.getHabbo().whisper(gameClient.getHabbo().getHabboInfo().getCurrentRoom().isAllowBotsWalk() ? getTextsValue("commands.succes.cmd_freeze_bots.unfrozen") : getTextsValue("commands.succes.cmd_freeze_bots.frozen"), RoomChatMessageBubbles.ALERT);
} else {

View File

@ -1,13 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
public class FreezeCommand extends Command {
public FreezeCommand() {
super("cmd_freeze", Emulator.getTexts().getValue("commands.keys.cmd_freeze").split(";"));
super("cmd_freeze");
}
@Override

View File

@ -1,8 +1,9 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Rank;
import com.eu.habbo.habbohotel.permissions.PermissionGroup;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.HabboInfo;
import com.eu.habbo.habbohotel.users.HabboManager;
@ -10,12 +11,12 @@ import org.apache.commons.lang3.StringUtils;
public class GiveRankCommand extends Command {
public GiveRankCommand() {
super("cmd_give_rank", Emulator.getTexts().getValue("commands.keys.cmd_give_rank").split(";"));
super("cmd_give_rank");
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
Rank rank = null;
PermissionGroup group = null;
switch (params.length) {
case 1 -> {
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_give_rank.missing_username") + getTextsValue("commands.description.cmd_give_rank"), RoomChatMessageBubbles.ALERT);
@ -27,31 +28,31 @@ public class GiveRankCommand extends Command {
}
case 3 -> {
if (StringUtils.isNumeric(params[2])) {
int rankId = Integer.parseInt(params[2]);
if (Emulator.getGameEnvironment().getPermissionsManager().rankExists(rankId))
rank = Emulator.getGameEnvironment().getPermissionsManager().getRank(rankId);
int groupId = Integer.parseInt(params[2]);
if (Emulator.getGameEnvironment().getPermissionsManager().groupExists(groupId))
group = Emulator.getGameEnvironment().getPermissionsManager().getGroup(groupId);
} else {
rank = Emulator.getGameEnvironment().getPermissionsManager().getRankByName(params[2]);
group = Emulator.getGameEnvironment().getPermissionsManager().getGroupByName(params[2]);
}
if (rank != null) {
if (rank.getId() > gameClient.getHabbo().getHabboInfo().getRank().getId()) {
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_give_rank.higher"), params[1]).replace("%id%", rank.getName()), RoomChatMessageBubbles.ALERT);
if (group != null) {
if (group.getId() > gameClient.getHabbo().getHabboInfo().getPermissionGroup().getId()) {
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_give_rank.higher"), params[1]).replace("%id%", group.getName()), RoomChatMessageBubbles.ALERT);
return true;
}
HabboInfo habbo = HabboManager.getOfflineHabboInfo(params[1]);
if (habbo != null) {
if (habbo.getRank().getId() > gameClient.getHabbo().getHabboInfo().getRank().getId()) {
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_give_rank.higher.other"), params[1]).replace("%id%", rank.getName()), RoomChatMessageBubbles.ALERT);
if (habbo.getPermissionGroup().getId() > gameClient.getHabbo().getHabboInfo().getPermissionGroup().getId()) {
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_give_rank.higher.other"), params[1]).replace("%id%", group.getName()), RoomChatMessageBubbles.ALERT);
return true;
}
Emulator.getGameEnvironment().getHabboManager().setRank(habbo.getId(), rank.getId());
Emulator.getGameEnvironment().getHabboManager().setRank(habbo.getId(), group.getId());
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.succes.cmd_give_rank.updated"), params[1]).replace("%id%", rank.getName()), RoomChatMessageBubbles.ALERT);
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.succes.cmd_give_rank.updated"), params[1]).replace("%id%", group.getName()), RoomChatMessageBubbles.ALERT);
} else {
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_give_rank.user_offline"), params[1]).replace("%id%", rank.getName()), RoomChatMessageBubbles.ALERT);
gameClient.getHabbo().whisper(replaceUsername(getTextsValue("commands.error.cmd_give_rank.user_offline"), params[1]).replace("%id%", group.getName()), RoomChatMessageBubbles.ALERT);
}
return true;
}

View File

@ -1,10 +1,11 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
public class HabnamCommand extends Command {
public HabnamCommand() {
super(null, new String[]{"habnam", "gangnam"});
super("cmd_habnam");
}
@Override

View File

@ -1,12 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.messages.outgoing.rooms.users.CarryObjectMessageComposer;
public class HandItemCommand extends Command {
public HandItemCommand() {
super("cmd_hand_item", Emulator.getTexts().getValue("commands.keys.cmd_hand_item").split(";"));
super("cmd_hand_item");
}
@Override

View File

@ -1,16 +1,14 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.achievements.AchievementManager;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.generic.alerts.HabboBroadcastMessageComposer;
import java.util.Map;
public class HappyHourCommand extends Command {
public HappyHourCommand() {
super("cmd_happyhour", Emulator.getTexts().getValue("commands.keys.cmd_happyhour").split(";"));
super("cmd_happyhour");
}
@Override

View File

@ -1,12 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
public class HideWiredCommand extends Command {
public HideWiredCommand() {
super("cmd_hidewired", Emulator.getTexts().getValue("commands.keys.cmd_hidewired").split(";"));
super("cmd_hidewired");
}
@Override

View File

@ -1,20 +1,18 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.generic.alerts.ModeratorMessageComposer;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class HotelAlertCommand extends Command {
public HotelAlertCommand() {
super("cmd_ha", Emulator.getTexts().getValue("commands.keys.cmd_ha").split(";"));
super("cmd_ha");
}
@Override

View File

@ -1,12 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.messages.outgoing.generic.alerts.ModeratorMessageComposer;
public class HotelAlertLinkCommand extends Command {
public HotelAlertLinkCommand() {
super("cmd_hal", Emulator.getTexts().getValue("commands.keys.cmd_hal").split(";"));
super("cmd_hal");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomLayout;
import com.eu.habbo.habbohotel.rooms.RoomUnit;
@ -13,7 +13,7 @@ import com.eu.habbo.threading.runnables.RoomUnitTeleport;
public class InvisibleCommand extends Command {
public InvisibleCommand() {
super("cmd_invisible", Emulator.getTexts().getValue("commands.keys.cmd_invisible").split(";"));
super("cmd_invisible");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomTile;
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
@ -11,7 +11,7 @@ import java.util.stream.IntStream;
public class LayCommand extends Command {
public LayCommand() {
super(null, Emulator.getTexts().getValue("commands.keys.cmd_lay").split(";"));
super("cmd_lay");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -13,7 +13,7 @@ import com.eu.habbo.util.figure.FigureUtil;
public class MimicCommand extends Command {
public MimicCommand() {
super("cmd_mimic", Emulator.getTexts().getValue("commands.keys.cmd_mimic").split(";"));
super("cmd_mimic");
}
@Override
@ -29,10 +29,10 @@ public class MimicCommand extends Command {
if (habbo == gameClient.getHabbo()) {
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_mimic.not_self"), RoomChatMessageBubbles.ALERT);
return true;
} else if (habbo.hasPermission(Permission.ACC_NOT_MIMICED) && !gameClient.getHabbo().hasPermission(Permission.ACC_NOT_MIMICED)) {
} else if (habbo.hasRight(Permission.ACC_NOT_MIMICED) && !gameClient.getHabbo().hasRight(Permission.ACC_NOT_MIMICED)) {
gameClient.getHabbo().whisper(replaceUser(getTextsValue("commands.error.cmd_mimic.blocked"), params[1]).replace("%gender_name%", getGenderName(habbo)), RoomChatMessageBubbles.ALERT);
return true;
} else if (!habbo.hasPermission("acc_mimic_unredeemed") && FigureUtil.hasBlacklistedClothing(habbo.getHabboInfo().getLook(), gameClient.getHabbo().getForbiddenClothing())) {
} else if (!habbo.hasRight(Permission.ACC_MIMIC_UNREDEEMED) && FigureUtil.hasBlacklistedClothing(habbo.getHabboInfo().getLook(), gameClient.getHabbo().getForbiddenClothing())) {
gameClient.getHabbo().whisper(getTextsValue("commands.error.cmd_mimic.forbidden_clothing"), RoomChatMessageBubbles.ALERT);
return true;
} else {

View File

@ -1,11 +1,11 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
public class MoonwalkCommand extends Command {
public MoonwalkCommand() {
super("cmd_moonwalk", Emulator.getTexts().getValue("commands.keys.cmd_moonwalk").split(";"));
super("cmd_moonwalk");
}
@Override

View File

@ -1,12 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.messages.outgoing.rooms.items.RequestSpamWallPostItMessageComposer;
public class MultiCommand extends Command {
public MultiCommand() {
super("cmd_multi", Emulator.getTexts().getValue("commands.keys.cmd_multi").split(";"));
super("cmd_multi");
}
@Override

View File

@ -1,12 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class MuteBotsCommand extends Command {
public MuteBotsCommand() {
super(null, Emulator.getTexts().getValue("commands.keys.cmd_mute_bots").split(";"));
super("cmd_mute_bots");
}
@Override

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
@ -8,7 +9,7 @@ import com.eu.habbo.messages.outgoing.rooms.users.IgnoreResultMessageComposer;
public class MuteCommand extends Command {
public MuteCommand() {
super("cmd_mute", Emulator.getTexts().getValue("commands.keys.cmd_mute").split(";"));
super("cmd_mute");
}
@Override

View File

@ -1,12 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class MutePetsCommand extends Command {
public MutePetsCommand() {
super(null, Emulator.getTexts().getValue("commands.keys.cmd_mute_pets").split(";"));
super("cmd_mute_pets");
}
@Override

View File

@ -1,13 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.pets.PetManager;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class PetInfoCommand extends Command {
public PetInfoCommand() {
super("cmd_pet_info", Emulator.getTexts().getValue("commands.keys.cmd_pet_info").split(";"));
super("cmd_pet_info");
}
@Override

View File

@ -1,12 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
public class PickallCommand extends Command {
public PickallCommand() {
super("cmd_pickall", Emulator.getTexts().getValue("commands.keys.cmd_pickall").split(";"));
super("cmd_pick_all");
}
@Override

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.messages.outgoing.generic.alerts.MOTDNotificationComposer;
import com.eu.habbo.plugin.HabboPlugin;
@ -9,7 +10,7 @@ import java.util.Collections;
public class PluginsCommand extends Command {
public PluginsCommand() {
super(null, Emulator.getTexts().getValue("commands.keys.cmd_plugins").split(";"));
super("cmd_plugins");
}
@Override

View File

@ -1,9 +1,9 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.catalog.TargetOffer;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.catalog.TargetedOfferComposer;
import com.eu.habbo.messages.outgoing.generic.alerts.MOTDNotificationComposer;
import gnu.trove.map.hash.THashMap;
@ -12,9 +12,8 @@ import java.util.ArrayList;
import java.util.List;
public class PromoteTargetOfferCommand extends Command {
public PromoteTargetOfferCommand() {
super("cmd_promote_offer", Emulator.getTexts().getValue("commands.keys.cmd_promote_offer").split(";"));
super("cmd_promote_offer");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -11,7 +11,7 @@ import com.eu.habbo.messages.outgoing.rooms.users.ChatMessageComposer;
public class PullCommand extends Command {
public PullCommand() {
super("cmd_pull", Emulator.getTexts().getValue("commands.keys.cmd_pull").split(";"));
super("cmd_pull");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -11,7 +11,7 @@ import com.eu.habbo.messages.outgoing.rooms.users.ChatMessageComposer;
public class PushCommand extends Command {
public PushCommand() {
super("cmd_push", Emulator.getTexts().getValue("commands.keys.cmd_push").split(";"));
super("cmd_push");
}
@Override

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.HabboItem;
@ -14,7 +15,7 @@ import java.util.ArrayList;
public class RedeemCommand extends Command {
public RedeemCommand() {
super("cmd_redeem", Emulator.getTexts().getValue("commands.keys.cmd_redeem").split(";"));
super("cmd_redeem");
}
@Override

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.users.Habbo;
@ -12,7 +13,7 @@ import java.util.Collection;
public class ReloadRoomCommand extends Command {
public ReloadRoomCommand() {
super("cmd_reload_room", Emulator.getTexts().getValue("commands.keys.cmd_reload_room").split(";"));
super("cmd_reload_room");
}
@Override

View File

@ -0,0 +1,29 @@
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.PermissionRight;
import java.util.Set;
public class RightsCommand extends Command {
public RightsCommand() {
super("cmd_rights");
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
StringBuilder message = new StringBuilder(getTextsValue("commands.generic.cmd_rights.text"));
Set<PermissionRight> rights = gameClient.getHabbo().getHabboInfo().getPermissionGroup().getRights();
message.append("(").append(rights.size()).append("):\r\n");
for(PermissionRight right : rights) {
message.append(right.getName()).append(" - ").append(right.getDescription()).append("\r");
}
gameClient.getHabbo().alert(new String[]{message.toString()});
return true;
}
}

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -11,7 +11,7 @@ import java.util.stream.IntStream;
public class RoomAlertCommand extends Command {
public RoomAlertCommand() {
super("cmd_roomalert", Emulator.getTexts().getValue("commands.keys.cmd_roomalert").split(";"));
super("cmd_room_alert");
}
@Override

View File

@ -1,10 +1,11 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.catalog.CatalogItem;
import com.eu.habbo.habbohotel.catalog.CatalogPage;
import com.eu.habbo.habbohotel.catalog.CatalogPageLayouts;
import com.eu.habbo.habbohotel.catalog.layouts.RoomBundleLayout;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import lombok.extern.slf4j.Slf4j;
@ -13,9 +14,8 @@ import java.sql.*;
@Slf4j
public class RoomBundleCommand extends Command {
public RoomBundleCommand() {
super("cmd_bundle", Emulator.getTexts().getValue("commands.keys.cmd_bundle").split(";"));
super("cmd_bundle");
}
@Override
@ -40,7 +40,7 @@ public class RoomBundleCommand extends Command {
points = Integer.parseInt(params[3]);
pointsType = Integer.parseInt(params[4]);
CatalogPage page = Emulator.getGameEnvironment().getCatalogManager().createCatalogPage("Room Bundle: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getName(), "room_bundle_" + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), 0, CatalogPageLayouts.room_bundle, gameClient.getHabbo().getHabboInfo().getRank().getId(), parentId);
CatalogPage page = Emulator.getGameEnvironment().getCatalogManager().createCatalogPage("Room Bundle: " + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getName(), "room_bundle_" + gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), gameClient.getHabbo().getHabboInfo().getCurrentRoom().getId(), 0, CatalogPageLayouts.room_bundle, gameClient.getHabbo().getHabboInfo().getPermissionGroup().getId(), parentId);
if (page instanceof RoomBundleLayout roomBundleLayout) {
try (Connection connection = Emulator.getDatabase().getDataSource().getConnection(); PreparedStatement statement = connection.prepareStatement("INSERT INTO catalog_items (page_id, item_ids, catalog_name, cost_credits, cost_points, points_type ) VALUES (?, ?, ?, ?, ?, ?)", Statement.RETURN_GENERATED_KEYS)) {

View File

@ -1,15 +1,14 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.DanceType;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.users.DanceMessageComposer;
public class RoomDanceCommand extends Command {
public RoomDanceCommand() {
super("cmd_danceall", Emulator.getTexts().getValue("commands.keys.cmd_danceall").split(";"));
super("cmd_room_dance");
}
@Override

View File

@ -1,14 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
public class RoomEffectCommand extends Command {
public RoomEffectCommand() {
super("cmd_roomeffect", Emulator.getTexts().getValue("commands.keys.cmd_roomeffect").split(";"));
super("cmd_room_effect");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
@ -8,7 +8,7 @@ import com.eu.habbo.messages.outgoing.rooms.users.CarryObjectMessageComposer;
public class RoomItemCommand extends Command {
public RoomItemCommand() {
super("cmd_roomitem", Emulator.getTexts().getValue("commands.keys.cmd_roomitem").split(";"));
super("cmd_room_item");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.Room;
@ -12,7 +12,7 @@ import java.util.stream.IntStream;
public class RoomKickCommand extends Command {
public RoomKickCommand() {
super("cmd_kickall", Emulator.getTexts().getValue("commands.keys.cmd_kickall").split(";"));
super("cmd_room_kick");
}
@Override
@ -25,7 +25,7 @@ public class RoomKickCommand extends Command {
}
for (Habbo habbo : room.getHabbos()) {
if (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo))) {
if (!(habbo.hasRight(Permission.ACC_UNKICKABLE) || habbo.hasRight(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo))) {
room.kickHabbo(habbo, true);
}
}

View File

@ -1,13 +1,14 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class RoomMuteCommand extends Command {
public RoomMuteCommand() {
super("cmd_roommute", Emulator.getTexts().getValue("commands.keys.cmd_roommute").split(";"));
super("cmd_room_mute");
}
@Override

View File

@ -1,13 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomUnitStatus;
import com.eu.habbo.habbohotel.users.Habbo;
public class SitDownCommand extends Command {
public SitDownCommand() {
super("cmd_sitdown", Emulator.getTexts().getValue("commands.keys.cmd_sitdown").split(";"));
public class RoomSitCommand extends Command {
public RoomSitCommand() {
super("cmd_room_sit");
}
@Override

View File

@ -1,16 +1,15 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class SayAllCommand extends Command {
public SayAllCommand() {
super("cmd_say_all", Emulator.getTexts().getValue("commands.keys.cmd_say_all").split(";"));
super("cmd_say_all");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -12,7 +12,7 @@ import java.util.stream.IntStream;
public class SayCommand extends Command {
public SayCommand() {
super("cmd_say", Emulator.getTexts().getValue("commands.keys.cmd_say").split(";"));
super("cmd_say");
}
@Override

View File

@ -1,12 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class SetMaxCommand extends Command {
public SetMaxCommand() {
super("cmd_setmax", Emulator.getTexts().getValue("commands.keys.cmd_setmax").split(";"));
super("cmd_setmax");
}
@Override

View File

@ -1,12 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class SetPollCommand extends Command {
public SetPollCommand() {
super("cmd_set_poll", Emulator.getTexts().getValue("commands.keys.cmd_set_poll").split(";"));
super("cmd_set_poll");
}
@Override

View File

@ -1,13 +1,14 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class SetSpeedCommand extends Command {
public SetSpeedCommand() {
super("cmd_setspeed", Emulator.getTexts().getValue("commands.keys.cmd_setspeed").split(";"));
super("cmd_set_speed");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
@ -10,7 +10,7 @@ import java.util.stream.IntStream;
public class ShoutAllCommand extends Command {
public ShoutAllCommand() {
super("cmd_shout_all", Emulator.getTexts().getValue("commands.keys.cmd_shout_all").split(";"));
super("cmd_shout_all");
}
@Override

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -11,9 +12,8 @@ import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class ShoutCommand extends Command {
public ShoutCommand() {
super("cmd_shout", Emulator.getTexts().getValue("commands.keys.cmd_shout").split(";"));
super("cmd_shout");
}
@Override

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomTrade;
import com.eu.habbo.messages.ServerMessage;
@ -10,7 +11,7 @@ import com.eu.habbo.threading.runnables.ShutdownEmulator;
public class ShutdownCommand extends Command {
public ShutdownCommand() {
super("cmd_shutdown", Emulator.getTexts().getValue("commands.keys.cmd_shutdown").split(";"));
super("cmd_shutdown");
}
@Override

View File

@ -1,11 +1,11 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
public class SitCommand extends Command {
public SitCommand() {
super(null, Emulator.getTexts().getValue("commands.keys.cmd_sit").split(";"));
super("cmd_sit");
}
@Override

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.Room;
@ -9,7 +9,7 @@ import com.eu.habbo.habbohotel.users.Habbo;
public class SoftKickCommand extends Command {
public SoftKickCommand() {
super("cmd_softkick", Emulator.getTexts().getValue("commands.keys.cmd_softkick").split(";"));
super("cmd_soft_kick");
}
@Override
@ -29,7 +29,7 @@ public class SoftKickCommand extends Command {
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null && (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo)))) {
if (room != null && (!(habbo.hasRight(Permission.ACC_UNKICKABLE) || habbo.hasRight(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo)))) {
room.kickHabbo(habbo, false);
}
return true;

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.messenger.Message;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -11,7 +12,7 @@ import java.util.stream.IntStream;
public class StaffAlertCommand extends Command {
public StaffAlertCommand() {
super("cmd_staffalert", Emulator.getTexts().getValue("commands.keys.cmd_staffalert").split(";"));
super("cmd_staff_alert");
}
@Override

View File

@ -1,19 +1,18 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
public class StaffOnlineCommand extends Command {
public StaffOnlineCommand() {
super("cmd_staffonline", Emulator.getTexts().getValue("commands.keys.cmd_staffonline").split(";"));
super("cmd_staff_online");
}
@Override
@ -39,12 +38,12 @@ public class StaffOnlineCommand extends Command {
synchronized (Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos()) {
int finalMinRank = minRank;
List<Habbo> staffs = Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().values().stream()
.filter(habbo -> habbo.getHabboInfo().getRank().getId() >= finalMinRank)
.filter(habbo -> habbo.getHabboInfo().getPermissionGroup().getId() >= finalMinRank)
.sorted(Comparator.comparingInt(o->o.getHabboInfo().getId()))
.toList();
String message = staffs.stream()
.map(habbo -> habbo.getHabboInfo().getUsername() + ": " + habbo.getHabboInfo().getRank().getName() + "\r")
.map(habbo -> habbo.getHabboInfo().getUsername() + ": " + habbo.getHabboInfo().getPermissionGroup().getName() + "\r")
.collect(Collectors.joining("", getTextsValue("commands.generic.cmd_staffonline.staffs") + "\r\n", ""));
gameClient.getHabbo().alert(message);

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
@ -8,7 +8,7 @@ import com.eu.habbo.messages.outgoing.rooms.GetGuestRoomResultComposer;
public class StalkCommand extends Command {
public StalkCommand() {
super("cmd_stalk", Emulator.getTexts().getValue("commands.keys.cmd_stalk").split(";"));
super("cmd_stalk");
}
@Override

View File

@ -1,13 +1,12 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
public class StandCommand extends Command {
public StandCommand() {
super(null, Emulator.getTexts().getValue("commands.keys.cmd_stand").split(";"));
}
super("cmd_stand");
}
@Override
public boolean handle(GameClient gameClient, String[] params) {

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.HabboInfo;
@ -16,7 +17,7 @@ import java.util.stream.IntStream;
*/
public class SubscriptionCommand extends Command {
public SubscriptionCommand() {
super("cmd_subscription", Emulator.getTexts().getValue("commands.keys.cmd_subscription").split(";"));
super("cmd_subscription");
}
/**

View File

@ -1,6 +1,7 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -9,7 +10,7 @@ import com.eu.habbo.messages.outgoing.rooms.RoomForwardMessageComposer;
public class SummonCommand extends Command {
public SummonCommand() {
super("cmd_summon", Emulator.getTexts().getValue("commands.keys.cmd_summon").split(";"));
super("cmd_summon");
}
@Override

View File

@ -1,17 +1,16 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.Room;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.messages.outgoing.rooms.RoomForwardMessageComposer;
import java.util.Map;
public class SummonRankCommand extends Command {
public SummonRankCommand() {
super("cmd_summonrank", Emulator.getTexts().getValue("commands.keys.cmd_summonrank").split(";"));
super("cmd_summon_rank");
}
@Override
@ -27,7 +26,7 @@ public class SummonRankCommand extends Command {
}
for (Habbo habbo : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().values()) {
if (habbo.getHabboInfo().getRank().getId() >= minRank) {
if (habbo.getHabboInfo().getPermissionGroup().getId() >= minRank) {
if (habbo == gameClient.getHabbo())
continue;

View File

@ -1,6 +1,6 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessage;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
@ -11,7 +11,7 @@ import com.eu.habbo.messages.outgoing.rooms.users.ChatMessageComposer;
public class SuperPullCommand extends Command {
public SuperPullCommand() {
super("cmd_superpull", Emulator.getTexts().getValue("commands.keys.cmd_superpull").split(";"));
super("cmd_super_pull");
}
@Override

View File

@ -1,12 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class TeleportCommand extends Command {
public TeleportCommand() {
super("cmd_teleport", Emulator.getTexts().getValue("commands.keys.cmd_teleport").split(";"));
super("cmd_teleport");
}
@Override

View File

@ -1,18 +1,19 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
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 TestCommand() {
super("acc_debug", new String[]{"test"});
super("cmd_test");
}
@Override
public boolean handle(GameClient gameClient, String[] params) {
if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL) || !Emulator.debugging)
if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasRight(Permission.ACC_SUPPORTTOOL) || !Emulator.debugging)
return false;
int header = Integer.parseInt(params[1]);

View File

@ -1,7 +1,8 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.core.RoomUserPetComposer;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.pets.PetData;
import com.eu.habbo.habbohotel.rooms.RoomUnit;
@ -13,8 +14,8 @@ import java.util.ArrayList;
import java.util.Collections;
public class TransformCommand extends Command {
protected TransformCommand() {
super("cmd_transform", new String[]{"transform"});
public TransformCommand() {
super("cmd_transform");
}
@Override

View File

@ -1,12 +1,13 @@
package com.eu.habbo.habbohotel.commands;
package com.eu.habbo.habbohotel.commands.list;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.commands.Command;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
public class UnbanCommand extends Command {
public UnbanCommand() {
super("cmd_unban", Emulator.getTexts().getValue("commands.keys.cmd_unban").split(";"));
super("cmd_unban");
}
@Override

Some files were not shown because too many files have changed in this diff Show More