[FIX] Фикс launchClient

This commit is contained in:
Gravit 2019-02-20 18:30:14 +07:00
parent a738f75667
commit 66f773a8ce
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -298,7 +298,7 @@ private static void launch(ClientProfile profile, Params params) throws Throwabl
@LauncherAPI @LauncherAPI
public static Process launch( public static Process launch(
SignedObjectHolder<HashedDir> assetHDir, SignedObjectHolder<HashedDir> clientHDir, HashedDir assetHDir, HashedDir clientHDir,
ClientProfile profile, Params params, boolean pipeOutput) throws Throwable { ClientProfile profile, Params params, boolean pipeOutput) throws Throwable {
// Write params file (instead of CLI; Mustdie32 API can't handle command line > 32767 chars) // Write params file (instead of CLI; Mustdie32 API can't handle command line > 32767 chars)
LogHelper.debug("Writing ClientLauncher params"); LogHelper.debug("Writing ClientLauncher params");
@ -478,7 +478,7 @@ public static void main(String... args) throws Throwable {
} }
@LauncherAPI @LauncherAPI
public void launchLocal(SignedObjectHolder<HashedDir> assetHDir, SignedObjectHolder<HashedDir> clientHDir, public void launchLocal(HashedDir assetHDir, HashedDir clientHDir,
ClientProfile profile, Params params) throws Throwable { ClientProfile profile, Params params) throws Throwable {
RSAPublicKey publicKey = Launcher.getConfig().publicKey; RSAPublicKey publicKey = Launcher.getConfig().publicKey;
LogHelper.debug("Verifying ClientLauncher sign and classpath"); LogHelper.debug("Verifying ClientLauncher sign and classpath");
@ -497,17 +497,17 @@ public void launchLocal(SignedObjectHolder<HashedDir> assetHDir, SignedObjectHol
LogHelper.debug("Starting JVM and client WatchService"); LogHelper.debug("Starting JVM and client WatchService");
FileNameMatcher assetMatcher = profile.getAssetUpdateMatcher(); FileNameMatcher assetMatcher = profile.getAssetUpdateMatcher();
FileNameMatcher clientMatcher = profile.getClientUpdateMatcher(); FileNameMatcher clientMatcher = profile.getClientUpdateMatcher();
try (DirWatcher assetWatcher = new DirWatcher(params.assetDir, assetHDir.object, assetMatcher, digest); try (DirWatcher assetWatcher = new DirWatcher(params.assetDir, assetHDir, assetMatcher, digest);
DirWatcher clientWatcher = new DirWatcher(params.clientDir, clientHDir.object, clientMatcher, digest)) { DirWatcher clientWatcher = new DirWatcher(params.clientDir, clientHDir, clientMatcher, digest)) {
// Verify current state of all dirs // Verify current state of all dirs
//verifyHDir(IOHelper.JVM_DIR, jvmHDir.object, null, digest); //verifyHDir(IOHelper.JVM_DIR, jvmHDir.object, null, digest);
HashedDir hdir = clientHDir.object; HashedDir hdir = clientHDir;
//for (OptionalFile s : Launcher.profile.getOptional()) { //for (OptionalFile s : Launcher.profile.getOptional()) {
// if (params.updateOptional.contains(s)) s.mark = true; // if (params.updateOptional.contains(s)) s.mark = true;
// else hdir.removeR(s.file); // else hdir.removeR(s.file);
//} //}
Launcher.profile.pushOptionalFile(hdir,false); Launcher.profile.pushOptionalFile(hdir,false);
verifyHDir(params.assetDir, assetHDir.object, assetMatcher, digest); verifyHDir(params.assetDir, assetHDir, assetMatcher, digest);
verifyHDir(params.clientDir, hdir, clientMatcher, digest); verifyHDir(params.clientDir, hdir, clientMatcher, digest);
Launcher.modulesManager.postInitModules(); Launcher.modulesManager.postInitModules();
// Start WatchService, and only then client // Start WatchService, and only then client