Merge branch 'softkick-command' into 'dev'

Added official moderation command "softkick"

See merge request morningstar/Arcturus-Community!170
This commit is contained in:
Mike 2020-06-02 21:28:31 -04:00
commit 92dad4cfa8
4 changed files with 49 additions and 2 deletions

View File

@ -1,3 +1,3 @@
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.room.stickies.max', '200');
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('retro.style.homeroom', '1');
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('retro.style.homeroom', '1');

View File

@ -1,3 +1,11 @@
-- Hide email from specific ranks.
ALTER TABLE `permissions` ADD `acc_hide_mail` ENUM('0', '1') NOT NULL DEFAULT '0' AFTER `acc_hide_ip`;
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('flood.with.rights', '0');
-- Flood with rights.
INSERT INTO `emulator_settings` (`key`, `value`) VALUES ('flood.with.rights', '0');
-- Softkick command.
ALTER TABLE `permissions` ADD `cmd_softkick` ENUM('0', '1') NOT NULL DEFAULT '0' AFTER `cmd_kickall`;
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.keys.cmd_softkick', 'softkick');
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.error.cmd_softkick_not_found', '%user% not found');
INSERT INTO `emulator_texts` (`key`, `value`) VALUES ('commands.error.cmd_softkick_error_self', 'You can not softkick yourself!');

View File

@ -284,6 +284,7 @@ public class CommandHandler {
addCommand(new WordQuizCommand());
addCommand(new UpdateYoutubePlaylistsCommand());
addCommand(new AddYoutubePlaylistCommand());
addCommand(new SoftKickCommand());
addCommand(new TestCommand());
}

View File

@ -0,0 +1,38 @@
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;
import com.eu.habbo.habbohotel.rooms.RoomChatMessageBubbles;
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(";"));
}
@Override
public boolean handle(GameClient gameClient, String[] params) throws Exception {
if (params.length == 2) {
final String username = params[1];
final Habbo habbo = gameClient.getHabbo().getHabboInfo().getCurrentRoom().getHabbo(username);
if (habbo == null) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.keys.cmd_softkick_error").replace("%user%", username), RoomChatMessageBubbles.ALERT);
return true;
}
if (habbo == gameClient.getHabbo()) {
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.keys.cmd_softkick_error_self"), RoomChatMessageBubbles.ALERT);
return true;
}
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
if (room != null) {
room.kickHabbo(habbo, false);
}
}
return true;
}
}