Added official moderation command softkick

This commit is contained in:
Swirny 2020-05-16 15:35:20 +02:00 committed by Mike
parent 1e51448b38
commit e2013c8451
3 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,7 @@
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('hotel.room.stickies.max', '200');
INSERT INTO `emulator_settings`(`key`, `value`) VALUES ('retro.style.homeroom', '1');
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');

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,25 @@
package com.eu.habbo.habbohotel.commands;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.gameclients.GameClient;
import com.eu.habbo.habbohotel.permissions.Permission;
import com.eu.habbo.habbohotel.rooms.Room;
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 {
final Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
for (Habbo habbo : room.getHabbos()) {
if (!(habbo.hasPermission(Permission.ACC_UNKICKABLE) || habbo.hasPermission(Permission.ACC_SUPPORTTOOL) || room.isOwner(habbo))) {
room.kickHabbo(habbo, false);
}
}
return true;
}
}