diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java b/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java index e7720f4c..5eb20ad1 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/components/Component.java @@ -6,7 +6,7 @@ public abstract class Component { public static final ProviderMap providers = new ProviderMap<>(); private static boolean registredComp = false; - protected String componentName; + protected transient String componentName; public static void registerComponents() { if (!registredComp) { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java b/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java index b48e89b2..78f63344 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/components/ProGuardComponent.java @@ -174,7 +174,7 @@ public static class ProguardConf { "-libraryjars '/lib/ext/nashorn.jar'", "-libraryjars '/lib/ext/jfxrt.jar'" }; - private static final char[] chars = "1aAbBcC2dDeEfF3gGhHiI4jJkKl5mMnNoO6pPqQrR7sStT8uUvV9wWxX0yYzZ".toCharArray(); + private static final char[] chars = "1aAbBcC2dDeEfF3gGhHiI4jJkKlL5mMnNoO6pPqQrR7sStT8uUvV9wWxX0yYzZ".toCharArray(); public final Path proguard; public final Path config; public final Path mappings; diff --git a/Launcher/src/main/java/pro/gravit/launcher/client/ServerPinger.java b/Launcher/src/main/java/pro/gravit/launcher/client/ServerPinger.java index 07d9a1d9..c798f3d3 100644 --- a/Launcher/src/main/java/pro/gravit/launcher/client/ServerPinger.java +++ b/Launcher/src/main/java/pro/gravit/launcher/client/ServerPinger.java @@ -158,7 +158,7 @@ private Result modernPing(HInput input, HOutput output, int protocol) throws IOE if (statusPacketID != 0x0) throw new IOException("Illegal status packet ID: " + statusPacketID); response = packetInput.readString(PACKET_LENGTH); - LogHelper.debug("Ping response (modern): '%s'", response); + LogHelper.dev("Ping response (modern): '%s'", response); } // Parse JSON response diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java index b0265d08..36c533ee 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java @@ -254,6 +254,12 @@ public void updateOptionalGraph() { file.conflict[i] = getOptionalFile(file.conflictFile[i].name); } } + if(file.groupFile != null) { + file.group = new OptionalFile[file.groupFile.length]; + for(int i = 0; i < file.groupFile.length; ++i) { + file.group[i] = getOptionalFile(file.groupFile[i].name); + } + } } } @@ -369,6 +375,11 @@ public void verify() { if (s == null) throw new IllegalArgumentException(String.format("Found null entry in updateOptional.%s.dependenciesFile", f.name)); } + if(f.groupFile != null) + for (OptionalDepend s : f.groupFile) { + if (s == null) + throw new IllegalArgumentException(String.format("Found null entry in updateOptional.%s.groupFile", f.name)); + } if (f.triggersList != null) { for (OptionalTrigger trigger : f.triggersList) { if (trigger == null) diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java index a5ad4f25..bbe85fc9 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalFile.java @@ -24,10 +24,14 @@ public class OptionalFile { @LauncherNetworkAPI public OptionalDepend[] conflictFile; @LauncherNetworkAPI + public OptionalDepend[] groupFile; + @LauncherNetworkAPI public transient OptionalFile[] dependencies; @LauncherNetworkAPI public transient OptionalFile[] conflict; @LauncherNetworkAPI + public transient OptionalFile[] group; + @LauncherNetworkAPI public int subTreeLevel = 1; @LauncherNetworkAPI public boolean isPreset; diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalView.java b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalView.java index 658edd0b..25fdb266 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalView.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/optional/OptionalView.java @@ -7,7 +7,9 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import java.util.Arrays; import java.util.function.BiConsumer; +import java.util.stream.Collectors; public class OptionalView { public Set enabled = new HashSet<>(); @@ -25,6 +27,7 @@ public OptionalView(OptionalView view) { this.enabled = new HashSet<>(view.enabled); this.installInfo = new HashMap<>(view.installInfo); this.all = view.all; + fixDependencies(); } public OptionalView(ClientProfile profile, OptionalView old) { @@ -40,6 +43,7 @@ public OptionalView(ClientProfile profile, OptionalView old) { disable(newFile, (file, status) -> {}); } } + fixDependencies(); } @SuppressWarnings("unchecked") @@ -80,6 +84,33 @@ public Set getEnabledActions() { return results; } + //Needed if dependency/conflict was added after mod declaring it and clients have their profiles with this mod enabled + public void fixDependencies() { + Set disabled = all.stream().filter(t -> !isEnabled(t)).collect(Collectors.toSet()); + for (OptionalFile file : disabled) { + if (file.group != null && Arrays.stream(file.group).noneMatch(this::isEnabled)) { + enable(file.group[0], false, null); + } + } + for (OptionalFile file : enabled) { + if (file.dependencies != null) { + for (OptionalFile dep : file.dependencies) { + enable(dep, false, null); + } + } + if (file.conflict != null) { + for (OptionalFile conflict : file.conflict) { + disable(conflict, null); + } + } + if (file.group != null) { + for (OptionalFile member : file.group) { + disable(member, null); + } + } + } + } + public Set getDisabledActions() { Set results = new HashSet<>(); for (OptionalFile e : all) { @@ -111,6 +142,11 @@ public void enable(OptionalFile file, boolean manual, BiConsumer callback) { @@ -129,6 +165,11 @@ public void disable(OptionalFile file, BiConsumer callbac } } } + if (file.group != null && file.group.length != 0) { + if (Arrays.stream(file.group).noneMatch(this::isEnabled)) { + enable(file.group[0], false, callback); + } + } } private boolean contains(OptionalFile file, OptionalFile[] array) { diff --git a/LauncherCore/src/main/java/pro/gravit/utils/Version.java b/LauncherCore/src/main/java/pro/gravit/utils/Version.java index 8c0140e2..9251cf19 100644 --- a/LauncherCore/src/main/java/pro/gravit/utils/Version.java +++ b/LauncherCore/src/main/java/pro/gravit/utils/Version.java @@ -6,7 +6,7 @@ public final class Version implements Comparable { public static final int MAJOR = 5; public static final int MINOR = 4; - public static final int PATCH = 3; + public static final int PATCH = 4; public static final int BUILD = 1; public static final Version.Type RELEASE = Type.STABLE; public final int major; diff --git a/build.gradle b/build.gradle index d5cb3676..9b320def 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ id 'org.openjfx.javafxplugin' version '0.0.10' apply false } group = 'pro.gravit.launcher' -version = '5.4.3' +version = '5.4.4' apply from: 'props.gradle' diff --git a/modules b/modules index d20723ae..f6706567 160000 --- a/modules +++ b/modules @@ -1 +1 @@ -Subproject commit d20723ae0e41c7580560a4f9f402699dbce2ae4c +Subproject commit f6706567b4d02e802a3d285ca5d1fb0086b6799e