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 6b9944c1..7c1dfcbe 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -350,8 +350,6 @@ public static Process launch( JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.CUSTOMDIR_PROPERTY); JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.USE_CUSTOMDIR_PROPERTY); JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.USE_OPTDIR_PROPERTY); - if (LauncherConfig.ADDRESS_OVERRIDE != null) - context.args.add(JVMHelper.jvmProperty(LauncherConfig.ADDRESS_OVERRIDE_PROPERTY, LauncherConfig.ADDRESS_OVERRIDE)); if (JVMHelper.OS_TYPE == OS.MUSTDIE) { if (JVMHelper.OS_VERSION.startsWith("10.")) { LogHelper.debug("MustDie 10 fix is applied"); @@ -477,46 +475,6 @@ public static void main(String... args) throws Throwable { } } - @LauncherAPI - public void launchLocal(HashedDir assetHDir, HashedDir clientHDir, - ClientProfile profile, Params params) throws Throwable { - RSAPublicKey publicKey = Launcher.getConfig().publicKey; - LogHelper.debug("Verifying ClientLauncher sign and classpath"); - SecurityHelper.verifySign(LegacyLauncherRequest.BINARY_PATH, params.launcherDigest, publicKey); - LinkedList classPath = resolveClassPathList(params.clientDir, profile.getClassPath()); - for (Path classpathURL : classPath) { - LauncherAgent.addJVMClassPath(classpathURL.toAbsolutePath().toString()); - } - URL[] classpathurls = resolveClassPath(params.clientDir, profile.getClassPath()); - classLoader = new PublicURLClassLoader(classpathurls, ClassLoader.getSystemClassLoader()); - Thread.currentThread().setContextClassLoader(classLoader); - classLoader.nativePath = params.clientDir.resolve(NATIVES_DIR).toString(); - PublicURLClassLoader.systemclassloader = classLoader; - // Start client with WatchService monitoring - boolean digest = !profile.isUpdateFastCheck(); - LogHelper.debug("Starting JVM and client WatchService"); - FileNameMatcher assetMatcher = profile.getAssetUpdateMatcher(); - FileNameMatcher clientMatcher = profile.getClientUpdateMatcher(); - 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; - //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, assetMatcher, digest); - verifyHDir(params.clientDir, hdir, clientMatcher, digest); - Launcher.modulesManager.postInitModules(); - // Start WatchService, and only then client - CommonHelper.newThread("Asset Directory Watcher", true, assetWatcher).start(); - CommonHelper.newThread("Client Directory Watcher", true, clientWatcher).start(); - launch(profile, params); - } - } - private static URL[] resolveClassPath(Path clientDir, String... classPath) throws IOException { Collection result = new LinkedList<>(); for (String classPathEntry : classPath) { diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java index 11777930..222a6c3c 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LauncherRequest.java @@ -41,8 +41,6 @@ public static void update(LauncherConfig config, LauncherRequestEvent result) th args.add(IOHelper.resolveJavaBin(null).toString()); if (LogHelper.isDebugEnabled()) args.add(JVMHelper.jvmProperty(LogHelper.DEBUG_PROPERTY, Boolean.toString(LogHelper.isDebugEnabled()))); - if (LauncherConfig.ADDRESS_OVERRIDE != null) - args.add(JVMHelper.jvmProperty(LauncherConfig.ADDRESS_OVERRIDE_PROPERTY, LauncherConfig.ADDRESS_OVERRIDE)); args.add("-jar"); args.add(BINARY_PATH.toString()); ProcessBuilder builder = new ProcessBuilder(args.toArray(new String[0])); diff --git a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LegacyLauncherRequest.java b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LegacyLauncherRequest.java index 30d643b1..c2a089ef 100644 --- a/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LegacyLauncherRequest.java +++ b/LauncherAPI/src/main/java/ru/gravit/launcher/request/update/LegacyLauncherRequest.java @@ -61,8 +61,6 @@ public static void update(LauncherConfig config, Result result) throws Signature args.add(IOHelper.resolveJavaBin(null).toString()); if (LogHelper.isDebugEnabled()) args.add(JVMHelper.jvmProperty(LogHelper.DEBUG_PROPERTY, Boolean.toString(LogHelper.isDebugEnabled()))); - if (LauncherConfig.ADDRESS_OVERRIDE != null) - args.add(JVMHelper.jvmProperty(LauncherConfig.ADDRESS_OVERRIDE_PROPERTY, LauncherConfig.ADDRESS_OVERRIDE)); args.add("-jar"); args.add(BINARY_PATH.toString()); ProcessBuilder builder = new ProcessBuilder(args.toArray(new String[0])); diff --git a/libLauncher/src/main/java/ru/gravit/launcher/LauncherConfig.java b/libLauncher/src/main/java/ru/gravit/launcher/LauncherConfig.java index 77dfebdc..82adbf6a 100644 --- a/libLauncher/src/main/java/ru/gravit/launcher/LauncherConfig.java +++ b/libLauncher/src/main/java/ru/gravit/launcher/LauncherConfig.java @@ -14,10 +14,6 @@ import java.util.*; public final class LauncherConfig extends StreamObject { - @LauncherAPI - public static final String ADDRESS_OVERRIDE_PROPERTY = "launcher.addressOverride"; - @LauncherAPI - public static final String ADDRESS_OVERRIDE = System.getProperty(ADDRESS_OVERRIDE_PROPERTY, null); private static final AutogenConfig config = new AutogenConfig(); @@ -51,9 +47,7 @@ public static AutogenConfig getAutogenConfig() { @LauncherAPI public LauncherConfig(HInput input) throws IOException, InvalidKeySpecException { - String localAddress = config.address; - address = InetSocketAddress.createUnresolved( - ADDRESS_OVERRIDE == null ? localAddress : ADDRESS_OVERRIDE, config.port); + address = InetSocketAddress.createUnresolved( config.address, config.port); publicKey = SecurityHelper.toPublicRSAKey(input.readByteArray(SecurityHelper.CRYPTO_MAX_LENGTH)); projectname = config.projectname; clientPort = config.clientPort; @@ -84,10 +78,6 @@ public LauncherConfig(HInput input) throws IOException, InvalidKeySpecException String.format("Duplicate runtime resource: '%s'", name)); } runtime = Collections.unmodifiableMap(localResources); - - // Print warning if address override is enabled - if (ADDRESS_OVERRIDE != null) - LogHelper.warning("Address override is enabled: '%s'", ADDRESS_OVERRIDE); } @LauncherAPI