/* */ 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 */