-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use new download API and jar file checksum (#99)
* Update to new download api and sha checking for file integrity * remove old messages class * unneeded spacing * Make the enum return a lowercase string as url component * Konica wanted changes? :) * delete file issue catching * use getters for pojos and up the version number * initialize gson only once * Cleanup --------- Co-authored-by: Konicai <[email protected]>
- Loading branch information
Showing
20 changed files
with
286 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
src/main/java/com/projectg/geyserupdater/common/Messages.java
This file was deleted.
Oops, something went wrong.
75 changes: 75 additions & 0 deletions
75
src/main/java/com/projectg/geyserupdater/common/json_schema/EndpointResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package com.projectg.geyserupdater.common.json_schema; | ||
|
||
import lombok.Getter; | ||
import lombok.experimental.Accessors; | ||
|
||
import java.util.Date; | ||
import java.util.List; | ||
|
||
@SuppressWarnings({"UnusedDeclaration"}) | ||
@Getter | ||
@Accessors(fluent = true) | ||
public class EndpointResponse { | ||
private String project_id; | ||
private String project_name; | ||
private String version; | ||
private int build; | ||
private Date time; | ||
private String channel; | ||
private boolean promoted; | ||
private List<Change> changes; | ||
private Downloads downloads; | ||
|
||
@Getter | ||
public static class Bungeecord { | ||
private String name; | ||
private String sha256; | ||
} | ||
|
||
@Getter | ||
public static class Change { | ||
private String commit; | ||
private String summary; | ||
private String message; | ||
} | ||
|
||
@Getter | ||
public static class Downloads { | ||
private Bungeecord bungeecord; | ||
private Fabric fabric; | ||
private Spigot spigot; | ||
private Sponge sponge; | ||
private Standalone standalone; | ||
private Velocity velocity; | ||
} | ||
|
||
@Getter | ||
public static class Fabric { | ||
private String name; | ||
private String sha256; | ||
} | ||
|
||
@Getter | ||
public static class Spigot { | ||
private String name; | ||
private String sha256; | ||
} | ||
|
||
@Getter | ||
public static class Sponge { | ||
private String name; | ||
private String sha256; | ||
} | ||
|
||
@Getter | ||
public static class Standalone { | ||
private String name; | ||
private String sha256; | ||
} | ||
|
||
@Getter | ||
public static class Velocity { | ||
private String name; | ||
private String sha256; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/com/projectg/geyserupdater/common/util/Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.projectg.geyserupdater.common.util; | ||
|
||
public class Constants { | ||
public static final String GEYSER_BASE_URL = "https://download.geysermc.org"; | ||
public static final String GEYSER_LATEST_MASTER_ENDPOINT = "/v2/projects/geyser/versions/latest/builds/latest"; | ||
public static final String GEYSER_DOWNLOAD_LINK = "/v2/projects/geyser/versions/latest/builds/latest/downloads/"; | ||
public static final String CHECK_START = "Checking for updates to Geyser..."; | ||
public static final String LATEST = "You are using the latest build of Geyser!"; | ||
public static final String OUTDATED = "A newer build of Geyser is available! Attempting to download the latest build now..."; | ||
public static final String FAIL_CHECK = "Failed to check for updates to Geyser! We were unable to reach the Geyser build server, or your local branch does not exist on it."; | ||
} |
Oops, something went wrong.