- If a player has no permissions for any channel but we are still set
to modify chat, remove the channelTag and msgcolour entries.
	- Fix Spam timer to work in milliseconds so values of 0.5 actually
work.
This commit is contained in:
ElgarL committed 2012-02-01 05:43:23 +00:00
1 parent f03018da26
commit ac23c10f01
2 files changed
+8 -5

No files matched your search

+4 -1
View File
@@ -84,4 +84,7 @@ v0.16:
- Lowered event priorities to HIGH to allow other plugins the chance to beat us to the event and cancel.
- Fixed Op's with no default mode set using local chat. It will now try global, then world, then local in it's search order.
- Added a new command '/townychat reload'.
- spam_time now accepts smaller values (eg. 0.5).
- spam_time now accepts smaller values (eg. 0.5).
v0.17:
- If a player has no permissions for any channel but we are still set to modify chat, remove the channelTag and msgcolour entries.
- Fix Spam timer to work in milliseconds so values of 0.5 actually work.
@@ -136,7 +136,7 @@ public class TownyPlayerHighestListener implements Listener {
if (ChatSettings.isModify_chat()) {
try {
event.setFormat(ChatSettings.getRelevantFormatGroup(player).getGLOBAL());
event.setFormat(ChatSettings.getRelevantFormatGroup(player).getGLOBAL().replace("{channelTag}", "").replace("{msgcolour}", ""));
Resident resident = TownyUniverse.getDataSource().getResident(player.getName());
TownyChatEvent chatEvent = new TownyChatEvent(event, resident);
@@ -388,7 +388,7 @@ public class TownyPlayerHighestListener implements Listener {
*/
private boolean isSpam(Player player) {
long timeNow = System.currentTimeMillis()/1000;
long timeNow = System.currentTimeMillis();
long spam = timeNow;
if (SpamTime.containsKey(player)) {
@@ -396,12 +396,12 @@ public class TownyPlayerHighestListener implements Listener {
SpamTime.remove(player);
} else {
// No record found so ensure we don't trigger for spam
spam -= (ChatSettings.getSpam_time() + 1);
spam -= ((ChatSettings.getSpam_time() + 1)*1000);
}
SpamTime.put(player, timeNow);
if (timeNow - spam < ChatSettings.getSpam_time()) {
if (timeNow - spam < (ChatSettings.getSpam_time()*1000)) {
TownyMessaging.sendErrorMsg(player, "Unable to talk...You are spamming!");
return true;
}