From 92a253eb829c943c6815b3ada5b56a33d8655484 Mon Sep 17 00:00:00 2001 From: Gravit Date: Thu, 27 Dec 2018 16:31:29 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D0=BA=D1=80=D0=B0?= =?UTF-8?q?=D1=88=D0=B0=20=D0=BA=D0=BB=D0=B8=D0=B5=D0=BD=D1=82=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B8=20=D0=B4=D0=BB=D0=B8=D0=BD?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20skinURL/cloakURL=20=D0=B8=D0=BB=D0=B8=20%u?= =?UTF-8?q?uid%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launcher/client/ClientLauncher.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java index 5198561b..ed888a74 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ClientLauncher.java @@ -2,6 +2,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonObject; import ru.gravit.launcher.*; 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 RESOURCEPACKS_DIR = IOHelper.toPath("resourcepacks"); private static PublicURLClassLoader classLoader; - + public static class ClientUserProperties + { + String[] skinURL; + String[] skinDigest; + String[] cloakURL; + String[] cloakDigest; + } private static void addClientArgs(Collection args, ClientProfile profile, Params params) { PlayerProfile pp = params.pp; @@ -183,14 +190,14 @@ private static void addClientArgs(Collection args, ClientProfile profile if (version.compareTo(ClientProfile.Version.MC1710) >= 0) { // Add user properties Collections.addAll(args, "--userType", "mojang"); - JsonObject properties = new JsonObject(); + ClientUserProperties properties = new ClientUserProperties(); if (pp.skin != null) { - properties.addProperty(Launcher.SKIN_URL_PROPERTY, pp.skin.url); - properties.addProperty(Launcher.SKIN_DIGEST_PROPERTY, SecurityHelper.toHex(pp.skin.digest)); + properties.skinURL = new String[]{pp.skin.url}; + properties.skinDigest = new String[]{SecurityHelper.toHex(pp.skin.digest)}; } if (pp.cloak != null) { - properties.addProperty(Launcher.CLOAK_URL_PROPERTY, pp.cloak.url); - properties.addProperty(Launcher.CLOAK_DIGEST_PROPERTY, SecurityHelper.toHex(pp.cloak.digest)); + properties.cloakURL = new String[]{pp.cloak.url}; + properties.cloakDigest = new String[]{SecurityHelper.toHex(pp.cloak.digest)}; } Collections.addAll(args, "--userProperties", ClientLauncher.gson.toJson(properties));