From 2ac1cecf63d70b74f2e1bf71ef66e0ea8b0447b7 Mon Sep 17 00:00:00 2001 From: creatorfromhell Date: Thu, 21 Dec 2023 18:26:09 -0500 Subject: [PATCH] Fix SQL issue, added message to TNE reload. --- Core/resources/messages.yml | 1 + Core/src/net/tnemc/core/command/AdminCommand.java | 6 ++++++ .../src/net/tnemc/core/io/storage/connect/SQLConnector.java | 1 - 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Core/resources/messages.yml b/Core/resources/messages.yml index 6e131f32..7ff562bb 100644 --- a/Core/resources/messages.yml +++ b/Core/resources/messages.yml @@ -21,6 +21,7 @@ Messages: Admin: NoHoldings: "$player has no holdings for the world '$world'!" + Reloaded: "Reloaded configuration type of: $type" Holdings: "$player currently has $amount for world '$world'!" NoTransactions: "$player has no transactions to display." Configuration: "The value of $node is currently $value." diff --git a/Core/src/net/tnemc/core/command/AdminCommand.java b/Core/src/net/tnemc/core/command/AdminCommand.java index 0c38e6b8..62b83753 100644 --- a/Core/src/net/tnemc/core/command/AdminCommand.java +++ b/Core/src/net/tnemc/core/command/AdminCommand.java @@ -129,6 +129,7 @@ public static void onPurge(CmdSource sender) { } public static void onReload(CmdSource sender, String type) { + String formattedType = type; switch(type.toLowerCase()) { case "config" -> { TNECore.instance().config().load(); @@ -146,8 +147,13 @@ public static void onReload(CmdSource sender, String type) { TNECore.instance().data().load(); TNECore.storage().loadAll(Account.class, ""); TNECore.instance().message().load(); + formattedType = "all"; } } + + final MessageData data = new MessageData("Messages.Admin.Reloaded"); + data.addReplacement("$type", formattedType); + sender.message(data); } public static void onReset(CmdSource sender) { diff --git a/Core/src/net/tnemc/core/io/storage/connect/SQLConnector.java b/Core/src/net/tnemc/core/io/storage/connect/SQLConnector.java index f0a4075f..bfc7e8ea 100644 --- a/Core/src/net/tnemc/core/io/storage/connect/SQLConnector.java +++ b/Core/src/net/tnemc/core/io/storage/connect/SQLConnector.java @@ -81,7 +81,6 @@ public void initialize() { config.addDataSourceProperty("user", DataConfig.yaml().getString("Data.Database.SQL.User")); config.addDataSourceProperty("password", DataConfig.yaml().getString("Data.Database.SQL.Password")); - config.setDriverClassName("org.sqlite.JDBC"); config.setPoolName("TNE"); config.setConnectionTestQuery("SELECT 1"); config.setMaximumPoolSize(DataConfig.yaml().getInt("Data.Pool.MaxSize"));