diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java index ad331a4a..e89b5e6a 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -411,7 +411,7 @@ public static void main(String... args) throws Throwable { LogHelper.debug("Reading ClientLauncher params"); Params params; ClientProfile profile; - SignedObjectHolder assetHDir, clientHDir; + HashedDir assetHDir, clientHDir; RSAPublicKey publicKey = Launcher.getConfig().publicKey; try { try (Socket socket = IOHelper.newSocket()) { @@ -421,8 +421,8 @@ public static void main(String... args) throws Throwable { profile = gson.fromJson(input.readString(0), ClientProfile.class); // Read hdirs - assetHDir = new SignedObjectHolder<>(input, publicKey, HashedDir::new); - clientHDir = new SignedObjectHolder<>(input, publicKey, HashedDir::new); + assetHDir = new HashedDir(input); + clientHDir = new HashedDir(input); } } } catch (IOException ex) { @@ -457,18 +457,17 @@ public static void main(String... args) throws Throwable { LogHelper.debug("Starting JVM and client WatchService"); FileNameMatcher assetMatcher = profile.getAssetUpdateMatcher(); FileNameMatcher clientMatcher = profile.getClientUpdateMatcher(); - try (DirWatcher assetWatcher = new DirWatcher(params.assetDir, assetHDir.object, assetMatcher, digest); - DirWatcher clientWatcher = new DirWatcher(params.clientDir, clientHDir.object, clientMatcher, digest)) { + try (DirWatcher assetWatcher = new DirWatcher(params.assetDir, assetHDir, assetMatcher, digest); + DirWatcher clientWatcher = new DirWatcher(params.clientDir, clientHDir, clientMatcher, digest)) { // Verify current state of all dirs //verifyHDir(IOHelper.JVM_DIR, jvmHDir.object, null, digest); - HashedDir hdir = clientHDir.object; //for (OptionalFile s : Launcher.profile.getOptional()) { // if (params.updateOptional.contains(s)) s.mark = true; // else hdir.removeR(s.file); //} - Launcher.profile.pushOptionalFile(hdir,false); - verifyHDir(params.assetDir, assetHDir.object, assetMatcher, digest); - verifyHDir(params.clientDir, hdir, clientMatcher, digest); + Launcher.profile.pushOptionalFile(clientHDir,false); + verifyHDir(params.assetDir, assetHDir, assetMatcher, digest); + verifyHDir(params.clientDir, clientHDir, clientMatcher, digest); Launcher.modulesManager.postInitModules(); // Start WatchService, and only then client CommonHelper.newThread("Asset Directory Watcher", true, assetWatcher).start();