Announcements.getInstance().loadAnnouncements();
Announcements.getInstance().listAnnouncements(activeChar);
}
else if (command.startsWith("admin_announce_menu"))
{
Announcements sys = new Announcements();
sys.handleAnnounce(command, 20);
Announcements.getInstance().listAnnouncements(activeChar);
}
else if (command.equals("admin_announce_announcements"))
{
for (L2PcInstance player : L2World.getInstance().getAllPlayers())
{
Announcements.getInstance().showAnnouncements(player);
}
Announcements.getInstance().listAnnouncements(activeChar);
}
else if (command.startsWith("admin_add_announcement"))
{
//FIXME the player can send only 16 chars (if you try to send more it sends null), remove this function or not?
if (!command.equals("admin_add_announcement"))
{
try{
String val = command.substring(23);
Announcements.getInstance().addAnnouncement(val);
Announcements.getInstance().listAnnouncements(activeChar);
} catch(StringIndexOutOfBoundsException e){}//ignore errors
}
}
else if (command.startsWith("admin_del_announcement"))
{
try
{
int val = new Integer(command.substring(23)).intValue();
Announcements.getInstance().delAnnouncement(val);
Announcements.getInstance().listAnnouncements(activeChar);
}
catch (StringIndexOutOfBoundsException e)
{ }
}
// Command is admin announce
else if (command.startsWith("admin_announce"))
{
// Call method from another class
Announcements sys = new Announcements();
sys.handleAnnounce(command, 15);
}
return true;
}