mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
Fixed that preventing identical chat messages is not active for game log (fixes #2274).
This commit is contained in:
parent
c4b4804903
commit
31e92fbfcb
1 changed files with 9 additions and 8 deletions
|
@ -107,6 +107,7 @@ public class ChatManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
static String lastMessage = "";
|
static String lastMessage = "";
|
||||||
|
|
||||||
public void broadcast(UUID chatId, String userName, String message, MessageColor color, boolean withTime, MessageType messageType, SoundToPlay soundToPlay) {
|
public void broadcast(UUID chatId, String userName, String message, MessageColor color, boolean withTime, MessageType messageType, SoundToPlay soundToPlay) {
|
||||||
ChatSession chatSession = chatSessions.get(chatId);
|
ChatSession chatSession = chatSessions.get(chatId);
|
||||||
if (chatSession != null) {
|
if (chatSession != null) {
|
||||||
|
@ -119,8 +120,8 @@ public class ChatManager {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.equals(lastMessage)) {
|
if (!messageType.equals(MessageType.GAME) && message.equals(lastMessage)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lastMessage = message;
|
lastMessage = message;
|
||||||
|
@ -128,12 +129,12 @@ public class ChatManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String COMMANDS_LIST =
|
private static final String COMMANDS_LIST
|
||||||
"<br/>List of commands:" +
|
= "<br/>List of commands:"
|
||||||
"<br/>\\history or \\h [username] - shows the history of a player" +
|
+ "<br/>\\history or \\h [username] - shows the history of a player"
|
||||||
"<br/>\\me - shows the history of the current player" +
|
+ "<br/>\\me - shows the history of the current player"
|
||||||
"<br/>\\list or \\l - Show a list of commands" +
|
+ "<br/>\\list or \\l - Show a list of commands"
|
||||||
"<br/>\\whisper or \\w [player name] [text] - whisper to the player with the given name";
|
+ "<br/>\\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) {
|
private boolean performUserCommand(User user, String message, UUID chatId, boolean doError) {
|
||||||
String command = message.substring(1).trim().toUpperCase(Locale.ENGLISH);
|
String command = message.substring(1).trim().toUpperCase(Locale.ENGLISH);
|
||||||
|
|
Loading…
Reference in a new issue