From 31e92fbfcb0d012312352b9873440abd04ec3622 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 2 Oct 2016 23:46:32 +0200 Subject: [PATCH] Fixed that preventing identical chat messages is not active for game log (fixes #2274). --- .../src/main/java/mage/server/ChatManager.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Mage.Server/src/main/java/mage/server/ChatManager.java b/Mage.Server/src/main/java/mage/server/ChatManager.java index 910e7839bf..910b1b0ac2 100644 --- a/Mage.Server/src/main/java/mage/server/ChatManager.java +++ b/Mage.Server/src/main/java/mage/server/ChatManager.java @@ -107,6 +107,7 @@ public class ChatManager { } static String lastMessage = ""; + public void broadcast(UUID chatId, String userName, String message, MessageColor color, boolean withTime, MessageType messageType, SoundToPlay soundToPlay) { ChatSession chatSession = chatSessions.get(chatId); if (chatSession != null) { @@ -119,8 +120,8 @@ public class ChatManager { return; } } - - if (message.equals(lastMessage)) { + + if (!messageType.equals(MessageType.GAME) && message.equals(lastMessage)) { return; } lastMessage = message; @@ -128,12 +129,12 @@ public class ChatManager { } } - private static final String COMMANDS_LIST = - "
List of commands:" + - "
\\history or \\h [username] - shows the history of a player" + - "
\\me - shows the history of the current player" + - "
\\list or \\l - Show a list of commands" + - "
\\whisper or \\w [player name] [text] - whisper to the player with the given name"; + private static final String COMMANDS_LIST + = "
List of commands:" + + "
\\history or \\h [username] - shows the history of a player" + + "
\\me - shows the history of the current player" + + "
\\list or \\l - Show a list of commands" + + "
\\whisper or \\w [player name] [text] - whisper to the player with the given name"; private boolean performUserCommand(User user, String message, UUID chatId, boolean doError) { String command = message.substring(1).trim().toUpperCase(Locale.ENGLISH);