mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
Полностью отключены СlientParams*.bin
This commit is contained in:
parent
5fc4b01b8a
commit
1115935a3a
1 changed files with 15 additions and 33 deletions
|
@ -293,11 +293,11 @@ public static Process launch(
|
||||||
SignedObjectHolder<ClientProfile> profile, Params params, boolean pipeOutput) throws Throwable {
|
SignedObjectHolder<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");
|
||||||
Path paramsFile = Files.createTempFile("ClientLauncherParams", ".bin");
|
|
||||||
CommonHelper.newThread("Client params writter", false, () ->
|
CommonHelper.newThread("Client params writter", false, () ->
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
try (ServerSocket socket = new ServerSocket()) {
|
try (ServerSocket socket = new ServerSocket()) {
|
||||||
|
|
||||||
socket.setReuseAddress(true);
|
socket.setReuseAddress(true);
|
||||||
socket.bind(new InetSocketAddress(SOCKET_HOST, SOCKET_PORT));
|
socket.bind(new InetSocketAddress(SOCKET_HOST, SOCKET_PORT));
|
||||||
Socket client = socket.accept();
|
Socket client = socket.accept();
|
||||||
|
@ -307,17 +307,11 @@ public static Process launch(
|
||||||
assetHDir.write(output);
|
assetHDir.write(output);
|
||||||
clientHDir.write(output);
|
clientHDir.write(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (IOException e) {
|
||||||
LogHelper.error(e);
|
LogHelper.error(e);
|
||||||
try (HOutput output = new HOutput(IOHelper.newOutput(paramsFile))) {
|
|
||||||
params.write(output);
|
|
||||||
profile.write(output);
|
|
||||||
assetHDir.write(output);
|
|
||||||
clientHDir.write(output);
|
|
||||||
} catch (IOException e1) {
|
|
||||||
LogHelper.error(e1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
// Resolve java bin and set permissions
|
// Resolve java bin and set permissions
|
||||||
|
@ -362,7 +356,6 @@ public static Process launch(
|
||||||
//if(wrapper)
|
//if(wrapper)
|
||||||
//Collections.addAll(args, "-Djava.class.path=".concat(classPathString.toString())); // Add Class Path
|
//Collections.addAll(args, "-Djava.class.path=".concat(classPathString.toString())); // Add Class Path
|
||||||
Collections.addAll(args, ClientLauncher.class.getName());
|
Collections.addAll(args, ClientLauncher.class.getName());
|
||||||
Collections.addAll(args, paramsFile.toString());
|
|
||||||
|
|
||||||
// Print commandline debug message
|
// Print commandline debug message
|
||||||
LogHelper.debug("Commandline: " + args);
|
LogHelper.debug("Commandline: " + args);
|
||||||
|
@ -397,9 +390,6 @@ public static void main(String... args) throws Throwable {
|
||||||
checkJVMBitsAndVersion();
|
checkJVMBitsAndVersion();
|
||||||
JVMHelper.verifySystemProperties(ClientLauncher.class, true);
|
JVMHelper.verifySystemProperties(ClientLauncher.class, true);
|
||||||
LogHelper.printVersion("Client Launcher");
|
LogHelper.printVersion("Client Launcher");
|
||||||
// Resolve params file
|
|
||||||
VerifyHelper.verifyInt(args.length, l -> l >= 1, "Missing args: <paramsFile>");
|
|
||||||
Path paramsFile = IOHelper.toPath(args[0]);
|
|
||||||
// Read and delete params file
|
// Read and delete params file
|
||||||
LogHelper.debug("Reading ClientLauncher params");
|
LogHelper.debug("Reading ClientLauncher params");
|
||||||
Params params;
|
Params params;
|
||||||
|
@ -420,16 +410,8 @@ public static void main(String... args) throws Throwable {
|
||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
LogHelper.error(ex);
|
LogHelper.error(ex);
|
||||||
try (HInput input = new HInput(IOHelper.newInput(paramsFile))) {
|
System.exit(-98);
|
||||||
params = new Params(input);
|
return;
|
||||||
profile = new SignedObjectHolder<>(input, publicKey, ClientProfile.RO_ADAPTER);
|
|
||||||
|
|
||||||
// Read hdirs
|
|
||||||
assetHDir = new SignedObjectHolder<>(input, publicKey, HashedDir::new);
|
|
||||||
clientHDir = new SignedObjectHolder<>(input, publicKey, HashedDir::new);
|
|
||||||
} finally {
|
|
||||||
Files.delete(paramsFile);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Launcher.profile = profile.object;
|
Launcher.profile = profile.object;
|
||||||
Launcher.modulesManager.initModules();
|
Launcher.modulesManager.initModules();
|
||||||
|
|
Loading…
Reference in a new issue