mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] UUID в ClientProfile
This commit is contained in:
parent
4136f4a6e8
commit
71018a0cdf
2 changed files with 12 additions and 0 deletions
|
@ -15,6 +15,7 @@
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public final class DownloadClientCommand extends Command {
|
public final class DownloadClientCommand extends Command {
|
||||||
|
|
||||||
|
@ -61,6 +62,7 @@ public void invoke(String... args) throws IOException, CommandException {
|
||||||
}
|
}
|
||||||
client.setTitle(dirName);
|
client.setTitle(dirName);
|
||||||
client.setDir(dirName);
|
client.setDir(dirName);
|
||||||
|
client.setUUID(UUID.randomUUID());
|
||||||
try (BufferedWriter writer = IOHelper.newWriter(IOHelper.resolveIncremental(server.profilesDir,
|
try (BufferedWriter writer = IOHelper.newWriter(IOHelper.resolveIncremental(server.profilesDir,
|
||||||
dirName, "json"))) {
|
dirName, "json"))) {
|
||||||
Launcher.gsonManager.configGson.toJson(client, writer);
|
Launcher.gsonManager.configGson.toJson(client, writer);
|
||||||
|
|
|
@ -86,6 +86,8 @@ public String toString() {
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
private int sortIndex;
|
private int sortIndex;
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
|
private UUID uuid;
|
||||||
|
@LauncherAPI
|
||||||
private String title;
|
private String title;
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
private String info;
|
private String info;
|
||||||
|
@ -384,11 +386,19 @@ public void setVersion(Version version) {
|
||||||
this.version = version.name;
|
this.version = version.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setUUID(UUID uuid) {
|
||||||
|
this.uuid = uuid;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UUID getUUID() {
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
@LauncherAPI
|
@LauncherAPI
|
||||||
public void verify() {
|
public void verify() {
|
||||||
// Version
|
// Version
|
||||||
|
|
Loading…
Reference in a new issue