You can now choose between your hotel alert type (message of the day or normal alert) from configuration.
If you leave {nl} it will replace with a new line or {username} for the persons logged in name.
config;
Code:
hotel.alert.enabled=true
hotel.alert.type=generic
hotel.alert.message=Hello,{nl}Welcome to Sierra - {username}.
code;
Code:
Boolean hotelAlertEnabled = Sierra.getConfiguration().getProperty("hotel.alert.enabled").equals("true");
String hotelAlertType = Sierra.getConfiguration().getProperty("hotel.alert.type");
String hotelAlertMessage = Sierra.getConfiguration().getProperty("hotel.alert.message");
if (hotelAlertEnabled)
{
hotelAlertMessage = hotelAlertMessage.replace("{nl}", "\n");
hotelAlertMessage = hotelAlertMessage.replace("{username}", Session.getHabbo().Username);
if (hotelAlertType.equals("motd"))
{
Session.getResponse().Initialize(Outgoing.MOTD);
Session.getResponse().AppendInt32(hotelAlertEnabled);
Session.getResponse().AppendString(hotelAlertMessage);
Session.sendResponse();
}
else if (hotelAlertType.equals("generic"))
{
Session.getResponse().Initialize(Outgoing.AlertLink);
Session.getResponse().AppendString(hotelAlertMessage);
Session.getResponse().AppendString("");
Session.sendResponse();
}
}