From e9774a03859ee8aba73f4dafbbcc54810f67b9b7 Mon Sep 17 00:00:00 2001 From: Paul-Yves Lucas Date: Thu, 29 Jun 2017 10:51:33 +0200 Subject: [PATCH] correcting bug when a localNew resource was here but not the local (if the app was stopped in the middle of dl for ex), it was valid and not installed, now it put in the _toBeInstalledResouces list for proper installation --- src/main/java/com/threerings/getdown/data/Application.java | 6 +++++- src/main/java/com/threerings/getdown/launcher/Getdown.java | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/threerings/getdown/data/Application.java b/src/main/java/com/threerings/getdown/data/Application.java index ff20af0..a7d27c3 100644 --- a/src/main/java/com/threerings/getdown/data/Application.java +++ b/src/main/java/com/threerings/getdown/data/Application.java @@ -1276,7 +1276,7 @@ public class Application * @param unpacked a set to populate with unpacked resources. */ public List verifyResources (ProgressObserver obs, int[] alreadyValid, - Set unpacked) throws InterruptedException + Set unpacked, List toBeInstalled) throws InterruptedException { List rsrcs = getAllActiveResources(); List failures = new ArrayList(); @@ -1306,6 +1306,10 @@ public class Application try { if (_digest.validateResource(rsrc, robs)) { + //if the resource is valid but has no _local file, we add it to the resource to install + if (!rsrc.getLocal().exists() && rsrc.getLocalNew().exists() && !toBeInstalled.contains(rsrc)) { + toBeInstalled.add(rsrc); + } // unpack this resource if appropriate if (noUnpack || !rsrc.shouldUnpack()) { // finally note that this resource is kosher diff --git a/src/main/java/com/threerings/getdown/launcher/Getdown.java b/src/main/java/com/threerings/getdown/launcher/Getdown.java index ef08b73..df478a8 100644 --- a/src/main/java/com/threerings/getdown/launcher/Getdown.java +++ b/src/main/java/com/threerings/getdown/launcher/Getdown.java @@ -476,7 +476,7 @@ public abstract class Getdown extends Thread // now verify our resources... setStep(Step.VERIFY_RESOURCES); setStatusAsync("m.validating", -1, -1L, false); - List failures = _app.verifyResources(_progobs, alreadyValid, unpacked); + List failures = _app.verifyResources(_progobs, alreadyValid, unpacked, _toBeInstalledResouces); if (failures == null) { log.info("Resources verified.");