* Completes handling the get messages action.
*
* @param currentTurn ignored
*/
public void onTurnReached(int currentTurn) {
GetPostmanMessagesCommand command = DBCommandQueue.get().getOneResult(GetPostmanMessagesCommand.class, handle);
if (command == null) {
TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
return;
}
List<ChatMessage> messages = command.getMessages();
Player player = command.getPlayer();
LOGGER.debug(messages.size()+ " messages left for " + player.getName());
for (ChatMessage chatmessage : messages) {
LOGGER.debug(player.getName() + " got message: " + chatmessage.toString());
// set the date to 'unknown' if the message was sent on a specific hard coded date which we will use for the old messages from xml
player.sendPrivateText(getNotificationType(chatmessage.getMessagetype()), "postman tells you: " + chatmessage.getSource() + " asked me to deliver this message on " + chatmessage.getTimestamp().substring(0,16).replace("2010-07-20 00:00", "an unknown date") + ": \n" + chatmessage.getMessage());