diff --git a/src/java/com/threerings/getdown/launcher/GetdownApplet.java b/src/java/com/threerings/getdown/launcher/GetdownApplet.java index a95c500..3a2beaa 100644 --- a/src/java/com/threerings/getdown/launcher/GetdownApplet.java +++ b/src/java/com/threerings/getdown/launcher/GetdownApplet.java @@ -98,6 +98,15 @@ public class GetdownApplet extends JApplet return; } + // Pass through properties parameter. + String[] properties = getParameter("properties").split(" "); + for (String property : properties) { + String key = property.substring(property.indexOf("-D") + 2, + property.indexOf("=")); + String value = property.substring(property.indexOf("=") + 1); + System.setProperty(key, value); + } + // when run from an applet, we install String root; if (RunAnywhere.isWindows()) { diff --git a/src/java/com/threerings/getdown/launcher/TorrentDownloader.java b/src/java/com/threerings/getdown/launcher/TorrentDownloader.java index f44518d..1a8cabf 100644 --- a/src/java/com/threerings/getdown/launcher/TorrentDownloader.java +++ b/src/java/com/threerings/getdown/launcher/TorrentDownloader.java @@ -85,7 +85,7 @@ public class TorrentDownloader extends Downloader // Override the start time, since Snark allocates storage prior to // doing any downloading _start = System.currentTimeMillis(); - while (_currentSize != snark.meta.getTotalLength()) { + while (!snark.coordinator.completed()) { long now = System.currentTimeMillis(); if ((now - _lastUpdate) >= UPDATE_DELAY) { _currentSize = snark.coordinator.getDownloaded(); @@ -106,6 +106,10 @@ public class TorrentDownloader extends Downloader } updateObserver(); } + // Manually set completion, just to be extra-safe. + _currentSize = _totalSize; + updateObserver(); + if (snarkStopper != null) { snarkStopper.run(); Runtime.getRuntime().removeShutdownHook(snarkStopper);