Skip to content

Commit

Permalink
Currency property setting supports SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
Sv3ks committed Apr 5, 2023
1 parent fc53b43 commit 187114b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.sv3ks</groupId>
<artifactId>HyperCurrencies</artifactId>
<version>1.2-pre2</version>
<version>1.2-pre3</version>
<packaging>jar</packaging>

<name>HyperCurrencies</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,36 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
currency.setMaxBal(Double.parseDouble(args[2]));
sender.sendMessage(msgWrap("&aSet "+currency.getName()+"'s max balance to "+currency.getStartingBal()));
return true;
case "sql:url":
if (!currency.getProvider().getProviderID().equalsIgnoreCase("hc-sql")) {
sender.sendMessage(msgWrap("&c"+currency.getName()+" is not using SQL as its provider."));
return false;
}

getCurrencyConfig().getConfig().set(currency.getName()+".sql.url",args[2]);

sender.sendMessage(msgWrap("&aSet "+currency.getName()+"'s SQL url to "+args[3]+"&c."));
return true;
case "sql:username":
if (!currency.getProvider().getProviderID().equalsIgnoreCase("hc-sql")) {
sender.sendMessage(msgWrap("&c"+currency.getName()+" is not using SQL as its provider."));
return false;
}

getCurrencyConfig().getConfig().set(currency.getName()+".sql.username",args[2]);

sender.sendMessage(msgWrap("&aSet "+currency.getName()+"'s SQL username to "+args[3]+"."));
return true;
case "sql:password":
if (!currency.getProvider().getProviderID().equalsIgnoreCase("hc-sql")) {
sender.sendMessage(msgWrap("&c"+currency.getName()+" is not using SQL as its provider."));
return false;
}

getCurrencyConfig().getConfig().set(currency.getName()+".sql.password",args[2]);

sender.sendMessage(msgWrap("&aSet "+currency.getName()+"'s SQL password to &a&k"+args[3]+"&c."));
return true;
default:
sender.sendMessage(msgWrap("&cInvalid option."));
return false;
Expand Down

0 comments on commit 187114b

Please sign in to comment.