diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java index 4f2f41fd..fc779fb3 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/permissions/JsonFilePermissionsHandler.java @@ -52,6 +52,19 @@ public void invoke(String... args) throws Exception { } }; commands.put("reload", reload); + commands.put("save", new SubCommand() { + @Override + public void invoke(String... args) throws Exception { + Path path = Paths.get(filename); + if (!IOHelper.exists(path)) { + try (Writer writer = IOHelper.newWriter(path)) { + Launcher.gsonManager.gson.toJson(map, writer); + } catch (IOException e) { + LogHelper.error(e); + } + } + } + }); return commands; } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/permissions/JsonLongFilePermissionsHandler.java b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/permissions/JsonLongFilePermissionsHandler.java index 29848645..1649303c 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/auth/permissions/JsonLongFilePermissionsHandler.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/auth/permissions/JsonLongFilePermissionsHandler.java @@ -53,6 +53,19 @@ public void invoke(String... args) throws Exception { } }; commands.put("reload", reload); + commands.put("save", new SubCommand() { + @Override + public void invoke(String... args) throws Exception { + Path path = Paths.get(filename); + if (!IOHelper.exists(path)) { + try (Writer writer = IOHelper.newWriter(path)) { + Launcher.gsonManager.gson.toJson(map, writer); + } catch (IOException e) { + LogHelper.error(e); + } + } + } + }); return commands; } diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/components/AbstractLimiter.java b/LaunchServer/src/main/java/pro/gravit/launchserver/components/AbstractLimiter.java index 1087e359..44742e0b 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/components/AbstractLimiter.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/components/AbstractLimiter.java @@ -52,7 +52,6 @@ public void invoke(String... args) throws Exception { commands.put("clearExclude", new SubCommand() { @Override public void invoke(String... args) throws Exception { - verifyArgs(args, 1); exclude.clear(); } });