Skip to content

Commit

Permalink
mini bugfixes & cleaned code & fixed server connection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
oneqxz committed Nov 8, 2023
1 parent 9258668 commit a6c9fdf
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/main/java/me/oneqxz/riseloader/RiseUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class RiseUI extends Application {

private static final Logger log = LogManager.getLogger("RiseLoader");
public static final Version version = new Version("1.0.2");
public static final Version version = new Version("1.0.3");
public static final String serverIp = "http://riseloader.0x22.xyz";

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,6 @@ protected void init() {
preview.setFitHeight(Math.min(image.getHeight(), 400));
preview.setPreserveRatio(true);

// preview.layoutXProperty().setValue((this.root.getBoundsInParent().getWidth() / 2) - (preview.getBoundsInParent().getWidth() / 2));
// preview.layoutYProperty().setValue((this.root.getBoundsInParent().getHeight() / 2) - (preview.getBoundsInParent().getHeight() / 2));

// double aspectRatio = image.getWidth() / image.getHeight();
// double realWidth = Math.min(preview.getFitWidth(), preview.getFitWidth());
// double realHeight = Math.min(preview.getFitHeight(), preview.getFitWidth() / aspectRatio);
//
// preview.setLayoutX((root.getBoundsInParent().getWidth() - realWidth) / 2);
// preview.setLayoutY((root.getBoundsInParent().getHeight() - realHeight) / 2);

preview.setOnMouseClicked((e) ->
{
MainScene.removeChildren(this.root);
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/me/oneqxz/riseloader/rise/pub/Scripts.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import org.json.JSONArray;
import org.json.JSONObject;

import java.util.UUID;

public class Scripts implements IPublic {

private IPublicData[] data;
Expand Down Expand Up @@ -51,7 +49,7 @@ public IPublic updateData() {
public @NotNull String getMD5() {
return script.getJSONObject("download").getString("md5");
}
public @NotNull long created() {
public long created() {
return script.getJSONObject("download").getLong("created");
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public interface IFileData {

@NotNull String getDownloadURL();
@NotNull String getMD5();
@NotNull long created();
long created();

default String lastUploaded()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public static Response get(String serverUrl) throws IOException {
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36");
connection.setRequestProperty("riseloader-ca-qlp-cls", "KQbfEfRyHoukC3nqUu5cMZYk98D03s8cycbi9360M54RNjvpw69pYBVaSFD");

int responseCode = connection.getResponseCode();

Expand Down

0 comments on commit a6c9fdf

Please sign in to comment.