mirror of
https://github.com/darksaid98/TownyChat.git
synced 2026-12-04 14:38:58 +00:00
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.
This commit is contained in:
1 parent
f03018da26
commit
ac23c10f01
2 files changed
+7
-4
No files matched your search
@@ -85,3 +85,6 @@ v0.16:
|
|||||||
- 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.
|
- 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'.
|
- 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()) {
|
if (ChatSettings.isModify_chat()) {
|
||||||
try {
|
try {
|
||||||
event.setFormat(ChatSettings.getRelevantFormatGroup(player).getGLOBAL());
|
event.setFormat(ChatSettings.getRelevantFormatGroup(player).getGLOBAL().replace("{channelTag}", "").replace("{msgcolour}", ""));
|
||||||
Resident resident = TownyUniverse.getDataSource().getResident(player.getName());
|
Resident resident = TownyUniverse.getDataSource().getResident(player.getName());
|
||||||
|
|
||||||
TownyChatEvent chatEvent = new TownyChatEvent(event, resident);
|
TownyChatEvent chatEvent = new TownyChatEvent(event, resident);
|
||||||
@@ -388,7 +388,7 @@ public class TownyPlayerHighestListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
private boolean isSpam(Player player) {
|
private boolean isSpam(Player player) {
|
||||||
|
|
||||||
long timeNow = System.currentTimeMillis()/1000;
|
long timeNow = System.currentTimeMillis();
|
||||||
long spam = timeNow;
|
long spam = timeNow;
|
||||||
|
|
||||||
if (SpamTime.containsKey(player)) {
|
if (SpamTime.containsKey(player)) {
|
||||||
@@ -396,12 +396,12 @@ public class TownyPlayerHighestListener implements Listener {
|
|||||||
SpamTime.remove(player);
|
SpamTime.remove(player);
|
||||||
} else {
|
} else {
|
||||||
// No record found so ensure we don't trigger for spam
|
// 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);
|
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!");
|
TownyMessaging.sendErrorMsg(player, "Unable to talk...You are spamming!");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user