mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 09:01:08 +03:00
Фикс краша клиента при использовании длинных skinURL/cloakURL или %uuid%
This commit is contained in:
parent
edf6adafe0
commit
92a253eb82
1 changed files with 13 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.JsonArray;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import ru.gravit.launcher.*;
|
import ru.gravit.launcher.*;
|
||||||
import ru.gravit.launcher.hasher.DirWatcher;
|
import ru.gravit.launcher.hasher.DirWatcher;
|
||||||
|
@ -168,7 +169,13 @@ public void write(HOutput output) throws IOException {
|
||||||
private static final Path NATIVES_DIR = IOHelper.toPath("natives");
|
private static final Path NATIVES_DIR = IOHelper.toPath("natives");
|
||||||
private static final Path RESOURCEPACKS_DIR = IOHelper.toPath("resourcepacks");
|
private static final Path RESOURCEPACKS_DIR = IOHelper.toPath("resourcepacks");
|
||||||
private static PublicURLClassLoader classLoader;
|
private static PublicURLClassLoader classLoader;
|
||||||
|
public static class ClientUserProperties
|
||||||
|
{
|
||||||
|
String[] skinURL;
|
||||||
|
String[] skinDigest;
|
||||||
|
String[] cloakURL;
|
||||||
|
String[] cloakDigest;
|
||||||
|
}
|
||||||
private static void addClientArgs(Collection<String> args, ClientProfile profile, Params params) {
|
private static void addClientArgs(Collection<String> args, ClientProfile profile, Params params) {
|
||||||
PlayerProfile pp = params.pp;
|
PlayerProfile pp = params.pp;
|
||||||
|
|
||||||
|
@ -183,14 +190,14 @@ private static void addClientArgs(Collection<String> args, ClientProfile profile
|
||||||
if (version.compareTo(ClientProfile.Version.MC1710) >= 0) {
|
if (version.compareTo(ClientProfile.Version.MC1710) >= 0) {
|
||||||
// Add user properties
|
// Add user properties
|
||||||
Collections.addAll(args, "--userType", "mojang");
|
Collections.addAll(args, "--userType", "mojang");
|
||||||
JsonObject properties = new JsonObject();
|
ClientUserProperties properties = new ClientUserProperties();
|
||||||
if (pp.skin != null) {
|
if (pp.skin != null) {
|
||||||
properties.addProperty(Launcher.SKIN_URL_PROPERTY, pp.skin.url);
|
properties.skinURL = new String[]{pp.skin.url};
|
||||||
properties.addProperty(Launcher.SKIN_DIGEST_PROPERTY, SecurityHelper.toHex(pp.skin.digest));
|
properties.skinDigest = new String[]{SecurityHelper.toHex(pp.skin.digest)};
|
||||||
}
|
}
|
||||||
if (pp.cloak != null) {
|
if (pp.cloak != null) {
|
||||||
properties.addProperty(Launcher.CLOAK_URL_PROPERTY, pp.cloak.url);
|
properties.cloakURL = new String[]{pp.cloak.url};
|
||||||
properties.addProperty(Launcher.CLOAK_DIGEST_PROPERTY, SecurityHelper.toHex(pp.cloak.digest));
|
properties.cloakDigest = new String[]{SecurityHelper.toHex(pp.cloak.digest)};
|
||||||
}
|
}
|
||||||
Collections.addAll(args, "--userProperties", ClientLauncher.gson.toJson(properties));
|
Collections.addAll(args, "--userProperties", ClientLauncher.gson.toJson(properties));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue