diff --git a/.gitignore b/.gitignore index 1dbe5ad..04842cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,10 @@ .idea +!.idea/artifacts/* +!.idea/compiler.xml +!.idea/encodings.xml +!.idea/misc.xml +!.idea/modules.xml + build buildnumber diff --git a/.idea/artifacts/LaunchServer.xml b/.idea/artifacts/LaunchServer.xml new file mode 100644 index 0000000..d88a47e --- /dev/null +++ b/.idea/artifacts/LaunchServer.xml @@ -0,0 +1,20 @@ + + + $PROJECT_DIR$/ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/Launcher.xml b/.idea/artifacts/Launcher.xml new file mode 100644 index 0000000..e359b78 --- /dev/null +++ b/.idea/artifacts/Launcher.xml @@ -0,0 +1,12 @@ + + + $PROJECT_DIR$/ + + + + + + + + + \ No newline at end of file diff --git a/.idea/artifacts/LauncherAuthlib.xml b/.idea/artifacts/LauncherAuthlib.xml new file mode 100644 index 0000000..4775b7d --- /dev/null +++ b/.idea/artifacts/LauncherAuthlib.xml @@ -0,0 +1,12 @@ + + + $PROJECT_DIR$/ + + + + + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..43b000d --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..97626ba --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..cd18037 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + Ant inspections + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..78ef274 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/LaunchServer/LaunchServer.iml b/LaunchServer/LaunchServer.iml new file mode 100644 index 0000000..932e540 --- /dev/null +++ b/LaunchServer/LaunchServer.iml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LaunchServer/source/auth/handler/AuthHandler.java b/LaunchServer/source/auth/handler/AuthHandler.java index 0d6657a..1b49052 100644 --- a/LaunchServer/source/auth/handler/AuthHandler.java +++ b/LaunchServer/source/auth/handler/AuthHandler.java @@ -46,7 +46,7 @@ public static void registerHandler(String name, Adapter adapter) { VerifyHelper.verifyIDName(name); VerifyHelper.verify(AUTH_HANDLERS.putIfAbsent(name, Objects.requireNonNull(adapter, "adapter")), - a -> a == null, String.format("Auth handler already registered: '%s'", name)); + a -> a == null, String.format("Auth handler has been already registered: '%s'", name)); } static { diff --git a/LaunchServer/source/auth/handler/CachedAuthHandler.java b/LaunchServer/source/auth/handler/CachedAuthHandler.java index 767ecea..ec3e768 100644 --- a/LaunchServer/source/auth/handler/CachedAuthHandler.java +++ b/LaunchServer/source/auth/handler/CachedAuthHandler.java @@ -69,7 +69,7 @@ @LauncherAPI protected void addEntry(Entry entry) { - entryCache.putIfAbsent(entry.uuid, entry); + entryCache.put(entry.uuid, entry); usernamesCache.put(low(entry.username), entry.uuid); } diff --git a/LaunchServer/source/auth/handler/FileAuthHandler.java b/LaunchServer/source/auth/handler/FileAuthHandler.java index adaf9fb..98fd59f 100644 --- a/LaunchServer/source/auth/handler/FileAuthHandler.java +++ b/LaunchServer/source/auth/handler/FileAuthHandler.java @@ -79,7 +79,7 @@ @Override public final UUID checkServer(String username, String serverID) { - lock.writeLock().lock(); + lock.readLock().lock(); try { UUID uuid = usernameToUUID(username); Auth auth = authsMap.get(uuid); @@ -87,7 +87,7 @@ // Check server (if has such account of course) return auth != null && auth.checkServer(username, serverID) ? uuid : null; } finally { - lock.writeLock().unlock(); + lock.readLock().unlock(); } } diff --git a/LaunchServer/source/auth/provider/AuthProvider.java b/LaunchServer/source/auth/provider/AuthProvider.java index fcba93b..5e580ab 100644 --- a/LaunchServer/source/auth/provider/AuthProvider.java +++ b/LaunchServer/source/auth/provider/AuthProvider.java @@ -32,7 +32,7 @@ @LauncherAPI public static void registerProvider(String name, Adapter adapter) { VerifyHelper.verify(AUTH_PROVIDERS.putIfAbsent(name, Objects.requireNonNull(adapter, "adapter")), - a -> a == null, String.format("Auth provider already registered: '%s'", name)); + a -> a == null, String.format("Auth provider has been already registered: '%s'", name)); } static { diff --git a/LaunchServer/source/command/handler/StdCommandHandler.java b/LaunchServer/source/command/handler/StdCommandHandler.java index 107c29d..c073c92 100644 --- a/LaunchServer/source/command/handler/StdCommandHandler.java +++ b/LaunchServer/source/command/handler/StdCommandHandler.java @@ -1,17 +1,17 @@ package launchserver.command.handler; +import java.io.BufferedReader; import java.io.IOException; import launcher.helper.IOHelper; import launchserver.LaunchServer; -import launchserver.helper.LineReader; public final class StdCommandHandler extends CommandHandler { - private final LineReader reader; + private final BufferedReader reader; public StdCommandHandler(LaunchServer server) { super(server); - reader = new LineReader(IOHelper.newReader(System.in)); + reader = IOHelper.newReader(System.in); } @Override diff --git a/Launcher/Launcher.iml b/Launcher/Launcher.iml new file mode 100644 index 0000000..dbcf7ae --- /dev/null +++ b/Launcher/Launcher.iml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Launcher/runtime/engine/api.js b/Launcher/runtime/engine/api.js index 8bf0159..65839ae 100755 --- a/Launcher/runtime/engine/api.js +++ b/Launcher/runtime/engine/api.js @@ -74,12 +74,17 @@ } function newTask(r) { - return new javafx.concurrent.Task() { call: r }; + return new javafx.concurrent.Task(); + { + r + } } function newRequestTask(request) { - return newTask(function() request.request()); -} + return newTask(function (); + request.request() +) +}; function startTask(task) { CommonHelper.newThread("FX Task Thread", true, task).start(); diff --git a/Launcher/source/client/ClientProfile.java b/Launcher/source/client/ClientProfile.java index 36fef34..ad82597 100644 --- a/Launcher/source/client/ClientProfile.java +++ b/Launcher/source/client/ClientProfile.java @@ -94,7 +94,7 @@ jvmArgs.verifyOfType(ConfigEntry.Type.STRING); classPath.verifyOfType(ConfigEntry.Type.STRING); clientArgs.verifyOfType(ConfigEntry.Type.STRING); - VerifyHelper.verify(getTitle(), s -> !s.isEmpty(), "Main class can't be empty"); + VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Main class can't be empty"); } @LauncherAPI diff --git a/LauncherAuthlib/LauncherAuthlib.iml b/LauncherAuthlib/LauncherAuthlib.iml new file mode 100644 index 0000000..c559de4 --- /dev/null +++ b/LauncherAuthlib/LauncherAuthlib.iml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/compat/authlib/GameProfile-combined.class b/compat/authlib/GameProfile-combined.class new file mode 100644 index 0000000..197a94c --- /dev/null +++ b/compat/authlib/GameProfile-combined.class Binary files differ diff --git a/compat/authlib/README.md b/compat/authlib/README.md new file mode 100644 index 0000000..fa2000d --- /dev/null +++ b/compat/authlib/README.md @@ -0,0 +1,10 @@ +authlib-clean.jar +----------------- +Этот JAR - заготовка для сборки LauncherAuthlib. +Из неё удалены не используемые клиентом классы, а так же классы, реализованные в LauncherAuthlib. + +GameProfile-combined.class +-------------------------- +Этот класс - результат слияния ASM'ом методов из Authlib 1.7.2 и Authlib 1.7.10+, в нём есть метод как для получения +UUID старого образца (без чёрточек, например `d3730e7436794ba6-8ab2a24ac9e755d4`), +так и нового образца (`d3730e74-3679-4ba6-8ab2-a24ac9e755d4`). Уже включён в `authlib-clean.jar` diff --git a/compat/authlib/authlib-clean.jar b/compat/authlib/authlib-clean.jar new file mode 100644 index 0000000..a14b54c --- /dev/null +++ b/compat/authlib/authlib-clean.jar Binary files differ