From 5c88b8eb148cb9e28b59c9f366d2e41b6ff56a51 Mon Sep 17 00:00:00 2001 From: Gravit Date: Wed, 3 Apr 2019 15:51:41 +0700 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20ClientPermissions=20=D1=81=D0=B5?= =?UTF-8?q?=D1=80=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7=D1=83=D0=B5=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D0=B2=20Long?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gravit/launcher/server/ServerWrapper.java | 2 +- .../ru/gravit/launcher/ClientPermissions.java | 26 ++++++------------- 2 files changed, 9 insertions(+), 19 deletions(-) diff --git a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java index c4c8b3a4..3dd22fcd 100644 --- a/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java +++ b/ServerWrapper/src/main/java/ru/gravit/launcher/server/ServerWrapper.java @@ -103,7 +103,7 @@ public static void main(String... args) throws Throwable { gsonBuiler.setPrettyPrinting(); gson = gsonBuiler.create(); initGson(); - if(args.length > 0 && args[0].equals("setup")) + if(args.length > 0 && args[0].equals("setup") && !disableSetup) { generateConfigIfNotExists(); LogHelper.debug("Read ServerWrapperConfig.json"); diff --git a/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java b/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java index c13828a6..75957772 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/ClientPermissions.java @@ -8,25 +8,20 @@ public class ClientPermissions { public static final ClientPermissions DEFAULT = new ClientPermissions(); @LauncherAPI - public boolean canAdmin = false; + public boolean canAdmin; @LauncherAPI - public boolean canServer = false; + public boolean canServer; @LauncherAPI - public boolean canUSR1 = false; + public boolean canUSR1; @LauncherAPI - public boolean canUSR2 = false; + public boolean canUSR2; @LauncherAPI - public boolean canUSR3 = false; + public boolean canUSR3; @LauncherAPI - public boolean canBot = false; + public boolean canBot; public ClientPermissions(HInput input) throws IOException { - canAdmin = input.readBoolean(); - canServer = input.readBoolean(); - canUSR1 = input.readBoolean(); - canUSR2 = input.readBoolean(); - canUSR3 = input.readBoolean(); - canBot = input.readBoolean(); + this(input.readLong()); } public ClientPermissions() { @@ -67,11 +62,6 @@ public static ClientPermissions getSuperuserAccount() { } public void write(HOutput output) throws IOException { - output.writeBoolean(canAdmin); - output.writeBoolean(canServer); - output.writeBoolean(canUSR1); - output.writeBoolean(canUSR2); - output.writeBoolean(canUSR3); - output.writeBoolean(canBot); + output.writeLong(toLong()); } }