diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReconfigurableManager.java b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReconfigurableManager.java index 56ab43f0..c3133a96 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReconfigurableManager.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReconfigurableManager.java @@ -11,16 +11,16 @@ public class ReconfigurableManager { private final HashMap RECONFIGURABLE = new HashMap<>(); public void registerReconfigurable(String name, Reconfigurable reconfigurable) { - VerifyHelper.putIfAbsent(RECONFIGURABLE, name, Objects.requireNonNull(reconfigurable, "adapter"), + VerifyHelper.putIfAbsent(RECONFIGURABLE, name.toLowerCase(), Objects.requireNonNull(reconfigurable, "adapter"), String.format("Reloadable has been already registered: '%s'", name)); } public void printHelp(String name) { - RECONFIGURABLE.get(name).printConfigHelp(); + RECONFIGURABLE.get(name.toLowerCase()).printConfigHelp(); } public void call(String name, String action, String[] args) { - RECONFIGURABLE.get(name).reconfig(action, args); + RECONFIGURABLE.get(name.toLowerCase()).reconfig(action.toLowerCase(), args); } public void printReconfigurables() { diff --git a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReloadManager.java b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReloadManager.java index 33eb7872..95a06e6e 100644 --- a/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReloadManager.java +++ b/LaunchServer/src/main/java/ru/gravit/launchserver/manangers/ReloadManager.java @@ -11,8 +11,8 @@ public class ReloadManager { private final HashMap RELOADABLES = new HashMap<>(); public void registerReloadable(String name, Reloadable reloadable) { - VerifyHelper.putIfAbsent(RELOADABLES, name, Objects.requireNonNull(reloadable, "adapter"), - String.format("Reloadable has been already registered: '%s'", name)); + VerifyHelper.putIfAbsent(RELOADABLES, name.toLowerCase(), Objects.requireNonNull(reloadable, "adapter"), + String.format("Reloadable has been already registered: '%s'", name.toLowerCase())); } public void reloadAll() { @@ -26,7 +26,7 @@ public void reloadAll() { } public void reload(String name) throws Exception { - RELOADABLES.get(name).reload(); + RELOADABLES.get(name.toLowerCase()).reload(); } public void printReloadables() { diff --git a/libLauncher/src/main/java/ru/gravit/utils/command/CommandHandler.java b/libLauncher/src/main/java/ru/gravit/utils/command/CommandHandler.java index 4076888f..8739cd42 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/command/CommandHandler.java +++ b/libLauncher/src/main/java/ru/gravit/utils/command/CommandHandler.java @@ -21,6 +21,7 @@ public void eval(String line, boolean bell) { String[] args; try { args = CommonHelper.parseCommand(line); + if(args.length > 0) args[0] = args[0].toLowerCase(); } catch (Exception e) { LogHelper.error(e); return; @@ -72,8 +73,8 @@ private void readLoop() throws IOException { public void registerCommand(String name, Command command) { VerifyHelper.verifyIDName(name); - VerifyHelper.putIfAbsent(commands, name, Objects.requireNonNull(command, "command"), - String.format("Command has been already registered: '%s'", name)); + VerifyHelper.putIfAbsent(commands, name.toLowerCase(), Objects.requireNonNull(command, "command"), + String.format("Command has been already registered: '%s'", name.toLowerCase())); } @Override