diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/ConfigManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/ConfigManager.java index 6745bf4..529e3d4 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/ConfigManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/ConfigManager.java @@ -87,6 +87,7 @@ public class ConfigManager { initChatAnalysisBadWord(); initCommandAlias(); + initAutomessages(); } diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java index 6efeaa7..48030f6 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/PandacraftUtils.java @@ -1,7 +1,6 @@ package net.mc_pandacraft.java.plugin.pandacraftutils; -import java.sql.SQLException; import net.mc_pandacraft.java.plugin.pandacraftutils.afk.CommandAfk; import net.mc_pandacraft.java.plugin.pandacraftutils.calculator.CalculatorManager; @@ -21,7 +20,6 @@ import net.mc_pandacraft.java.plugin.pandacraftutils.spawntime.SpawnTimeManager; import net.mc_pandacraft.java.plugin.pandacraftutils.survival_cuboid.CommandCubo; import net.mc_pandacraft.java.plugin.pandacraftutils.survival_cuboid.CommandWandSelection; import net.mc_pandacraft.java.plugin.pandacraftutils.system_analyzer.CommandSystem; -import net.mc_pandacraft.java.util.mysql.DBConnection; import org.bukkit.ChatColor; import org.bukkit.entity.Player; @@ -32,7 +30,7 @@ public class PandacraftUtils extends JavaPlugin { private static PandacraftUtils instance; public static PandacraftUtils getInstance() { return instance; } - public DBConnection databaseConnection; + //public DBConnection databaseConnection; public CommandAfk commandAfk; public CommandList commandPlayers; @@ -61,6 +59,7 @@ public class PandacraftUtils extends JavaPlugin { instance = this; + /* try { databaseConnection = new DBConnection(ConfigManager.getInstance().Database_host, ConfigManager.getInstance().Database_port, @@ -70,7 +69,7 @@ public class PandacraftUtils extends JavaPlugin { } catch (ClassNotFoundException | SQLException e) { getLogger().severe("Impossible de se connecter à la base de donnée !"); e.printStackTrace(); - } + }*/ commandPlayers = new CommandList(this); commandSetblock = new CommandSetblock(this); @@ -127,7 +126,7 @@ public class PandacraftUtils extends JavaPlugin { ConfigManager.reloadConfig(); - try { databaseConnection.getConnection().close(); } catch (SQLException e) { } + //try { databaseConnection.getConnection().close(); } catch (SQLException e) { } } diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/PandacraftUtils_Player.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/PandacraftUtils_Player.java deleted file mode 100644 index 825551b..0000000 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/PandacraftUtils_Player.java +++ /dev/null @@ -1,57 +0,0 @@ -package net.mc_pandacraft.java.plugin.pandacraftutils.data_model; - -import java.sql.Date; -import java.util.UUID; - -import org.bukkit.entity.Player; - -/** - * Représente les données persistante correspondant à un joueur donné sur le serveur - * - * Le nom de cette classe correspond à celle de la table dans la base de donnée, - * d'où la présence d'un _(underscore), qui n'est pas admis en général - * dans le nom d'une classe - * @author Marc Baloup - * - */ -public class PandacraftUtils_Player extends Table { - - // TODO Créer la table dans la base de donnée - - // TODO Ajouter les champs - public UUID uuid; // NOT NULL - public String name; // NOT NULL - public boolean vanish = false; // NOT NULL - public Date mute = null; - - - public PandacraftUtils_Player(Player p) { - name = p.getName(); - uuid = p.getUniqueId(); - } - - - - - - @Override - public String[] getValues() { - - return new String[]{ - uuid.toString(), - name, - (vanish)?"true":"false", - String.valueOf(mute)}; - } - - @Override - public String[] getFieldsName() { - // TODO Auto-generated method stub - return new String[]{ - "uuid", - "name", - "vanish", - "mute"}; - } - -} diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/Table.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/Table.java index 6be06d7..a7735c0 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/Table.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/data_model/Table.java @@ -7,12 +7,11 @@ import java.sql.Statement; import org.apache.commons.lang.StringUtils; -import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils; import net.mc_pandacraft.java.util.mysql.DBConnection; public abstract class Table { - DBConnection db = PandacraftUtils.getInstance().databaseConnection; + DBConnection db = null;//PandacraftUtils.getInstance().databaseConnection; private boolean saved = false;