From c0824a84cd20de709ba47d5c6a6c4654f6f6149c Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Sun, 5 Apr 2020 13:46:04 +0300 Subject: [PATCH] =?UTF-8?q?[ANY]=20=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D0=BE=D1=81=D1=82=D0=B0=D1=82=D0=BA=D0=B8=20=D1=82=20?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D1=80=D0=BE=D0=B9=20=D1=81=D0=B8=D1=81=D1=82?= =?UTF-8?q?=D0=B5=D0=BC=D1=8B=20=D1=81=D0=BE=D0=BA=D0=B5=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20(=D0=B5=D1=89=D1=91=20=D1=81=204.xx).=20+=20[ANY]=20=D0=9E?= =?UTF-8?q?=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D1=8B=20=D0=BC=D0=BE?= =?UTF-8?q?=D0=B4=D1=83=D0=BB=D0=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gravit/launcher/request/RequestType.java | 30 ------------------- .../uuid/BatchProfileByUsernameRequest.java | 3 +- .../launcher/serialize/SerializeLimits.java | 10 ------- .../pro/gravit/utils/helper/IOHelper.java | 2 +- modules | 2 +- 5 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644 LauncherAPI/src/main/java/pro/gravit/launcher/request/RequestType.java delete mode 100644 LauncherCore/src/main/java/pro/gravit/launcher/serialize/SerializeLimits.java diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/RequestType.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/RequestType.java deleted file mode 100644 index 739029c2..00000000 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/RequestType.java +++ /dev/null @@ -1,30 +0,0 @@ -package pro.gravit.launcher.request; - -import pro.gravit.launcher.serialize.HInput; -import pro.gravit.launcher.serialize.stream.EnumSerializer; - -import java.io.IOException; - -public enum RequestType implements EnumSerializer.Itf { - PING(0), // Ping request - LEGACYLAUNCHER(1), UPDATE(2), UPDATE_LIST(3), // Update requests - AUTH(4), JOIN_SERVER(5), CHECK_SERVER(6), // Auth requests - PROFILE_BY_USERNAME(7), PROFILE_BY_UUID(8), BATCH_PROFILE_BY_USERNAME(9), // Profile requests - PROFILES(10), SERVERAUTH(11), SETPROFILE(12), LAUNCHER(13), CHANGESERVER(14), EXECCOMMAND(15), - CUSTOM(255); // Custom requests - private static final EnumSerializer SERIALIZER = new EnumSerializer<>(RequestType.class); - private final int n; - - RequestType(int n) { - this.n = n; - } - - public static RequestType read(HInput input) throws IOException { - return SERIALIZER.read(input); - } - - @Override - public int getNumber() { - return n; - } -} diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java index efa826af..a583396f 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/uuid/BatchProfileByUsernameRequest.java @@ -4,7 +4,6 @@ import pro.gravit.launcher.events.request.BatchProfileByUsernameRequestEvent; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.websockets.WebSocketRequest; -import pro.gravit.launcher.serialize.SerializeLimits; import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.VerifyHelper; @@ -20,7 +19,7 @@ public BatchProfileByUsernameRequest(String... usernames) throws IOException { this.list[i].client = ""; this.list[i].username = usernames[i]; } - IOHelper.verifyLength(usernames.length, SerializeLimits.MAX_BATCH_SIZE); + IOHelper.verifyLength(usernames.length, IOHelper.MAX_BATCH_SIZE); for (String username : usernames) VerifyHelper.verifyUsername(username); } diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/SerializeLimits.java b/LauncherCore/src/main/java/pro/gravit/launcher/serialize/SerializeLimits.java deleted file mode 100644 index cd4f5551..00000000 --- a/LauncherCore/src/main/java/pro/gravit/launcher/serialize/SerializeLimits.java +++ /dev/null @@ -1,10 +0,0 @@ -package pro.gravit.launcher.serialize; - -public class SerializeLimits { - - public static final int MAX_BATCH_SIZE = 128; - - public static final byte EXPECTED_BYTE = 0b01010101; - - public static final int MAX_DIGEST = 512; -} diff --git a/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java b/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java index d0625697..d788da16 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/helper/IOHelper.java @@ -23,7 +23,7 @@ public final class IOHelper { public static final long MB32 = 1 << 25; public static final Charset UNICODE_CHARSET = StandardCharsets.UTF_8; public static final Charset ASCII_CHARSET = StandardCharsets.US_ASCII; - + public static final int MAX_BATCH_SIZE = 128; // Charset public static final int SOCKET_TIMEOUT = VerifyHelper.verifyInt( Integer.parseUnsignedInt(System.getProperty("launcher.socketTimeout", Integer.toString(30000))), diff --git a/modules b/modules index 1d04cc32..5fed180f 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 1d04cc3261679c21951c878e2c1a8b34417c5816 +Subproject commit 5fed180f06a8b86f70202fc74282a8ab09583a96