From 71018a0cdfc367bb5a01ff6afcf506276c137d4b Mon Sep 17 00:00:00 2001 From: Gravit Date: Thu, 5 Dec 2019 01:35:36 +0700 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20UUID=20=D0=B2=20ClientProfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/hash/DownloadClientCommand.java | 2 ++ .../pro/gravit/launcher/profiles/ClientProfile.java | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java index 54b3f738..ef403ecc 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/command/hash/DownloadClientCommand.java @@ -15,6 +15,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.Collections; +import java.util.UUID; public final class DownloadClientCommand extends Command { @@ -61,6 +62,7 @@ public void invoke(String... args) throws IOException, CommandException { } client.setTitle(dirName); client.setDir(dirName); + client.setUUID(UUID.randomUUID()); try (BufferedWriter writer = IOHelper.newWriter(IOHelper.resolveIncremental(server.profilesDir, dirName, "json"))) { Launcher.gsonManager.configGson.toJson(client, writer); 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 8ef8ea5f..3530d993 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/profiles/ClientProfile.java @@ -86,6 +86,8 @@ public String toString() { @LauncherAPI private int sortIndex; @LauncherAPI + private UUID uuid; + @LauncherAPI private String title; @LauncherAPI private String info; @@ -384,11 +386,19 @@ public void setVersion(Version version) { this.version = version.name; } + public void setUUID(UUID uuid) { + this.uuid = uuid; + } + @Override public String toString() { return title; } + public UUID getUUID() { + return uuid; + } + @LauncherAPI public void verify() { // Version