Screw unpacking our bundles on the fly. Just unpack them once when they
are downloaded and leave them be until the bundle is updated. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2612 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// $Id: ResourceManager.java,v 1.28 2003/05/05 18:02:37 mdb Exp $
|
||||
// $Id: ResourceManager.java,v 1.29 2003/05/27 07:52:45 mdb Exp $
|
||||
|
||||
package com.threerings.resource;
|
||||
|
||||
@@ -114,6 +114,13 @@ public class ResourceManager
|
||||
*/
|
||||
public void downloadProgress (int percent, long remaining);
|
||||
|
||||
/**
|
||||
* Called following the call to {@link #dowloadProgress} of 100
|
||||
* percent completion to indicate that we have validated and
|
||||
* unpacked our bundles and are fully ready to go.
|
||||
*/
|
||||
public void downloadComplete ();
|
||||
|
||||
/**
|
||||
* Called if a failure occurs while checking for an update or
|
||||
* downloading all resource sets.
|
||||
@@ -282,12 +289,17 @@ public class ResourceManager
|
||||
}
|
||||
|
||||
public void downloadProgress (int percent, long remaining) {
|
||||
if (percent == 100) {
|
||||
bundlesDownloaded();
|
||||
synchronized (lock) {
|
||||
// wake things up as the download is finished
|
||||
lock.notify();
|
||||
}
|
||||
// nothing for now
|
||||
}
|
||||
|
||||
public void postDownloadHook () {
|
||||
bundlesDownloaded();
|
||||
}
|
||||
|
||||
public void downloadComplete () {
|
||||
synchronized (lock) {
|
||||
// wake things up as the download is finished
|
||||
lock.notify();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,12 +346,17 @@ public class ResourceManager
|
||||
}
|
||||
|
||||
public void downloadProgress (int percent, long remaining) {
|
||||
if (percent == 100) {
|
||||
bundlesDownloaded();
|
||||
}
|
||||
obs.downloadProgress(percent, remaining);
|
||||
}
|
||||
|
||||
public void postDownloadHook () {
|
||||
bundlesDownloaded();
|
||||
}
|
||||
|
||||
public void downloadComplete () {
|
||||
obs.downloadComplete();
|
||||
}
|
||||
|
||||
public void downloadFailed (DownloadDescriptor desc, Exception e) {
|
||||
obs.downloadFailed(e);
|
||||
}
|
||||
@@ -492,7 +509,7 @@ public class ResourceManager
|
||||
|
||||
// finally, add the file that will be cached to the set as
|
||||
// a resource bundle
|
||||
set.add(new ResourceBundle(cfile, true));
|
||||
set.add(new ResourceBundle(cfile, true, true));
|
||||
|
||||
} catch (MalformedURLException mue) {
|
||||
Log.warning("Unable to create URL for resource " +
|
||||
|
||||
Reference in New Issue
Block a user