Fixed local server time in client's chat messages

This commit is contained in:
rsypen 2018-01-15 09:17:35 +01:00 committed by GitHub
parent bc3274b144
commit ccd121277a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 17 deletions

View file

@ -7,7 +7,6 @@ import mage.interfaces.callback.ClientCallback;
import mage.interfaces.callback.ClientCallbackMethod;
import mage.view.ChatMessage;
import java.text.DateFormat;
import java.util.Date;
import java.util.Optional;
import java.util.StringTokenizer;
@ -15,8 +14,6 @@ import java.util.UUID;
public final class LocalCommands {
private static final DateFormat timeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT);
/**
* Handler for commands that do not require server interaction, i.e settings etc
* @param chatId
@ -60,7 +57,7 @@ public final class LocalCommands {
private static void displayLocalCommandResponse(UUID chatId, String response) {
final String text = new StringBuilder().append("<font color=yellow>").append(response).append("</font>").toString();
ClientCallback chatMessage = new ClientCallback(ClientCallbackMethod.CHATMESSAGE, chatId,
new ChatMessage("", text, timeFormatter.format(new Date()), ChatMessage.MessageColor.BLUE));
new ChatMessage("", text, new Date(), ChatMessage.MessageColor.BLUE));
MageFrame.getInstance().processCallback(chatMessage);
}
}