Merge branch 'master' of github.com:GravitLauncher/Launcher

This commit is contained in:
Gravit 2019-01-12 01:17:41 +07:00
commit 35cfccba16
No known key found for this signature in database
GPG key ID: 061981E1E85D3216

View file

@ -16,6 +16,7 @@ public ClientProfile(String version, String assetIndex, int sortIndex, String ti
this.assetIndex = assetIndex;
this.sortIndex = sortIndex;
this.title = title;
this.info = info;
this.serverAddress = serverAddress;
this.serverPort = serverPort;
this.updateFastCheck = updateFastCheck;
@ -89,6 +90,8 @@ public String toString() {
@LauncherAPI
private String title;
@LauncherAPI
private String info;
@LauncherAPI
private String serverAddress;
@LauncherAPI
private int serverPort;
@ -375,6 +378,11 @@ public String getTitle() {
return title;
}
@LauncherAPI
public String getInfo() {
return info;
}
@LauncherAPI
public Version getVersion() {
return Version.byName(version);
@ -396,6 +404,11 @@ public void setTitle(String title) {
this.title = title;
}
@LauncherAPI
public void setInfo(String info) {
this.info = info;
}
@LauncherAPI
public void setVersion(Version version) {
this.version = version.name;
@ -414,6 +427,7 @@ public void verify() {
// Client
VerifyHelper.verify(getTitle(), VerifyHelper.NOT_EMPTY, "Profile title can't be empty");
VerifyHelper.verify(getInfo(), VerifyHelper.NOT_EMPTY, "Profile info can't be empty");
VerifyHelper.verify(getServerAddress(), VerifyHelper.NOT_EMPTY, "Server address can't be empty");
VerifyHelper.verifyInt(getServerPort(), VerifyHelper.range(0, 65535), "Illegal server port: " + getServerPort());
@ -436,6 +450,7 @@ public int hashCode() {
result = prime * result + serverPort;
result = prime * result + sortIndex;
result = prime * result + ((title == null) ? 0 : title.hashCode());
result = prime * result + ((info == null) ? 0 : info.hashCode());
result = prime * result + ((update == null) ? 0 : update.hashCode());
result = prime * result + ((updateExclusions == null) ? 0 : updateExclusions.hashCode());
result = prime * result + (updateFastCheck ? 1231 : 1237);
@ -505,6 +520,11 @@ public boolean equals(Object obj) {
if (other.title != null)
return false;
} else if (!title.equals(other.title))
return false;
if (info == null) {
if (other.info != null)
return false;
} else if (!info.equals(other.info))
return false;
if (update == null) {
if (other.update != null)