mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
Some Chat Manager updates
This commit is contained in:
parent
7a8055172d
commit
0de89ca5b7
1 changed files with 5 additions and 2 deletions
|
@ -127,20 +127,23 @@ public class ChatManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!messageType.equals(MessageType.GAME)) {
|
if (!messageType.equals(MessageType.GAME)) {
|
||||||
|
User user = UserManager.getInstance().getUserByName(userName);
|
||||||
if (message != null && userName != null && !userName.equals("")) {
|
if (message != null && userName != null && !userName.equals("")) {
|
||||||
if (message.equals(userMessages.get(userName))) {
|
if (message.equals(userMessages.get(userName))) {
|
||||||
// prevent identical messages
|
// prevent identical messages
|
||||||
|
String informUser = "Your message appears to be identical to your last message";
|
||||||
|
chatSessions.get(chatId).broadcastInfoToUser(user, informUser);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
userMessages.put(userName, message);
|
userMessages.put(userName, message);
|
||||||
if (containsSwearing(message)) {
|
if (containsSwearing(message)) {
|
||||||
|
String informUser = "Your message appears to contain profanity";
|
||||||
|
chatSessions.get(chatId).broadcastInfoToUser(user, informUser);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messageType.equals(MessageType.TALK)) {
|
if (messageType.equals(MessageType.TALK)) {
|
||||||
User user = UserManager.getInstance().getUserByName(userName);
|
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
if (user.getChatLockedUntil() != null) {
|
if (user.getChatLockedUntil() != null) {
|
||||||
if (user.getChatLockedUntil().compareTo(Calendar.getInstance().getTime()) > 0) {
|
if (user.getChatLockedUntil().compareTo(Calendar.getInstance().getTime()) > 0) {
|
||||||
|
|
Loading…
Reference in a new issue