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