Improved repeat message spam blocker.

This commit is contained in:
ryanhamshire 2015-08-01 19:19:11 -07:00
parent 2fbbfcb9e8
commit ce5e8488da

View File

@ -326,6 +326,10 @@ class PlayerEventHandler implements Listener
playerData.spamCount++; playerData.spamCount++;
} }
//in any case, record the timestamp of this message and also its content for next time
playerData.lastMessageTimestamp = new Date();
playerData.lastMessage = message;
//if the message was determined to be a spam, consider taking action //if the message was determined to be a spam, consider taking action
if(spam) if(spam)
{ {
@ -388,10 +392,6 @@ class PlayerEventHandler implements Listener
playerData.spamWarned = false; playerData.spamWarned = false;
} }
//in any case, record the timestamp of this message and also its content for next time
playerData.lastMessageTimestamp = new Date();
playerData.lastMessage = message;
return false; return false;
} }