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