mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-06 16:50:39 +00:00
Improve comments
This commit is contained in:
@@ -164,16 +164,22 @@ public class ServerProviderInfo {
|
|||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the URL to download the Randoms JAR from.
|
||||||
|
* @return The provided URL in the server config JSON (denoted by 'randoms:') or, fallback to the default BDN URL.
|
||||||
|
*/
|
||||||
public URL getRandoms() {
|
public URL getRandoms() {
|
||||||
try {
|
try {
|
||||||
String randomsUrl = properties.getProperty("randoms_jar");
|
String randomsUrl = properties.getProperty("randoms_jar");
|
||||||
if (randomsUrl == null || randomsUrl.length() == 0) {
|
if (randomsUrl == null || randomsUrl.length() == 0) {
|
||||||
|
// Fallback to default BDN URL if there is no 'randoms' specified in the server JSON configuration.
|
||||||
randomsUrl = Configuration.GET_RANDOMS + (Configuration.BOT_VERSION.isNightly() ? Configuration.NIGHTLY_APPEND : "");
|
randomsUrl = Configuration.GET_RANDOMS + (Configuration.BOT_VERSION.isNightly() ? Configuration.NIGHTLY_APPEND : "");
|
||||||
}
|
}
|
||||||
return new URL(randomsUrl);
|
return new URL(randomsUrl);
|
||||||
} catch (MalformedURLException e) {
|
} catch (MalformedURLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
// Will never return null, unless the BDN URL is changed. It shouldn't be.
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public class PublicRandoms extends RandomParser {
|
|||||||
final File destination = new File(Directories.getCachePath() + File.separator + fileName);
|
final File destination = new File(Directories.getCachePath() + File.separator + fileName);
|
||||||
final URL overrideDownload = Context.getInstance().getServerProviderInfo().getRandoms();
|
final URL overrideDownload = Context.getInstance().getServerProviderInfo().getRandoms();
|
||||||
if (overrideDownload == null) {
|
if (overrideDownload == null) {
|
||||||
throw new NullPointerException("randoms() URL is null - expected to default to BDN URL!");
|
throw new NullPointerException("Unable to grab URL for Randoms jar. Default URL for BDN randoms must have changed!");
|
||||||
}
|
}
|
||||||
|
|
||||||
Core.verbose(String.format("[%s] Destination: %s | dl: %s", getClass().getName(), destination, overrideDownload));
|
Core.verbose(String.format("[%s] Destination: %s | dl: %s", getClass().getName(), destination, overrideDownload));
|
||||||
|
|||||||
Reference in New Issue
Block a user