summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/BackgroundLoaderElement.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/BackgroundLoaderElement.java
downloadworlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz
worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/BackgroundLoaderElement.java')
-rw-r--r--NET/worlds/scape/BackgroundLoaderElement.java653
1 files changed, 653 insertions, 0 deletions
diff --git a/NET/worlds/scape/BackgroundLoaderElement.java b/NET/worlds/scape/BackgroundLoaderElement.java
new file mode 100644
index 0000000..5edeeca
--- /dev/null
+++ b/NET/worlds/scape/BackgroundLoaderElement.java
@@ -0,0 +1,653 @@
+/* */ package NET.worlds.scape;
+/* */
+/* */ import NET.worlds.console.Main;
+/* */ import NET.worlds.core.IniFile;
+/* */ import NET.worlds.network.Cache;
+/* */ import NET.worlds.network.CacheFile;
+/* */ import NET.worlds.network.URL;
+/* */ import java.util.Observable;
+/* */ import java.util.Observer;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ class BackgroundLoaderElement
+/* */ implements Observer
+/* */ {
+/* */ private BGLoaded object;
+/* */ private Object arg;
+/* */ private URL url;
+/* */ private Room room;
+/* */ private boolean inAllRooms;
+/* */ private CacheFile rfile;
+/* */
+/* */ BackgroundLoaderElement(BGLoaded object, URL url, boolean inAllRooms)
+/* */ {
+/* 542 */ boolean isMain = Main.isMainThread();
+/* */
+/* 544 */ this.object = object;
+/* 545 */ this.url = url;
+/* 546 */ if (inAllRooms) {
+/* 547 */ this.inAllRooms = true;
+/* */ } else {
+/* 549 */ getRoom(isMain);
+/* */ }
+/* 551 */ read(isMain);
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ public void update(Observable o, Object url)
+/* */ {
+/* 560 */ BackgroundLoader.asyncLoad(this);
+/* */ }
+/* */
+/* */
+/* 564 */ private static boolean immedLoadLocals = IniFile.gamma().getIniInt("BackgroundLoadLocalFiles", 0) == 0;
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ private void read(boolean isMain)
+/* */ {
+/* 573 */ this.rfile = ((this.url == null) || (!this.url.isRemote()) ? null : Cache.getFile(this.url));
+/* */
+/* */
+/* 576 */ if (((this.rfile == null) || (this.rfile.done())) && (immedLoadLocals)) {
+/* 577 */ asyncLoad();
+/* */
+/* */
+/* */
+/* 581 */ if ((!isMain) || (syncLoad())) {
+/* 582 */ BackgroundLoader.syncLoad(this);
+/* */ }
+/* 584 */ } else if (this.rfile == null) {
+/* 585 */ BackgroundLoader.asyncLoad(this);
+/* */ } else {
+/* 587 */ this.rfile.callWhenLoaded(this);
+/* */ }
+/* */ }
+/* */
+/* */
+/* */
+/* */ void asyncLoad()
+/* */ {
+/* */ String name;
+/* */
+/* */
+/* */ String name;
+/* */
+/* */
+/* 601 */ if (this.rfile == null) {
+/* 602 */ name = this.url.unalias();
+/* */ } else {
+/* 604 */ name = this.rfile.getLocalName();
+/* */ }
+/* 606 */ this.arg = this.object.asyncBackgroundLoad(name, this.url);
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ boolean syncLoad()
+/* */ {
+/* 619 */ if (this.object.syncBackgroundLoad(this.arg, this.url)) {
+/* 620 */ return true;
+/* */ }
+/* 622 */ if (this.rfile != null) {
+/* 623 */ this.rfile.finalize();
+/* 624 */ this.rfile = null;
+/* */ }
+/* */
+/* 627 */ return false;
+/* */ }
+/* */
+/* */ boolean inAllRooms()
+/* */ {
+/* 632 */ return this.inAllRooms;
+/* */ }
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */
+/* */ Room getRoom(boolean isMainThread)
+/* */ {
+/* 643 */ if ((this.room == null) && (!this.inAllRooms) && (isMainThread))
+/* 644 */ this.room = this.object.getBackgroundLoadRoom();
+/* 645 */ return this.room;
+/* */ }
+/* */ }
+
+
+/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\BackgroundLoaderElement.class
+ * Java compiler version: 6 (50.0)
+ * JD-Core Version: 0.7.1
+ */ \ No newline at end of file