Adding scores to database complete (#8)
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
a7d726dbfe
commit
a599a2b8a2
@ -1,6 +1,8 @@
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@ -185,7 +187,7 @@ public class ArcadeReader {
|
||||
ArcadeReader.err(new Exception("Test \""+filename+"\" Failed:\nExpected:"+compare+"\nActual:"+r));
|
||||
return;
|
||||
}
|
||||
if (gamePath(r)==null) {
|
||||
if (gamePath(r.getClass().getSimpleName())==null) {
|
||||
ArcadeReader.err(new Exception("Test \""+filename+"\" Failed:\nReason: gamePath for this reader type ("+r.getClass().getSimpleName()+") does not exist. Check the gamePath() function!"));
|
||||
return;
|
||||
}
|
||||
@ -665,8 +667,8 @@ public class ArcadeReader {
|
||||
21/*maxcombo*/,
|
||||
"{\"ex\":457,\"chip_scritical\":13,\"chip_critical\":15,\"chip_near\":31,\"chip_error\":201,\"long_scritical\":44,\"long_error\":241,\"vol_scritical\":91,\"vol_error\":272,\"failed\":true}"/*other*/);
|
||||
}
|
||||
public static Path gamePath(Reader data) {
|
||||
switch (data.getClass().getSimpleName()) {
|
||||
public static Path gamePath(String str) {
|
||||
switch (str) {
|
||||
case "DDRReader":{
|
||||
return Paths.get("database","ddr");
|
||||
}
|
||||
@ -720,7 +722,7 @@ public class ArcadeReader {
|
||||
try {
|
||||
img = ImageIO.read(p.toFile());
|
||||
Reader newImg = interpret(img);
|
||||
Path getGamePath = gamePath(newImg);
|
||||
//Path getGamePath = gamePath(newImg);
|
||||
newImg.interpretBoxes(p);
|
||||
HashMap<String,HashMap<String,List<String>>> DATA = sigPlace.SONG_DATABASE;
|
||||
List<String> RECENT_PLAYS = sigPlace.RECENT_PLAYS;
|
||||
@ -760,6 +762,34 @@ public class ArcadeReader {
|
||||
DATA.put(newImg.getClass().getSimpleName(),SONG_DATA);
|
||||
|
||||
System.out.println(DATA);
|
||||
new Thread(){
|
||||
public void run() {
|
||||
//Threaded database update.
|
||||
for (String reader : sigPlace.SONG_DATABASE.keySet()) {
|
||||
Path dataPath = gamePath(reader);
|
||||
for (String song : sigPlace.SONG_DATABASE.get(reader).keySet()) {
|
||||
List<String> data = sigPlace.SONG_DATABASE.get(reader).get(song);
|
||||
try {
|
||||
Files.write(dataPath.resolve(song), data, Charset.defaultCharset(), StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
List<String> data = sigPlace.RECENT_PLAYS;
|
||||
try {
|
||||
Files.write(Paths.get("database","recentplays"), data, Charset.defaultCharset(), StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
data = sigPlace.RECENT_RECORDS;
|
||||
try {
|
||||
Files.write(Paths.get("database","recentrecords"), data, Charset.defaultCharset(), StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
1
database/popn/CYBER BeRMEA5 IC
Normal file
1
database/popn/CYBER BeRMEA5 IC
Normal file
@ -0,0 +1 @@
|
||||
{"game":"PopnReader","difficulty":41, "maxcombo":127, "notes":[425, 297, 127, 35, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":78495, "title":"CYBER "BeRMEA5 IC"}
|
1
database/popn/HYPER DRAMATIC Brit7aizel
Normal file
1
database/popn/HYPER DRAMATIC Brit7aizel
Normal file
@ -0,0 +1 @@
|
||||
{"game":"PopnReader","difficulty":41, "maxcombo":153, "notes":[438, 305, 101, 26, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":80173, "title":"HYPER DRAMATIC Brit7aizel<"}
|
1
database/popn/HYPER JAPANESQUE 32 Ro ~Rr0AEe ~
Normal file
1
database/popn/HYPER JAPANESQUE 32 Ro ~Rr0AEe ~
Normal file
@ -0,0 +1 @@
|
||||
{"game":"PopnReader","difficulty":40, "maxcombo":103, "notes":[496, 286, 96, 50, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":80814, "title":"HYPER JAPANESQUE 32 R+o# ~Rr0AEe ~"}
|
1
database/popn/MUpBR R K Treasure Hoard
Normal file
1
database/popn/MUpBR R K Treasure Hoard
Normal file
@ -0,0 +1 @@
|
||||
{"game":"PopnReader","difficulty":39, "maxcombo":122, "notes":[474, 369, 107, 34, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":79907, "title":"MUpBR R K Treasure Hoard"}
|
@ -0,0 +1,4 @@
|
||||
{"game":"PopnReader","difficulty":41, "maxcombo":127, "notes":[425, 297, 127, 35, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":78495, "title":"CYBER "BeRMEA5 IC"}
|
||||
{"game":"PopnReader","difficulty":41, "maxcombo":153, "notes":[438, 305, 101, 26, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":80173, "title":"HYPER DRAMATIC Brit7aizel<"}
|
||||
{"game":"PopnReader","difficulty":39, "maxcombo":122, "notes":[474, 369, 107, 34, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":79907, "title":"MUpBR R K Treasure Hoard"}
|
||||
{"game":"PopnReader","difficulty":40, "maxcombo":103, "notes":[496, 286, 96, 50, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":80814, "title":"HYPER JAPANESQUE 32 R+o# ~Rr0AEe ~"}
|
@ -0,0 +1,4 @@
|
||||
{"game":"PopnReader","difficulty":41, "maxcombo":127, "notes":[425, 297, 127, 35, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":78495, "title":"CYBER "BeRMEA5 IC"}
|
||||
{"game":"PopnReader","difficulty":41, "maxcombo":153, "notes":[438, 305, 101, 26, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":80173, "title":"HYPER DRAMATIC Brit7aizel<"}
|
||||
{"game":"PopnReader","difficulty":39, "maxcombo":122, "notes":[474, 369, 107, 34, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":79907, "title":"MUpBR R K Treasure Hoard"}
|
||||
{"game":"PopnReader","difficulty":40, "maxcombo":103, "notes":[496, 286, 96, 50, 0, 0, 0], "other":{"failed":false}, "pct":0.0, "rank":4, "score":80814, "title":"HYPER JAPANESQUE 32 R+o# ~Rr0AEe ~"}
|
Loading…
x
Reference in New Issue
Block a user