1
0
Fork 0

Fix for backport updating

kcx-1614
Prototik 2015-06-05 13:34:07 +07:00
parent c755e7f9a4
commit fafcc58eef
2 changed files with 5 additions and 2 deletions

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-bin.zip

View File

@ -89,7 +89,7 @@ public class KCauldronUpdater implements Runnable {
boolean quite = MinecraftServer.kcauldronConfig.updatecheckerQuite
.getValue();
MinecraftServer server = MinecraftServer.getServer();
final String filename = "KCauldron-" + mVersion + "-server.jar";
final String filename = KCauldron.getChannel() + "-" + mVersion + "-server.jar";
File path = KCauldron.getServerLocation();
File newPath = new File(path.getParentFile(),
getInstallAs(filename));
@ -124,6 +124,9 @@ public class KCauldronUpdater implements Runnable {
.addParameter("port", "" + server.getPort()).build();
HttpResponse response = HttpClientBuilder.create()
.setUserAgent("KCauldron Updater").build().execute(request);
if (response.getStatusLine().getStatusCode() != 200) {
throw new IllegalStateException("Could not download new version");
}
InputStream is = response.getEntity().getContent();
Files.copy(is, newPath.toPath());
if (mSender != null && !quite) {