2018-07-06 13:30:00 +00:00
|
|
|
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;
|
2018-12-22 10:39:00 +00:00
|
|
|
import com.eu.habbo.messages.outgoing.modtool.ModToolIssueHandledComposer;
|
2018-07-06 13:30:00 +00:00
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public class RoomAlertCommand extends Command {
|
|
|
|
public RoomAlertCommand() {
|
2018-07-06 13:30:00 +00:00
|
|
|
super("cmd_roomalert", Emulator.getTexts().getValue("commands.keys.cmd_roomalert").split(";"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-26 21:14:53 +03:00
|
|
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
2019-03-18 01:22:00 +00:00
|
|
|
StringBuilder message = new StringBuilder();
|
2018-07-06 13:30:00 +00:00
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
if (params.length >= 2) {
|
|
|
|
for (int i = 1; i < params.length; i++) {
|
2019-03-18 01:22:00 +00:00
|
|
|
message.append(params[i]).append(" ");
|
2018-07-06 13:30:00 +00:00
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
if (message.length() == 0) {
|
2018-07-06 13:30:00 +00:00
|
|
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_roomalert.empty"), RoomChatMessageBubbles.ALERT);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
Room room = gameClient.getHabbo().getHabboInfo().getCurrentRoom();
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
if (room != null) {
|
2019-03-18 01:22:00 +00:00
|
|
|
room.sendComposer(new ModToolIssueHandledComposer(message.toString()).compose());
|
2018-07-06 13:30:00 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|