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.RoomChatMessageBubbles;
|
|
|
|
import com.eu.habbo.habbohotel.users.Habbo;
|
|
|
|
import com.eu.habbo.messages.ServerMessage;
|
2018-12-22 10:39:00 +00:00
|
|
|
import com.eu.habbo.messages.outgoing.generic.alerts.StaffAlertWithLinkComposer;
|
2018-07-06 13:30:00 +00:00
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
public class HotelAlertCommand extends Command {
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public HotelAlertCommand() {
|
2018-07-06 13:30:00 +00:00
|
|
|
super("cmd_ha", Emulator.getTexts().getValue("commands.keys.cmd_ha").split(";"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-26 21:14:53 +03:00
|
|
|
public boolean handle(GameClient gameClient, String[] params) {
|
|
|
|
if (params.length > 1) {
|
2019-03-18 01:22:00 +00:00
|
|
|
StringBuilder message = new StringBuilder();
|
2018-07-06 13:30:00 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2018-12-22 10:39:00 +00:00
|
|
|
ServerMessage msg = new StaffAlertWithLinkComposer(message + "\r\n-" + gameClient.getHabbo().getHabboInfo().getUsername(), "").compose();
|
2018-07-06 13:30:00 +00:00
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
2018-07-06 13:30:00 +00:00
|
|
|
Habbo habbo = set.getValue();
|
2019-05-26 21:14:53 +03:00
|
|
|
if (habbo.getHabboStats().blockStaffAlerts)
|
2018-07-06 13:30:00 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
habbo.getClient().sendResponse(msg);
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
} else {
|
2018-07-06 13:30:00 +00:00
|
|
|
gameClient.getHabbo().whisper(Emulator.getTexts().getValue("commands.error.cmd_ha.forgot_message"), RoomChatMessageBubbles.ALERT);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|