Improved repeat message spam blocker.
This commit is contained in:
parent
2fbbfcb9e8
commit
ce5e8488da
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user