From 22916afa05bd54f5ea759cedfa645092bb8dffaa Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Mon, 24 Nov 2014 19:21:06 +0100 Subject: [PATCH] =?UTF-8?q?Refactoring=20des=20classes=20de=20gestion=20de?= =?UTF-8?q?=20spam=20car=20elle=20vont=20servir=20pour=20le=20syst=C3=A8me?= =?UTF-8?q?=20de=20censure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../plugin/pandacraftutils/PandacraftUtils.java | 8 ++++---- .../ChatAnalysisManager.java} | 16 ++++++++-------- .../ChatAnalysisPlayer.java} | 6 +++--- .../plugin/pandacraftutils/list/CommandList.java | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) rename src/net/mc_pandacraft/java/plugin/pandacraftutils/{antispam/AntispamManager.java => chat_analyzer/ChatAnalysisManager.java} (79%) rename src/net/mc_pandacraft/java/plugin/pandacraftutils/{antispam/AntispamPlayer.java => chat_analyzer/ChatAnalysisPlayer.java} (97%) diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java index 610f965..48bd967 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java @@ -2,7 +2,7 @@ package net.mc_pandacraft.java.plugin.pandacraftutils; import net.mc_pandacraft.java.plugin.pandacraftutils.afk.CommandAfk; -import net.mc_pandacraft.java.plugin.pandacraftutils.antispam.AntispamManager; +import net.mc_pandacraft.java.plugin.pandacraftutils.chat_analyzer.ChatAnalysisManager; import net.mc_pandacraft.java.plugin.pandacraftutils.creativ_cheat.CreativCheatManager; import net.mc_pandacraft.java.plugin.pandacraftutils.list.CommandList; import net.mc_pandacraft.java.plugin.pandacraftutils.me.CommandMe; @@ -30,7 +30,7 @@ public class PandacraftUtils extends JavaPlugin { public SpawnTimeManager spawnTimeManager; - public AntispamManager antispamManager; + public ChatAnalysisManager chatAnalysisManager; public CreativCheatManager creativCheatManager; public NoPvpProtectManager noPvpProtectManager; @@ -53,7 +53,7 @@ public class PandacraftUtils extends JavaPlugin { commandWandSelection = new CommandWandSelection(this); spawnTimeManager = new SpawnTimeManager(this); - antispamManager = new AntispamManager(this); + chatAnalysisManager = new ChatAnalysisManager(this); creativCheatManager = new CreativCheatManager(this); noPvpProtectManager = new NoPvpProtectManager(this); @@ -72,7 +72,7 @@ public class PandacraftUtils extends JavaPlugin { commandSpeedMessage = null; spawnTimeManager = null; - antispamManager = null; + chatAnalysisManager = null; creativCheatManager = null; noPvpProtectManager = null; diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/antispam/AntispamManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/chat_analyzer/ChatAnalysisManager.java similarity index 79% rename from src/net/mc_pandacraft/java/plugin/pandacraftutils/antispam/AntispamManager.java rename to src/net/mc_pandacraft/java/plugin/pandacraftutils/chat_analyzer/ChatAnalysisManager.java index 3d0503d..9ba377c 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/antispam/AntispamManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/chat_analyzer/ChatAnalysisManager.java @@ -1,4 +1,4 @@ -package net.mc_pandacraft.java.plugin.pandacraftutils.antispam; +package net.mc_pandacraft.java.plugin.pandacraftutils.chat_analyzer; import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils; @@ -11,19 +11,19 @@ import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerQuitEvent; -public class AntispamManager implements Listener { +public class ChatAnalysisManager implements Listener { - private AntispamPlayer[] aPlayers; + private ChatAnalysisPlayer[] aPlayers; private PandacraftUtils plugin; - public AntispamManager(PandacraftUtils pl) + public ChatAnalysisManager(PandacraftUtils pl) { plugin = pl; plugin.getServer().getPluginManager().registerEvents(this, plugin); - aPlayers = new AntispamPlayer[plugin.getServer().getMaxPlayers()]; + aPlayers = new ChatAnalysisPlayer[plugin.getServer().getMaxPlayers()]; // analyse des joueurs déjà en ligne (/reload) @@ -50,11 +50,11 @@ public class AntispamManager implements Listener { - public AntispamPlayer getAPlayer(Player p) + public ChatAnalysisPlayer getAPlayer(Player p) { if (p == null || !p.isOnline()) return null; - for (AntispamPlayer ap : aPlayers) + for (ChatAnalysisPlayer ap : aPlayers) { if (ap != null && ap.getPlayer() == p) return ap; @@ -69,7 +69,7 @@ public class AntispamManager implements Listener { { int i=0; while (i