mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 08:50:51 +01:00
Merge branch 'softkick-command' into 'dev'
Added official moderation command "softkick" See merge request morningstar/Arcturus-Community!170
This commit is contained in:
commit
92dad4cfa8
@ -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`;
|
||||
|
||||
-- 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!');
|
@ -284,6 +284,7 @@ public class CommandHandler {
|
||||
addCommand(new WordQuizCommand());
|
||||
addCommand(new UpdateYoutubePlaylistsCommand());
|
||||
addCommand(new AddYoutubePlaylistCommand());
|
||||
addCommand(new SoftKickCommand());
|
||||
|
||||
addCommand(new TestCommand());
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user