34
34
*/
35
35
public class Configuration {
36
36
private static final String CONFIGHEADER = "Quake Injector " + BuildCommit .getBuildCommit () + " config file" ;
37
- public class EnginePath extends FileValue {
37
+ public static class EnginePath extends FileValue {
38
38
private EnginePath () { super ("enginePath" , null ); }
39
39
40
40
public File getUnzipDir (Package map ) {
@@ -48,18 +48,18 @@ public File getUnzipDir(Package map) {
48
48
}
49
49
public final EnginePath EnginePath = new EnginePath ();
50
50
51
- public class EngineExecutable extends FileValue {
51
+ public static class EngineExecutable extends FileValue {
52
52
private EngineExecutable () { super ("engineExecutable" , new File ("" )); }
53
53
}
54
54
public final EngineExecutable EngineExecutable = new EngineExecutable ();
55
55
56
- public class WorkingDirAtExecutable extends BooleanValue {
56
+ public static class WorkingDirAtExecutable extends BooleanValue {
57
57
private WorkingDirAtExecutable () { super ("workingDirAtExecutable" , false ); }
58
58
}
59
59
public final WorkingDirAtExecutable WorkingDirAtExecutable = new WorkingDirAtExecutable ();
60
60
61
- public class LocalDatabaseFile extends FileValue {
62
- private LocalDatabaseFile () { super ("localDatabaseFile" , new File ("database.xml " )); }
61
+ public static class LocalDatabaseFile extends FileValue {
62
+ private LocalDatabaseFile () { super ("localDatabaseFile" , new File ("database.json " )); }
63
63
}
64
64
public final LocalDatabaseFile LocalDatabaseFile = new LocalDatabaseFile ();
65
65
@@ -93,36 +93,38 @@ public void set(File v) {
93
93
}
94
94
public final DownloadPath DownloadPath = new DownloadPath ();
95
95
96
- public class EngineCommandLine extends StringValue {
96
+ public static class EngineCommandLine extends StringValue {
97
97
private EngineCommandLine () { super ("engineCommandline" , "" ); }
98
98
}
99
99
public final EngineCommandLine EngineCommandLine = new EngineCommandLine ();
100
100
101
- public class RepositoryDatabasePath extends StringValue {
101
+ public static class RepositoryDatabasePath extends StringValue {
102
102
private RepositoryDatabasePath () { super ("repositoryDatabase" ,
103
- "https://www.quaddicted.com/reviews/quaddicted_database.xml" ); }
103
+ "https://api.quaddicted.com/jsons" ); }
104
+ //"https://www.quaddicted.com/reviews/quaddicted_database.xml"); }
104
105
}
105
106
public final RepositoryDatabasePath RepositoryDatabasePath = new RepositoryDatabasePath ();
106
107
107
- public class ScreenshotRepositoryPath extends StringValue {
108
+ public static class ScreenshotRepositoryPath extends StringValue {
108
109
private ScreenshotRepositoryPath () { super ("screenshotRepositoryPath" ,
109
- "https://www.quaddicted.com/reviews/screenshots/" ); }
110
+ // https://www.quaddicted.com/files/quaddicted-images/by-sha256/a2/a25043c2b6c1c73b24e4a00c63d95a8a9e08943d8b8e39d7c4571ae3a1899d99/colony3.jpg
111
+ "https://www.quaddicted.com/files/quaddicted-images/by-sha256/" ); }
110
112
}
111
113
public final ScreenshotRepositoryPath ScreenshotRepositoryPath = new ScreenshotRepositoryPath ();
112
114
113
- public class ZipContentsDatabaseUrl extends StringValue {
115
+ public static class ZipContentsDatabaseUrl extends StringValue {
114
116
private ZipContentsDatabaseUrl () { super ("ZipContentsDatabaseUrl" ,
115
117
"http://haukerehfeld.de/projects/quakeinjector/temp/zipContents.xml" ); }
116
118
}
117
119
public final ZipContentsDatabaseUrl ZipContentsDatabaseUrl = new ZipContentsDatabaseUrl ();
118
120
119
121
120
- public class RogueInstalled extends BooleanValue {
122
+ public static class RogueInstalled extends BooleanValue {
121
123
private RogueInstalled () { super ("rogueInstalled" , false ); }
122
124
}
123
125
public final RogueInstalled RogueInstalled = new RogueInstalled ();
124
126
125
- public class OfflineMode extends BooleanValue {
127
+ public static class OfflineMode extends BooleanValue {
126
128
private ChangeListenerList listeners = new ChangeListenerList ();
127
129
128
130
private OfflineMode () { super ("offlineMode" , false ); }
@@ -139,22 +141,22 @@ public void set(Boolean b) {
139
141
}
140
142
public final OfflineMode OfflineMode = new OfflineMode ();
141
143
142
- public class HipnoticInstalled extends BooleanValue {
144
+ public static class HipnoticInstalled extends BooleanValue {
143
145
private HipnoticInstalled () { super ("hipnoticInstalled" , false ); }
144
146
}
145
147
public final HipnoticInstalled HipnoticInstalled = new HipnoticInstalled ();
146
148
147
- public class MainWindowPositionX extends IntegerValue {
149
+ public static class MainWindowPositionX extends IntegerValue {
148
150
private MainWindowPositionX () { super ("mainWindowPositionX" , null ); }
149
151
}
150
152
public final MainWindowPositionX MainWindowPositionX = new MainWindowPositionX ();
151
153
152
- public class MainWindowPositionY extends IntegerValue {
154
+ public static class MainWindowPositionY extends IntegerValue {
153
155
private MainWindowPositionY () { super ("mainWindowPositionY" , null ); }
154
156
}
155
157
public final MainWindowPositionY MainWindowPositionY = new MainWindowPositionY ();
156
158
157
- public class MainWindowWidth extends IntegerValue {
159
+ public static class MainWindowWidth extends IntegerValue {
158
160
private MainWindowWidth () { super ("mainWindowWidth" , null ); }
159
161
}
160
162
public final MainWindowWidth MainWindowWidth = new MainWindowWidth ();
@@ -164,20 +166,25 @@ public class MainWindowHeight extends IntegerValue {
164
166
}
165
167
public final MainWindowHeight MainWindowHeight = new MainWindowHeight ();
166
168
167
- public class RepositoryBasePath extends StringValue {
169
+ public static class RepositoryBasePath extends StringValue {
168
170
private final static String onlineRepositoryExtension = ".zip" ;
169
171
170
- private RepositoryBasePath () { super ("repositoryBase" , "https://www.quaddicted.com/filebase /" ); }
172
+ private RepositoryBasePath () { super ("repositoryBase" , "https://www.quaddicted.com/files/by-sha256 /" ); }
171
173
172
174
/**
173
175
* Get a complete Url to a map archive file in the repo
174
176
*/
175
- public String getRepositoryUrl (String mapid ) {
176
- return get () + mapid + onlineRepositoryExtension ;
177
+ public String getRepositoryUrl (String filename , String sha256 ) {
178
+ return get () + sha256 . substring ( 0 , 2 ) + "/" + sha256 + "/" + filename ;
177
179
}
178
180
}
179
181
public final RepositoryBasePath RepositoryBasePath = new RepositoryBasePath ();
180
182
183
+ public static class MapWebpageBaseUrl extends StringValue {
184
+ private MapWebpageBaseUrl () { super ("mapWebpageBaseUrl" , "https://www.quaddicted.com/db/v1/maps/" ); }
185
+ }
186
+ public final MapWebpageBaseUrl mapWebpageBaseUrl = new MapWebpageBaseUrl ();
187
+
181
188
public final Map <String ,Value <?>> All = new HashMap <String ,Value <?>>();
182
189
183
190
private File configFile ;
@@ -349,7 +356,7 @@ public interface Value<T> {
349
356
public boolean existsOrDefault ();
350
357
}
351
358
352
- public abstract class AbstractValue <T > implements Value <T > {
359
+ public abstract static class AbstractValue <T > implements Value <T > {
353
360
private String key ;
354
361
private T defaultValue ;
355
362
private T value ;
@@ -398,7 +405,7 @@ public String toString() {
398
405
}
399
406
}
400
407
401
- public abstract class StringValue extends AbstractValue <String > {
408
+ public abstract static class StringValue extends AbstractValue <String > {
402
409
protected StringValue (String key , String defaultValue ) { super (key , defaultValue ); }
403
410
404
411
public String stringToValue (String v ) {
@@ -410,7 +417,7 @@ public String toString() {
410
417
}
411
418
}
412
419
413
- public abstract class FileValue extends AbstractValue <File > {
420
+ public abstract static class FileValue extends AbstractValue <File > {
414
421
protected FileValue (String key , File defaultValue ) { super (key , defaultValue ); }
415
422
416
423
public File stringToValue (String v ) {
@@ -419,15 +426,15 @@ public File stringToValue(String v) {
419
426
}
420
427
421
428
422
- public abstract class BooleanValue extends AbstractValue <Boolean > {
429
+ public abstract static class BooleanValue extends AbstractValue <Boolean > {
423
430
protected BooleanValue (String key , boolean defaultValue ) { super (key , defaultValue ); }
424
431
425
432
public Boolean stringToValue (String v ) {
426
433
return Boolean .valueOf (v );
427
434
}
428
435
}
429
436
430
- public abstract class IntegerValue extends AbstractValue <Integer > {
437
+ public abstract static class IntegerValue extends AbstractValue <Integer > {
431
438
protected IntegerValue (String key , Integer defaultValue ) { super (key , defaultValue ); }
432
439
433
440
public Integer stringToValue (String v ) {
0 commit comments