Skip to content

Commit

Permalink
Forced to release 1.09_15
Browse files Browse the repository at this point in the history
  • Loading branch information
Moresteck committed Nov 26, 2021
1 parent dc8b830 commit 89b1102
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 46 deletions.
10 changes: 7 additions & 3 deletions .classpath
Expand Up @@ -14,19 +14,23 @@
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/test" path="src/test/resources">
<attributes>
<attribute name="test" value="true"/>
<attribute name="gradle_scope" value="test"/>
<attribute name="gradle_used_by_scope" value="test"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-16/"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
10 changes: 1 addition & 9 deletions build.gradle
@@ -1,11 +1,8 @@
plugins {
id 'java'
id 'org.openjfx.javafxplugin' version '0.0.10'
}

compileJava {
options.release = 8
}
targetCompatibility = 8;

repositories {
mavenCentral()
Expand Down Expand Up @@ -65,11 +62,6 @@ configurations {
extraLibs
}

javafx {
version = "16"
modules = [ 'javafx.graphics', 'javafx.swing', 'javafx.web' ]
}

dependencies {
implementation 'com.google.code.gson:gson:2.8.6'
implementation name: 'discord-rpc-1.6.2'
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/betacraft/Wrapper.java
Expand Up @@ -170,7 +170,7 @@ public Wrapper(String user, String ver_prefix, String version, String sessionid,
presence.state = VER + ": " + version;
presence.details = String.format(USR, user);
presence.largeImageKey = "bc";
presence.largeImageText = "Download at betacraft.pl";
presence.largeImageText = "Download at betacraft.uk";
DiscordRPC.discordUpdatePresence(presence);
discordThread = new DiscordThread();
}
Expand Down Expand Up @@ -244,7 +244,7 @@ public void getMPpass(String server) {
if (getmppass) {
System.out.println("Obtaining mppass...");
//
this.mppass = new CustomRequest("http://api.betacraft.pl/getmppass.jsp?user=" + this.params.get("username") + "&server=" + server).perform().response;
this.mppass = new CustomRequest("http://api.betacraft.uk/getmppass.jsp?user=" + this.params.get("username") + "&server=" + server).perform().response;
if (this.mppass == null || this.mppass.equals("FAILED") || this.mppass.equals("SERVER NOT FOUND")) {
// failed to get mppass :(
System.out.println("Failed to get mppass for: " + server);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/betacraft/launcher/Addon.java
Expand Up @@ -39,7 +39,7 @@ public JScrollPane getInfo() {
pane.setContentType("text/html;charset=UTF-8");
pane.addHyperlinkListener(WebsitePanel.EXTERNAL_HYPERLINK_LISTENER);
try {
pane.setPage(new URL("http://files.betacraft.pl/launcher/assets/addons/" + addonVer + "/" + this.name + ".html"));
pane.setPage(new URL("http://files.betacraft.uk/launcher/assets/addons/" + addonVer + "/" + this.name + ".html"));
} catch (Exception ex) {
ex.printStackTrace();
Logger.printException(ex);
Expand All @@ -62,7 +62,7 @@ public boolean accept(File dir, String fileName) {
}
});

final URL url = new URL("http://files.betacraft.pl/launcher/assets/addons/" + addonVer + "/list.txt");
final URL url = new URL("http://files.betacraft.uk/launcher/assets/addons/" + addonVer + "/list.txt");

InputStream onlineListStream = null;
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/betacraft/launcher/BC.java
Expand Up @@ -9,7 +9,7 @@ public class BC {
public static File SETTINGS;

// TODO better check this before release
public static boolean prerelease = true;
public static boolean prerelease = false;
public static boolean nightly = false;

public static boolean portable = false;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/betacraft/launcher/Lang.java
Expand Up @@ -33,7 +33,7 @@ public class Lang extends JFrame implements LanguageElement {
static JPanel panel;
static GridBagConstraints constr;

public static String locale_id = "1.09_11";
public static String locale_id = "1.09_15";

public Lang() {
Logger.a("Language option window has been opened.");
Expand Down Expand Up @@ -105,7 +105,7 @@ public void setLang() {
}

public void initLang() throws IOException {
URL url = new URL("http://betacraft.pl/lang/" + locale_id + "/index.html");
URL url = new URL("http://files.betacraft.uk/launcher/assets/lang/" + locale_id + "/list.txt");

Scanner scanner = new Scanner(url.openStream(), "UTF-8");
String now;
Expand Down Expand Up @@ -162,7 +162,7 @@ public static boolean downloaded(String lang) {
}

public static DownloadResult download(String lang) {
DownloadResult download = Launcher.download("http://betacraft.pl/lang/" + locale_id + "/" + lang + ".txt", new File(BC.get() + "launcher" + File.separator + "lang", lang + ".txt"));
DownloadResult download = Launcher.download("http://files.betacraft.uk/launcher/assets/lang/" + locale_id + "/" + lang + ".txt", new File(BC.get() + "launcher" + File.separator + "lang", lang + ".txt"));
if (!download.isPositive()) {
JOptionPane.showMessageDialog(Window.mainWindow, "No Internet connection", "Language file download failed!", JOptionPane.ERROR_MESSAGE);
}
Expand Down
38 changes: 19 additions & 19 deletions src/main/java/org/betacraft/launcher/Launcher.java
Expand Up @@ -53,7 +53,7 @@

/** Main class */
public class Launcher {
public static String VERSION = "1.09_15-pre3"; // TODO Always update this
public static String VERSION = "1.09_15"; // TODO Always update this

public static Instance currentInstance;
public static boolean forceUpdate = false;
Expand Down Expand Up @@ -422,14 +422,14 @@ public static void initStartup() {
if (rpc.exists()) {
try {
String sha1 = Util.getSHA1(rpc);
String expected_hash = new CustomRequest("http://files.betacraft.pl/launcher/assets/discord_rpc.sha1").perform().response.replace("\n", "");
String expected_hash = new CustomRequest("http://files.betacraft.uk/launcher/assets/discord_rpc.sha1").perform().response.replace("\n", "");
if (!sha1.equals(expected_hash)) {
Launcher.downloadWithButtonOutput("http://files.betacraft.pl/launcher/assets/discord_rpc.jar", rpc);
Launcher.downloadWithButtonOutput("http://files.betacraft.uk/launcher/assets/discord_rpc.jar", rpc);
}
} catch (Throwable t) {}
}
if (!rpc.exists() || Launcher.forceUpdate) {
Launcher.downloadWithButtonOutput("http://files.betacraft.pl/launcher/assets/discord_rpc.jar", rpc);
Launcher.downloadWithButtonOutput("http://files.betacraft.uk/launcher/assets/discord_rpc.jar", rpc);
}
}

Expand Down Expand Up @@ -457,7 +457,7 @@ public static void initStartup() {

if (OS.isMac()) {
if ("true".equalsIgnoreCase(info.getEntry("macos-mousefix"))) {
String json = new CustomRequest("http://files.betacraft.pl/launcher/assets/macos-mousefix.json").perform().response;
String json = new CustomRequest("http://files.betacraft.uk/launcher/assets/macos-mousefix.json").perform().response;
if (json != null) {
MouseFixMacOSJson mousefix_json = Util.gsonPretty.fromJson(json, MouseFixMacOSJson.class);
Util.installMacOSFix(mousefix_json, Launcher.forceUpdate);
Expand Down Expand Up @@ -556,7 +556,7 @@ public boolean accept(File dir, String fileName) {
params.add("-Xdock:icon=" + instance.getIconLocation());
}

params.add("-Dhttp.nonProxyHosts=api.betacraft.pl");
params.add("-Dhttp.nonProxyHosts=api.betacraft.uk");

// Add custom parameters from options
if (instance.launchArgs != null && !instance.launchArgs.equals("")) {
Expand Down Expand Up @@ -693,7 +693,7 @@ public static void readyAddons(Instance instance, boolean force) {
}
}

if (download && !downloadWithButtonOutput("http://files.betacraft.pl/launcher/assets/addons/" + Addon.addonVer + "/" + s + ".jar", destination).isPositive()) {
if (download && !downloadWithButtonOutput("http://files.betacraft.uk/launcher/assets/addons/" + Addon.addonVer + "/" + s + ".jar", destination).isPositive()) {
JOptionPane.showMessageDialog(Window.mainWindow, "Couldn't download addon: " + s, "Error", JOptionPane.ERROR_MESSAGE);
}
}
Expand All @@ -717,7 +717,7 @@ public static boolean checkDepends() {
return false;
}
try {
URL url = new URL("http://files.betacraft.pl/launcher/assets/depends-version.txt");
URL url = new URL("http://files.betacraft.uk/launcher/assets/depends-version.txt");
Scanner s = new Scanner(url.openStream(), "UTF-8");
String libs = s.nextLine().split(":")[1];
String natives = s.nextLine().split(":")[1];
Expand All @@ -742,15 +742,15 @@ public static boolean downloadDepends() {
File destLibs = new File(BC.get() + "bin" + File.separator);
File destNatives = new File(BC.get() + "bin" + File.separator + "natives" + File.separator);

String link1 = "http://files.betacraft.pl/launcher/assets/natives-windows.zip";
String link2 = "http://files.betacraft.pl/launcher/assets/libs-windows.zip";
String link1 = "http://files.betacraft.uk/launcher/assets/natives-windows.zip";
String link2 = "http://files.betacraft.uk/launcher/assets/libs-windows.zip";
if (OS.isLinux()) {
link2 = "http://files.betacraft.pl/launcher/assets/libs-linux.zip";
link1 = "http://files.betacraft.pl/launcher/assets/natives-linux.zip";
link2 = "http://files.betacraft.uk/launcher/assets/libs-linux.zip";
link1 = "http://files.betacraft.uk/launcher/assets/natives-linux.zip";
}
if (OS.isMac()) {
link2 = "http://files.betacraft.pl/launcher/assets/libs-osx.zip";
link1 = "http://files.betacraft.pl/launcher/assets/natives-osx.zip";
link2 = "http://files.betacraft.uk/launcher/assets/libs-osx.zip";
link1 = "http://files.betacraft.uk/launcher/assets/natives-osx.zip";
}

File dest1 = new File(BC.get() + "launcher/", "natives.zip");
Expand All @@ -764,7 +764,7 @@ public static boolean downloadDepends() {
}

// Update the local memory with depends' version
CustomResponse res = new CustomRequest("http://files.betacraft.pl/launcher/assets/depends-version.txt").perform();
CustomResponse res = new CustomRequest("http://files.betacraft.uk/launcher/assets/depends-version.txt").perform();
Scanner s = new Scanner(res.response);
String libs = s.nextLine().split(":")[1];
String natives = s.nextLine().split(":")[1];
Expand Down Expand Up @@ -894,8 +894,8 @@ public static void downloadUpdate(boolean release) {
ending = "-portable" + ending;
}

String url = "http://files.betacraft.pl/launcher/launcher-" + update_name + ending;
if (!release) url = "http://files.betacraft.pl/launcher/launcher-" + update_name + ending;
String url = "http://files.betacraft.uk/launcher/launcher-" + update_name + ending;
if (!release) url = "http://files.betacraft.uk/launcher/launcher-" + update_name + ending;

// Download the update
download(url, new File(BC.get(), "betacraft.jar$tmp"));
Expand Down Expand Up @@ -933,8 +933,8 @@ public static boolean checkForUpdate(boolean release) {

public static String getUpdate(boolean release) {
try {
String Url = "http://files.betacraft.pl/launcher/rel.txt";
if (!release) Url = "http://files.betacraft.pl/launcher/pre.txt";
String Url = "http://files.betacraft.uk/launcher/rel.txt";
if (!release) Url = "http://files.betacraft.uk/launcher/pre.txt";
URL url = new URL(Url);
Scanner s = new Scanner(url.openStream(), "UTF-8");
String update = s.nextLine().split(":")[1];
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/betacraft/launcher/ModsRepository.java
Expand Up @@ -35,7 +35,7 @@ public class ModsRepository extends JFrame implements ActionListener, LanguageEl

public static void loadMods() {
try {
final URL url = new URL("http://files.betacraft.pl/launcher/assets/mods/1.09_10/list.txt");
final URL url = new URL("http://files.betacraft.uk/launcher/assets/mods/1.09_10/list.txt");

InputStream onlineListStream = null;
try {
Expand Down Expand Up @@ -222,7 +222,7 @@ public JScrollPane getInfo(String name) {
pane.setContentType("text/html;charset=UTF-8");
pane.addHyperlinkListener(WebsitePanel.EXTERNAL_HYPERLINK_LISTENER);
try {
pane.setPage(new URL("http://files.betacraft.pl/launcher/assets/mods/" + name + ".html"));
pane.setPage(new URL("http://files.betacraft.uk/launcher/assets/mods/" + name + ".html"));
} catch (Exception ex) {
ex.printStackTrace();
Logger.printException(ex);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/betacraft/launcher/Release.java
Expand Up @@ -20,7 +20,7 @@ public class Release {
// hardcoded launcher one, the file gets deleted. Should do the thing, eh?

public enum VersionRepository {
BETACRAFT("http://files.betacraft.pl/launcher/assets/version_list.txt"),
BETACRAFT("http://files.betacraft.uk/launcher/assets/version_list.txt"),
CUSTOM(null);

private String link;
Expand Down Expand Up @@ -478,7 +478,7 @@ default boolean isCustom() {
}

default void downloadJson() {
Launcher.download("http://files.betacraft.pl/launcher/assets/jsons/" + this.getVersion() + ".info", new File(BC.get() + "versions" + File.separator + "jsons", this.getVersion() + ".info"));
Launcher.download("http://files.betacraft.uk/launcher/assets/jsons/" + this.getVersion() + ".info", new File(BC.get() + "versions" + File.separator + "jsons", this.getVersion() + ".info"));
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/betacraft/launcher/ReleaseJson.java
Expand Up @@ -11,7 +11,7 @@ public class ReleaseJson implements VersionInfo {
private String download = "";
private String launchMethod = "";
private String launchMethodLink = "";
private String proxyArgs = "-Dhttp.proxyHost=betacraft.pl"; // keep this as default
private String proxyArgs = "-Dhttp.proxyHost=betacraft.uk"; // keep this as default
private String otherName = "";
private String protocol = "";
private int fileVersion = -1;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/betacraft/launcher/WebsitePanel.java
Expand Up @@ -119,7 +119,7 @@ public JScrollPane getServers(boolean isConnection) {
new Thread() {
public void run() {
try {
HttpURLConnection con = (HttpURLConnection) new URL("http://betacraft.pl/server.jsp").openConnection();
HttpURLConnection con = (HttpURLConnection) new URL("http://betacraft.uk/serverlist").openConnection();
//con.setSSLSocketFactory(Cert.sslSocketFactory);
con.setRequestMethod("POST");
con.setDoInput(true);
Expand Down Expand Up @@ -182,7 +182,7 @@ public JScrollPane getUpdateNews(boolean isConnection) {
new Thread() {
public void run() {
try {
HttpURLConnection con = (HttpURLConnection) new URL("http://betacraft.pl/versions/changelog/" + Util.getProperty(BC.SETTINGS, "language") + ".html").openConnection();
HttpURLConnection con = (HttpURLConnection) new URL("http://files.betacraft.uk/launcher/changelog/" + Util.getProperty(BC.SETTINGS, "language") + ".html").openConnection();
con.setDoInput(true);
con.setDoOutput(false);
con.setConnectTimeout(5000);
Expand Down

0 comments on commit 89b1102

Please sign in to comment.