mirror of
https://github.com/GravitLauncher/Launcher
synced 2025-07-01 21:48:09 +03:00
Compare commits
No commits in common. "5c374462effbdbb83bcb9b8b760649ca83158abc" and "ebf25a65f7aced4527b2b60fbde472fb921bdc52" have entirely different histories.
5c374462ef
...
ebf25a65f7
6 changed files with 8 additions and 41 deletions
|
@ -1,6 +1,5 @@
|
||||||
package pro.gravit.launcher.client;
|
package pro.gravit.launcher.client;
|
||||||
|
|
||||||
import com.google.gson.JsonElement;
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import pro.gravit.launcher.profiles.ClientProfile;
|
import pro.gravit.launcher.profiles.ClientProfile;
|
||||||
|
@ -163,13 +162,9 @@ private Result modernPing(HInput input, HOutput output) throws IOException {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse JSON response
|
// Parse JSON response
|
||||||
JsonElement element = JsonParser.parseString(response);
|
JsonObject object = JsonParser.parseString(response).getAsJsonObject();
|
||||||
if(element.isJsonPrimitive()) {
|
|
||||||
throw new IOException(element.getAsString());
|
|
||||||
}
|
|
||||||
JsonObject object = element.getAsJsonObject();
|
|
||||||
if (object.has("error")) {
|
if (object.has("error")) {
|
||||||
throw new IOException(object.get("error").getAsString()); // May be not needed?
|
throw new IOException(object.get("error").getAsString());
|
||||||
}
|
}
|
||||||
JsonObject playersObject = object.get("players").getAsJsonObject();
|
JsonObject playersObject = object.get("players").getAsJsonObject();
|
||||||
int online = playersObject.get("online").getAsInt();
|
int online = playersObject.get("online").getAsInt();
|
||||||
|
|
|
@ -27,21 +27,6 @@ public OptionalView(OptionalView view) {
|
||||||
this.all = view.all;
|
this.all = view.all;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OptionalView(ClientProfile profile, OptionalView old) {
|
|
||||||
this(profile);
|
|
||||||
for(OptionalFile oldFile : old.all) {
|
|
||||||
OptionalFile newFile = findByName(oldFile.name);
|
|
||||||
if(newFile == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if(old.isEnabled(oldFile)) {
|
|
||||||
enable(newFile, old.installInfo.get(oldFile).isManual, (file, status) -> {});
|
|
||||||
} else {
|
|
||||||
disable(newFile, (file, status) -> {});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public <T extends OptionalAction> Set<T> getActionsByClass(Class<T> clazz) {
|
public <T extends OptionalAction> Set<T> getActionsByClass(Class<T> clazz) {
|
||||||
Set<T> results = new HashSet<>();
|
Set<T> results = new HashSet<>();
|
||||||
|
@ -57,19 +42,6 @@ public <T extends OptionalAction> Set<T> getActionsByClass(Class<T> clazz) {
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
public OptionalFile findByName(String name) {
|
|
||||||
for(OptionalFile file : all) {
|
|
||||||
if(name.equals(file.name)) {
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnabled(OptionalFile file) {
|
|
||||||
return enabled.contains(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<OptionalAction> getEnabledActions() {
|
public Set<OptionalAction> getEnabledActions() {
|
||||||
Set<OptionalAction> results = new HashSet<>();
|
Set<OptionalAction> results = new HashSet<>();
|
||||||
for (OptionalFile e : enabled) {
|
for (OptionalFile e : enabled) {
|
||||||
|
|
|
@ -6,9 +6,9 @@ public final class Version implements Comparable<Version> {
|
||||||
|
|
||||||
public static final int MAJOR = 5;
|
public static final int MAJOR = 5;
|
||||||
public static final int MINOR = 3;
|
public static final int MINOR = 3;
|
||||||
public static final int PATCH = 6;
|
public static final int PATCH = 5;
|
||||||
public static final int BUILD = 1;
|
public static final int BUILD = 1;
|
||||||
public static final Version.Type RELEASE = Type.DEV;
|
public static final Version.Type RELEASE = Type.STABLE;
|
||||||
public final int major;
|
public final int major;
|
||||||
public final int minor;
|
public final int minor;
|
||||||
public final int patch;
|
public final int patch;
|
||||||
|
|
|
@ -64,7 +64,7 @@ pack project(':LauncherAPI')
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
duplicatesStrategy = 'EXCLUDE'
|
duplicatesStrategy = 'EXCLUDE'
|
||||||
archiveClassifier = null
|
classifier = null
|
||||||
relocate 'io.netty', 'pro.gravit.repackage.io.netty'
|
relocate 'io.netty', 'pro.gravit.repackage.io.netty'
|
||||||
configurations = [project.configurations.pack]
|
configurations = [project.configurations.pack]
|
||||||
exclude 'module-info.class'
|
exclude 'module-info.class'
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
|
id 'com.github.johnrengelman.shadow' version '5.2.0' apply false
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'signing'
|
id 'signing'
|
||||||
id 'org.openjfx.javafxplugin' version '0.0.10' apply false
|
id 'org.openjfx.javafxplugin' version '0.0.10' apply false
|
||||||
}
|
}
|
||||||
group = 'pro.gravit.launcher'
|
group = 'pro.gravit.launcher'
|
||||||
version = '5.3.6-SNAPSHOT'
|
version = '5.3.5'
|
||||||
|
|
||||||
apply from: 'props.gradle'
|
apply from: 'props.gradle'
|
||||||
|
|
||||||
|
|
2
modules
2
modules
|
@ -1 +1 @@
|
||||||
Subproject commit 0fbbc50f875b477078d61de2135b8d3600851ebe
|
Subproject commit c0d181172391f9540f1477407daab7499974fa2a
|
Loading…
Reference in a new issue