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
|
/* */ package NET.worlds.scape;
/* */
/* */ import NET.worlds.console.Console;
/* */ import NET.worlds.network.URL;
/* */ import java.io.File;
/* */ import java.io.IOException;
/* */ import java.io.PrintStream;
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */
/* */ public class MultiManifestAction
/* */ extends Action
/* */ implements LoadedURLSelf
/* */ {
/* */ private String _directory;
/* */
/* */ public Object properties(int index, int offset, int mode, Object value)
/* */ throws NoSuchPropertyException
/* */ {
/* 31 */ Object ret = null;
/* 32 */ switch (index - offset) {
/* */ case 0:
/* 34 */ if (mode == 0) {
/* 35 */ ret = StringPropertyEditor.make(new Property(this, index,
/* 36 */ "Directory"));
/* 37 */ } else if (mode == 1) {
/* 38 */ if (this._directory == null)
/* 39 */ this._directory = new String();
/* 40 */ ret = new String(this._directory);
/* 41 */ } else if (mode == 2) {
/* 42 */ this._directory = ((String)value).trim();
/* */ }
/* 44 */ break;
/* */ default:
/* 46 */ ret = super.properties(index, offset + 1, mode, value);
/* */ }
/* 48 */ return ret;
/* */ }
/* */
/* 51 */ private static Object classCookie = new Object();
/* */ private String[] _files;
/* */
/* 54 */ public void saveState(Saver s) throws IOException { s.saveVersion(0, classCookie);
/* 55 */ super.saveState(s);
/* 56 */ s.saveString(this._directory);
/* */ }
/* */
/* */ public void restoreState(Restorer r) throws IOException, TooNewException {
/* 60 */ switch (r.restoreVersion(classCookie)) {
/* */ case 0:
/* 62 */ super.restoreState(r);
/* 63 */ this._directory = r.restoreString();
/* 64 */ break;
/* */ default:
/* 66 */ throw new TooNewException();
/* */ }
/* */ }
/* */
/* */ public Persister trigger(Event e, Persister seqId) {
/* 71 */ if (seqId == null) {
/* 72 */ System.out.println("MMAState:starting");
/* 73 */ this._dir = new File(this._directory);
/* 74 */ this._files = this._dir.list(new ExtensionFilter(".world"));
/* 75 */ this._curFile = 0;
/* */
/* 77 */ startFile();
/* */ }
/* */
/* 80 */ if (this._curFile >= this._files.length) {
/* 81 */ return null;
/* */ }
/* 83 */ return this;
/* */ }
/* */
/* */
/* */
/* */ private File _dir;
/* */
/* */
/* */ private int _curFile;
/* */
/* */
/* */ private String _file;
/* */
/* */
/* */ public void startFile()
/* */ {
/* 99 */ if (this._curFile >= this._files.length) {
/* 100 */ System.out.println("MMAState:Done");
/* 101 */ return;
/* */ }
/* */
/* 104 */ this._file = new File(this._dir, this._files[this._curFile]).getAbsolutePath();
/* 105 */ System.out.println("MMAState:Loading: " + this._file);
/* 106 */ World.load(URL.make(this._file), this);
/* */ }
/* */
/* */ public void loadedURLSelf(URLSelf o, URL url, String err) {
/* 110 */ if ((err != null) || (!(o instanceof World))) {
/* 111 */ if (err == null) {
/* 112 */ err = Console.message("No-contain-world");
/* 113 */ o.decRef();
/* */ }
/* */
/* 116 */ Console.println(Console.message("Cant-load-remote") + url + "' ");
/* */ } else {
/* 118 */ World w = (World)o;
/* */
/* 120 */ String mftname = this._file.substring(0, this._file.lastIndexOf(".world")) +
/* 121 */ ".mft";
/* 122 */ System.out.println("MMAState:Manifesting: " + mftname);
/* */ try {
/* 124 */ Manifest mft = new Manifest(mftname);
/* 125 */ mft.saveProps(w);
/* 126 */ mft.done();
/* */ } catch (Exception ex) {
/* 128 */ ex.printStackTrace(System.out);
/* */ }
/* */
/* 131 */ if (w != Pilot.getActive().getWorld())
/* 132 */ w.discard();
/* */ }
/* 134 */ this._curFile += 1;
/* */
/* 136 */ startFile();
/* */ }
/* */ }
/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\MultiManifestAction.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|