diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java index 5301903c..e26cd640 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/binary/tasks/CertificateAutogenTask.java @@ -1,6 +1,5 @@ package pro.gravit.launchserver.binary.tasks; -import org.bouncycastle.asn1.ASN1ObjectIdentifier; import org.bouncycastle.asn1.x500.X500Name; import org.bouncycastle.asn1.x500.X500NameBuilder; import org.bouncycastle.asn1.x500.style.BCStyle; diff --git a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java index f2c2421e..e9c9a0e8 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java +++ b/Launcher/src/main/java/pro/gravit/launcher/LauncherEngine.java @@ -12,7 +12,6 @@ import pro.gravit.launcher.managers.ClientGsonManager; import pro.gravit.launcher.managers.ClientHookManager; import pro.gravit.launcher.managers.ConsoleManager; -import pro.gravit.launcher.modules.events.ClosePhase; import pro.gravit.launcher.modules.events.PreConfigPhase; import pro.gravit.launcher.request.Request; import pro.gravit.launcher.request.RequestException; @@ -88,7 +87,7 @@ public static void main(String... args) throws Throwable { ConsoleManager.initConsole(); HWIDProvider.registerHWIDs(); LauncherEngine.modulesManager.invokeEvent(new PreConfigPhase()); - LauncherConfig config = Launcher.getConfig(); + Launcher.getConfig(); // init config long startTime = System.currentTimeMillis(); try { new LauncherEngine().start(args); diff --git a/Launcher/src/main/java/pro/gravit/launcher/NewLauncherSettings.java b/Launcher/src/main/java/pro/gravit/launcher/NewLauncherSettings.java index f95be120..1c78e9c9 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/NewLauncherSettings.java +++ b/Launcher/src/main/java/pro/gravit/launcher/NewLauncherSettings.java @@ -2,7 +2,6 @@ import pro.gravit.launcher.client.UserSettings; import pro.gravit.launcher.hasher.HashedDir; -import pro.gravit.launcher.profiles.ClientProfile; import java.nio.file.Path; import java.util.*; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java index 9fe5a32e..2905bfd2 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ClientLauncher.java @@ -22,8 +22,6 @@ import pro.gravit.launcher.serialize.HOutput; import pro.gravit.launcher.serialize.stream.StreamObject; import pro.gravit.launcher.utils.DirWatcher; -import pro.gravit.launcher.utils.NativeJVMHalt; -import pro.gravit.utils.PublicURLClassLoader; import pro.gravit.utils.Version; import pro.gravit.utils.helper.*; import pro.gravit.utils.helper.JVMHelper.OS; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/LauncherUpdateController.java b/Launcher/src/main/java/pro/gravit/launcher/client/LauncherUpdateController.java index 599dc121..74ebd59a 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/LauncherUpdateController.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/LauncherUpdateController.java @@ -5,18 +5,15 @@ import pro.gravit.launcher.hasher.HashedDir; import pro.gravit.launcher.hasher.HashedEntry; import pro.gravit.launcher.hasher.HashedFile; -import pro.gravit.launcher.managers.SettingsManager; import pro.gravit.launcher.request.update.UpdateRequest; -import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; import java.io.File; import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.concurrent.atomic.AtomicReference; + @Deprecated public class LauncherUpdateController { diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java index af9c68a8..6474c673 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/modules/impl/SimpleModuleManager.java @@ -5,7 +5,6 @@ import pro.gravit.utils.PublicURLClassLoader; import pro.gravit.utils.Version; import pro.gravit.utils.helper.IOHelper; -import pro.gravit.utils.helper.JVMHelper; import pro.gravit.utils.helper.LogHelper; import pro.gravit.launcher.LauncherTrustManager; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java index ecd9b17b..b941429a 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/Request.java @@ -46,7 +46,6 @@ public R request(StdWebSocketService service) throws Exception { return requestDo(service); } - @SuppressWarnings("unchecked") protected R requestDo(StdWebSocketService service) throws Exception { return service.requestSync(this); } diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java index 45cac23c..5b896a35 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/ClientWebSocketService.java @@ -20,7 +20,6 @@ import java.lang.reflect.Type; import java.net.URI; import java.net.URISyntaxException; -import java.util.HashSet; public abstract class ClientWebSocketService extends ClientJSONPoint { public final Gson gson; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java index 21ba495d..dfb5eecf 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/request/websockets/StdWebSocketService.java @@ -18,7 +18,8 @@ import java.util.concurrent.ExecutionException; public class StdWebSocketService extends ClientWebSocketService { - private final ConcurrentHashMap<UUID, CompletableFuture> futureMap = new ConcurrentHashMap<>(); + @SuppressWarnings("rawtypes") + private final ConcurrentHashMap<UUID, CompletableFuture> futureMap = new ConcurrentHashMap<>(); private final HashSet<EventHandler> eventHandlers = new HashSet<>(); public void registerEventHandler(EventHandler handler) { @@ -50,7 +51,8 @@ public<T extends WebSocketEvent> void eventHandle(T webSocketEvent) { processEventHandlers(webSocketEvent); return; } - CompletableFuture future = futureMap.get(event.requestUUID); + @SuppressWarnings("rawtypes") + CompletableFuture future = futureMap.get(event.requestUUID); if(future != null) { if (event instanceof ErrorRequestEvent) { future.completeExceptionally(new RequestException(((ErrorRequestEvent) event).error)); diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/AsyncDownloader.java b/LauncherCore/src/main/java/pro/gravit/launcher/AsyncDownloader.java index a9707b2c..4a024f88 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/AsyncDownloader.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/AsyncDownloader.java @@ -17,12 +17,13 @@ import java.util.concurrent.Executor; public class AsyncDownloader { + public static final Callback IGNORE = (ignored) -> {}; public AsyncDownloader(Callback callback) { this.callback = callback; } public AsyncDownloader() { - callback = (ignored) -> {}; + callback = IGNORE; } @FunctionalInterface @@ -33,11 +34,18 @@ public interface Callback public final Callback callback; public static class SizedFile { - public final String path; + public final String urlPath, filePath; public final long size; public SizedFile(String path, long size) { - this.path = path; + this.urlPath = path; + this.filePath = path; + this.size = size; + } + + public SizedFile(String urlPath, String filePath, long size) { + this.urlPath = urlPath; + this.filePath = filePath; this.size = size; } } @@ -67,8 +75,8 @@ public void downloadListInOneThread(List<SizedFile> files, String baseURL, Path String path = baseUri.getPath(); for(AsyncDownloader.SizedFile currentFile : files) { - URL url = new URI(scheme,host,path + currentFile.path, "", "").toURL(); - downloadFile(url, targetDir.resolve(currentFile.path), currentFile.size); + URL url = new URI(scheme, host, path + currentFile.urlPath, "", "").toURL(); + downloadFile(url, targetDir.resolve(currentFile.filePath), currentFile.size); } } public List<List<SizedFile>> sortFiles(List<SizedFile> files, int threads) @@ -90,7 +98,8 @@ public List<List<SizedFile>> sortFiles(List<SizedFile> files, int threads) return result; } - public CompletableFuture[] runDownloadList(List<List<SizedFile>> files, String baseURL, Path targetDir, Executor executor) { + @SuppressWarnings("rawtypes") + public CompletableFuture[] runDownloadList(List<List<SizedFile>> files, String baseURL, Path targetDir, Executor executor) { int threads = files.size(); CompletableFuture[] futures = new CompletableFuture[threads]; for(int i=0;i<threads;++i) diff --git a/LauncherCore/src/main/java/pro/gravit/launcher/HTTPRequest.java b/LauncherCore/src/main/java/pro/gravit/launcher/HTTPRequest.java index 2b4bb42c..13e53638 100644 --- a/LauncherCore/src/main/java/pro/gravit/launcher/HTTPRequest.java +++ b/LauncherCore/src/main/java/pro/gravit/launcher/HTTPRequest.java @@ -2,12 +2,10 @@ import com.google.gson.JsonElement; import com.google.gson.JsonParser; -import pro.gravit.utils.helper.IOHelper; import pro.gravit.utils.helper.LogHelper; import java.io.IOException; import java.io.InputStreamReader; -import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; diff --git a/modules b/modules index 3bee30b7..c3ce7d13 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit 3bee30b78fb6a2e92fc97e3b6a257a8c4e9d4d54 +Subproject commit c3ce7d13bf9b31a6121b35198059d7289f855d0f