Skip to content

Commit

Permalink
Fix SQL issue, added message to TNE reload.
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorfromhell committed Dec 21, 2023
1 parent e6f4955 commit 2ac1cec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Core/resources/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Messages:

Admin:
NoHoldings: "<red>$player has no holdings for the world '$world'!"
Reloaded: "<yellow>Reloaded configuration type of: $type"
Holdings: "<white>$player currently has <gold>$amount <white>for world '$world'!"
NoTransactions: "<white>$player has no transactions to display."
Configuration: "<white>The value of $node is currently $value."
Expand Down
6 changes: 6 additions & 0 deletions Core/src/net/tnemc/core/command/AdminCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down

0 comments on commit 2ac1cec

Please sign in to comment.