Remove the interact spam check. I think it was only useful back in the old days where the denied messages where broadcasted to other players and not only yourself.

This commit is contained in:
Olof Larsson 2013-04-26 11:07:29 +02:00
parent 7ce0100e73
commit 7cbc99bdd6
2 changed files with 0 additions and 52 deletions

View File

@ -140,7 +140,6 @@ public class MConf extends Entity<MConf>
public boolean handleExploitObsidianGenerators = true; public boolean handleExploitObsidianGenerators = true;
public boolean handleExploitEnderPearlClipping = true; public boolean handleExploitEnderPearlClipping = true;
public boolean handleExploitInteractionSpam = true;
public boolean handleExploitTNTWaterlog = false; public boolean handleExploitTNTWaterlog = false;
// -------------------------------------------- // // -------------------------------------------- //

View File

@ -37,57 +37,6 @@ public class FactionsListenerExploit implements Listener
Bukkit.getPluginManager().registerEvents(this, Factions.get()); Bukkit.getPluginManager().registerEvents(this, Factions.get());
} }
// -------------------------------------------- //
// INTERACT SPAM
// -------------------------------------------- //
// TODO: Now that I decoupled this one it may be to sensitive.
// TODO: Yeah it's faaaaaaaaaar to sensitive. Let's just comment it out for now.
/*
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void interactSpam(PlayerInteractEvent event)
{
if (!MConf.get().handleExploitInteractionSpam) return;
Player player = event.getPlayer();
String playerId = SenderUtil.getSenderId(player);
InteractAttemptSpam attempt = interactSpammers.get(playerId);
if (attempt == null)
{
attempt = new InteractAttemptSpam();
interactSpammers.put(playerId, attempt);
}
int count = attempt.increment();
if (count >= 10)
{
player.sendMessage(Txt.parse("<b>Ouch, that is starting to hurt. You should give it a rest."));
player.damage(NumberConversions.floor((double)count / 10));
}
}
// for handling people who repeatedly spam attempts to open a door (or similar) in another faction's territory
private Map<String, InteractAttemptSpam> interactSpammers = new HashMap<String, InteractAttemptSpam>();
private static class InteractAttemptSpam
{
private int attempts = 0;
private long lastAttempt = System.currentTimeMillis();
// returns the current attempt count
public int increment()
{
long Now = System.currentTimeMillis();
if (Now > lastAttempt + 2000)
attempts = 1;
else
attempts++;
lastAttempt = Now;
return attempts;
}
}
*/
// -------------------------------------------- // // -------------------------------------------- //
// OBSIDIAN GENERATORS // OBSIDIAN GENERATORS
// -------------------------------------------- // // -------------------------------------------- //