3
0

Fix for backport updating

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