added a message from the server, now ready for release

This commit is contained in:
Bryson Steck 2022-01-15 23:27:05 -07:00
parent 23ff6e31d2
commit 939ef85594
2 changed files with 18 additions and 6 deletions

View file

@ -67,6 +67,7 @@ public class Resurrection extends JavaPlugin implements Listener {
if (check.isSuccess()) { if (check.isSuccess()) {
String newestVersion = check.getVersion(); String newestVersion = check.getVersion();
String newestVersionURL = check.getVersionURL(); String newestVersionURL = check.getVersionURL();
String message = check.getMessage();
if (pluginInfo.getVersion().equals(newestVersion)) { if (pluginInfo.getVersion().equals(newestVersion)) {
log.info(newestVersion + " is the latest version of Resurrection."); log.info(newestVersion + " is the latest version of Resurrection.");
} else { } else {
@ -75,6 +76,11 @@ public class Resurrection extends JavaPlugin implements Listener {
log.info(newestVersionURL); log.info(newestVersionURL);
outdated = true; outdated = true;
} }
if (!message.equals("\"\"")) {
log.info("---------------------------------------------------------");
log.warning("A message from the developer has been sent from the update server: " + message);
}
} }
log.info("---------------------------------------------------------"); log.info("---------------------------------------------------------");

View file

@ -18,6 +18,7 @@ public class CheckForUpdate {
boolean success; boolean success;
String version; String version;
String versionURL; String versionURL;
String message;
Logger log = JavaPlugin.getProvidingPlugin(Resurrection.class).getLogger(); Logger log = JavaPlugin.getProvidingPlugin(Resurrection.class).getLogger();
public CheckForUpdate() { public CheckForUpdate() {
@ -30,6 +31,7 @@ public class CheckForUpdate {
version = softwareObj.get("current-release").toString(); version = softwareObj.get("current-release").toString();
version = version.replace("\"", ""); version = version.replace("\"", "");
versionURL = softwareObj.get("github-release").toString(); versionURL = softwareObj.get("github-release").toString();
message = softwareObj.get("message").toString();
success = true; success = true;
} catch (IOException e) { } catch (IOException e) {
log.warning("An error has occurred while attempting to check for updates."); log.warning("An error has occurred while attempting to check for updates.");
@ -64,4 +66,8 @@ public class CheckForUpdate {
public String getVersion() { public String getVersion() {
return version; return version;
} }
public String getMessage() {
return message;
}
} }