1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
|
/* */ package NET.worlds.scape;
/* */
/* */ import NET.worlds.console.Console;
/* */ import NET.worlds.network.URL;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class WobLoader
/* */ implements BGLoaded
/* */ {
/* */ private WobLoaded loaded;
/* */ private URL origURL;
/* */ SuperRoot value;
/* */
/* */ public WobLoader(URL url, WobLoaded loaded)
/* */ {
/* 31 */ this(url, loaded, false);
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public WobLoader(URL url, WobLoaded loaded, boolean immediate)
/* */ {
/* 41 */ this.origURL = url;
/* 42 */ this.loaded = loaded;
/* */
/* 44 */ if (url.endsWith(".class")) {
/* 45 */ String s = url.getAbsolute();
/* 46 */ if (s.startsWith("system:")) {
/* 47 */ int len = s.length();
/* */ try {
/* 49 */ Class<?> c = Class.forName(s.substring(7, len - 6));
/* 50 */ SuperRoot sr = (SuperRoot)c.newInstance();
/* 51 */ sr.loadInit();
/* 52 */ gotIt(sr);
/* */ } catch (Exception e) {
/* 54 */ e.printStackTrace(System.out);
/* 55 */ Console.println("Can't make instance of class " + url);
/* 56 */ gotIt(null);
/* */ }
/* 58 */ return;
/* */ }
/* */ }
/* */
/* 62 */ if (immediate) {
/* 63 */ String s = url.unalias();
/* 64 */ if (s.indexOf(':') > 1) {
/* 65 */ gotIt(null);
/* */ } else
/* 67 */ syncBackgroundLoad(asyncBackgroundLoad(s, url), url);
/* */ } else {
/* 69 */ BackgroundLoader.get(this, url);
/* */ }
/* */ }
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public static SuperRoot immediateLoad(URL url)
/* */ {
/* 80 */ WobLoader w = new WobLoader(url, null, true);
/* 81 */ return w.value;
/* */ }
/* */
/* */ public Object asyncBackgroundLoad(String localName, URL remoteURL) {
/* 85 */ if (remoteURL.endsWith(".class")) {
/* 86 */ return WobClassLoader.get(localName, remoteURL.getClassName());
/* */ }
/* 88 */ return localName;
/* */ }
/* */
/* */ public boolean syncBackgroundLoad(Object obj, URL remoteURL)
/* */ {
/* 93 */ SuperRoot sr = null;
/* */
/* 95 */ if (obj != null) {
/* 96 */ if ((obj instanceof String)) {
/* 97 */ sr = SuperRoot.readFile((String)obj, remoteURL);
/* */ } else {
/* */ try {
/* 100 */ sr = (SuperRoot)((Class)obj).newInstance();
/* 101 */ sr.loadInit();
/* */ } catch (Exception e) {
/* 103 */ e.printStackTrace(System.out);
/* */ }
/* */ }
/* */ }
/* 107 */ gotIt(sr);
/* 108 */ return false;
/* */ }
/* */
/* */
/* */
/* */ private void gotIt(SuperRoot s)
/* */ {
/* 115 */ if (s != null) {
/* 116 */ s.setSourceURL(this.origURL);
/* */ }
/* 118 */ this.value = s;
/* 119 */ if (this.loaded != null) {
/* 120 */ this.loaded.wobLoaded(this, s);
/* */ }
/* */ }
/* */
/* */ public Room getBackgroundLoadRoom() {
/* 125 */ if ((this.loaded instanceof SuperRoot)) {
/* 126 */ SuperRoot o = (SuperRoot)this.loaded;
/* */
/* 128 */ while (o != null) {
/* 129 */ if ((o instanceof WObject))
/* 130 */ return ((WObject)o).getRoom();
/* 131 */ o = o.getOwner();
/* */ }
/* */ }
/* */
/* 135 */ return null;
/* */ }
/* */
/* 138 */ public URL getWobName() { return this.origURL; }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\WobLoader.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|