mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FIX] Игнорируем Overflow (возможен на тяжёлых сборках).
This commit is contained in:
parent
6f22ae3c7d
commit
f4dcd99639
4 changed files with 9 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
import pro.gravit.launcher.client.ClientLauncher;
|
import pro.gravit.launcher.client.ClientLauncher;
|
||||||
import pro.gravit.launcher.client.ClientModuleManager;
|
import pro.gravit.launcher.client.ClientModuleManager;
|
||||||
import pro.gravit.launcher.client.DirBridge;
|
import pro.gravit.launcher.client.DirBridge;
|
||||||
|
import pro.gravit.launcher.utils.DirWatcher;
|
||||||
import pro.gravit.utils.helper.EnvHelper;
|
import pro.gravit.utils.helper.EnvHelper;
|
||||||
import pro.gravit.utils.helper.IOHelper;
|
import pro.gravit.utils.helper.IOHelper;
|
||||||
import pro.gravit.utils.helper.JVMHelper;
|
import pro.gravit.utils.helper.JVMHelper;
|
||||||
|
@ -59,6 +60,7 @@ public static void main(String[] arguments) throws IOException, InterruptedExcep
|
||||||
JVMHelper.addSystemPropertyToArgs(args, DirBridge.CUSTOMDIR_PROPERTY);
|
JVMHelper.addSystemPropertyToArgs(args, DirBridge.CUSTOMDIR_PROPERTY);
|
||||||
JVMHelper.addSystemPropertyToArgs(args, DirBridge.USE_CUSTOMDIR_PROPERTY);
|
JVMHelper.addSystemPropertyToArgs(args, DirBridge.USE_CUSTOMDIR_PROPERTY);
|
||||||
JVMHelper.addSystemPropertyToArgs(args, DirBridge.USE_OPTDIR_PROPERTY);
|
JVMHelper.addSystemPropertyToArgs(args, DirBridge.USE_OPTDIR_PROPERTY);
|
||||||
|
JVMHelper.addSystemPropertyToArgs(args, DirWatcher.IGN_OVERFLOW);
|
||||||
if (!noJava9check && !System.getProperty("java.version").startsWith("1.8")) {
|
if (!noJava9check && !System.getProperty("java.version").startsWith("1.8")) {
|
||||||
LogHelper.debug("Found Java 9+ ( %s )", System.getProperty("java.version"));
|
LogHelper.debug("Found Java 9+ ( %s )", System.getProperty("java.version"));
|
||||||
args.add("--add-modules");
|
args.add("--add-modules");
|
||||||
|
|
|
@ -351,6 +351,7 @@ public static Process launch(
|
||||||
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.CUSTOMDIR_PROPERTY);
|
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.CUSTOMDIR_PROPERTY);
|
||||||
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.USE_CUSTOMDIR_PROPERTY);
|
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.USE_CUSTOMDIR_PROPERTY);
|
||||||
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.USE_OPTDIR_PROPERTY);
|
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.USE_OPTDIR_PROPERTY);
|
||||||
|
JVMHelper.addSystemPropertyToArgs(context.args, DirWatcher.IGN_OVERFLOW);
|
||||||
if (JVMHelper.OS_TYPE == OS.MUSTDIE) {
|
if (JVMHelper.OS_TYPE == OS.MUSTDIE) {
|
||||||
if (JVMHelper.OS_VERSION.startsWith("10.")) {
|
if (JVMHelper.OS_VERSION.startsWith("10.")) {
|
||||||
LogHelper.debug("MustDie 10 fix is applied");
|
LogHelper.debug("MustDie 10 fix is applied");
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
import pro.gravit.launcher.hasher.HashedDir;
|
import pro.gravit.launcher.hasher.HashedDir;
|
||||||
import pro.gravit.launcher.managers.ClientHookManager;
|
import pro.gravit.launcher.managers.ClientHookManager;
|
||||||
import pro.gravit.launcher.profiles.ClientProfile;
|
import pro.gravit.launcher.profiles.ClientProfile;
|
||||||
|
import pro.gravit.launcher.utils.DirWatcher;
|
||||||
import pro.gravit.utils.helper.EnvHelper;
|
import pro.gravit.utils.helper.EnvHelper;
|
||||||
import pro.gravit.utils.helper.IOHelper;
|
import pro.gravit.utils.helper.IOHelper;
|
||||||
import pro.gravit.utils.helper.JVMHelper;
|
import pro.gravit.utils.helper.JVMHelper;
|
||||||
|
@ -99,6 +100,7 @@ public ClientLauncherContext build() throws IOException {
|
||||||
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.CUSTOMDIR_PROPERTY);
|
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.CUSTOMDIR_PROPERTY);
|
||||||
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.USE_CUSTOMDIR_PROPERTY);
|
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.USE_CUSTOMDIR_PROPERTY);
|
||||||
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.USE_OPTDIR_PROPERTY);
|
JVMHelper.addSystemPropertyToArgs(context.args, DirBridge.USE_OPTDIR_PROPERTY);
|
||||||
|
JVMHelper.addSystemPropertyToArgs(context.args, DirWatcher.IGN_OVERFLOW);
|
||||||
if (JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE) {
|
if (JVMHelper.OS_TYPE == JVMHelper.OS.MUSTDIE) {
|
||||||
if (JVMHelper.OS_VERSION.startsWith("10.")) {
|
if (JVMHelper.OS_VERSION.startsWith("10.")) {
|
||||||
LogHelper.debug("MustDie 10 fix is applied");
|
LogHelper.debug("MustDie 10 fix is applied");
|
||||||
|
|
|
@ -46,6 +46,9 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th
|
||||||
StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE
|
StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.ENTRY_DELETE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static final String IGN_OVERFLOW = "launcher.dirwatcher.ignoreOverflows";
|
||||||
|
private static final boolean PROP_IGN_OVERFLOW = Boolean.getBoolean(IGN_OVERFLOW);
|
||||||
|
|
||||||
private static void handleError(Throwable e) {
|
private static void handleError(Throwable e) {
|
||||||
LogHelper.error(e);
|
LogHelper.error(e);
|
||||||
NativeJVMHalt.haltA(-123);
|
NativeJVMHalt.haltA(-123);
|
||||||
|
@ -82,7 +85,6 @@ public DirWatcher(Path dir, HashedDir hdir, FileNameMatcher matcher, boolean dig
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
service.close();
|
service.close();
|
||||||
}
|
}
|
||||||
|
@ -92,7 +94,7 @@ private void processKey(WatchKey key) throws IOException {
|
||||||
for (WatchEvent<?> event : key.pollEvents()) {
|
for (WatchEvent<?> event : key.pollEvents()) {
|
||||||
Kind<?> kind = event.kind();
|
Kind<?> kind = event.kind();
|
||||||
if (kind.equals(StandardWatchEventKinds.OVERFLOW)) {
|
if (kind.equals(StandardWatchEventKinds.OVERFLOW)) {
|
||||||
if (Boolean.getBoolean("launcher.dirwatcher.ignoreOverflows"))
|
if (PROP_IGN_OVERFLOW)
|
||||||
continue; // Sometimes it's better to ignore than interrupt fair playing
|
continue; // Sometimes it's better to ignore than interrupt fair playing
|
||||||
throw new IOException("Overflow");
|
throw new IOException("Overflow");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue