Submitting to database and loading old records all works now. (#8)
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
a599a2b8a2
commit
3125dcbfe6
@ -187,10 +187,6 @@ public class ArcadeReader {
|
||||
ArcadeReader.err(new Exception("Test \""+filename+"\" Failed:\nExpected:"+compare+"\nActual:"+r));
|
||||
return;
|
||||
}
|
||||
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;
|
||||
}
|
||||
ArcadeReader.success();
|
||||
}
|
||||
|
||||
@ -667,26 +663,6 @@ 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(String str) {
|
||||
switch (str) {
|
||||
case "DDRReader":{
|
||||
return Paths.get("database","ddr");
|
||||
}
|
||||
case "ITGReader":{
|
||||
return Paths.get("database","itg");
|
||||
}
|
||||
case "LoveLiveReader":{
|
||||
return Paths.get("database","lovelive");
|
||||
}
|
||||
case "PopnReader":{
|
||||
return Paths.get("database","popn");
|
||||
}
|
||||
case "SoundVoltexReader":{
|
||||
return Paths.get("database","sdvx");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static int getScore(String record) {
|
||||
String searchString = "\"score\":";
|
||||
int index = record.indexOf(searchString)+searchString.length();
|
||||
@ -761,16 +737,14 @@ public class ArcadeReader {
|
||||
SONG_DATA.put(convertTitle(newImg.getTitle()),RECORDS);
|
||||
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);
|
||||
Files.write(Paths.get("database",reader,song), data, Charset.defaultCharset(), StandardOpenOption.CREATE,StandardOpenOption.TRUNCATE_EXISTING,StandardOpenOption.WRITE);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
2
database/SoundVoltexReader/Ring Run Nyanll
Normal file
2
database/SoundVoltexReader/Ring Run Nyanll
Normal file
@ -0,0 +1,2 @@
|
||||
{"game":"SoundVoltexReader","difficulty":18, "maxcombo":257, "notes":[14, 88, 141, 1460, 155, 156, 130], "other":{"ex":5816,"chip_scritical":408,"chip_critical":296,"chip_near":244,"chip_error":67,"long_scritical":423,"long_error":11,"vol_scritical":629,"vol_error":66,"failed":true}, "pct":34.6, "rank":6, "score":8759328, "title":"Ring Run ! Nyanll"}
|
||||
{"game":"SoundVoltexReader","difficulty":18, "maxcombo":257, "notes":[14, 88, 141, 1460, 155, 156, 130], "other":{"ex":5816,"chip_scritical":408,"chip_critical":296,"chip_near":244,"chip_error":67,"long_scritical":423,"long_error":11,"vol_scritical":629,"vol_error":66,"failed":true}, "pct":34.6, "rank":6, "score":8759328, "title":"Ring Run ! Nyanll"}
|
||||
2
database/SoundVoltexReader/トマヨイ
Normal file
2
database/SoundVoltexReader/トマヨイ
Normal file
@ -0,0 +1,2 @@
|
||||
{"game":"SoundVoltexReader","difficulty":8, "maxcombo":234, "notes":[7, 84, 94, 1474, 99, 86, 75], "other":{"ex":4882,"chip_scritical":274,"chip_critical":193,"chip_near":170,"chip_error":32,"long_scritical":308,"long_error":13,"vol_scritical":892,"vol_error":37,"failed":true}, "pct":69.8, "rank":5, "score":9129755, "title":"トマヨイ"}
|
||||
{"game":"SoundVoltexReader","difficulty":8, "maxcombo":234, "notes":[7, 84, 94, 1474, 99, 86, 75], "other":{"ex":4882,"chip_scritical":274,"chip_critical":193,"chip_near":170,"chip_error":32,"long_scritical":308,"long_error":13,"vol_scritical":892,"vol_error":37,"failed":true}, "pct":69.8, "rank":5, "score":9129755, "title":"トマヨイ"}
|
||||
4
database/SoundVoltexReader/致達してしまった供らと夢と希望の最之果
Normal file
4
database/SoundVoltexReader/致達してしまった供らと夢と希望の最之果
Normal file
@ -0,0 +1,4 @@
|
||||
{"game":"SoundVoltexReader","difficulty":0, "maxcombo":233, "notes":[13, 59, 31, 495, 34, 56, 582], "other":{"ex":1696,"chip_scritical":72,"chip_critical":65,"chip_near":115,"chip_error":240,"long_scritical":79,"long_error":93,"vol_scritical":344,"vol_error":262,"failed":true}, "pct":0.0, "rank":9, "score":3019559, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":0, "maxcombo":233, "notes":[13, 59, 31, 495, 34, 56, 582], "other":{"ex":1696,"chip_scritical":72,"chip_critical":65,"chip_near":115,"chip_error":240,"long_scritical":79,"long_error":93,"vol_scritical":344,"vol_error":262,"failed":true}, "pct":0.0, "rank":9, "score":3019559, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":6, "maxcombo":87, "notes":[0, 3, 2, 160, 3, 0, 109], "other":{"ex":361,"chip_scritical":5,"chip_critical":5,"chip_near":3,"chip_error":26,"long_scritical":53,"long_error":79,"vol_scritical":102,"vol_error":4,"failed":true}, "pct":0.0, "rank":9, "score":2060643, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":6, "maxcombo":87, "notes":[0, 3, 2, 160, 3, 0, 109], "other":{"ex":361,"chip_scritical":5,"chip_critical":5,"chip_near":3,"chip_error":26,"long_scritical":53,"long_error":79,"vol_scritical":102,"vol_error":4,"failed":true}, "pct":0.0, "rank":9, "score":2060643, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
@ -1,3 +1,13 @@
|
||||
{"game":"SoundVoltexReader","difficulty":8, "maxcombo":234, "notes":[7, 84, 94, 1474, 99, 86, 75], "other":{"ex":4882,"chip_scritical":274,"chip_critical":193,"chip_near":170,"chip_error":32,"long_scritical":308,"long_error":13,"vol_scritical":892,"vol_error":37,"failed":true}, "pct":69.8, "rank":5, "score":9129755, "title":"トマヨイ"}
|
||||
{"game":"SoundVoltexReader","difficulty":18, "maxcombo":257, "notes":[14, 88, 141, 1460, 155, 156, 130], "other":{"ex":5816,"chip_scritical":408,"chip_critical":296,"chip_near":244,"chip_error":67,"long_scritical":423,"long_error":11,"vol_scritical":629,"vol_error":66,"failed":true}, "pct":34.6, "rank":6, "score":8759328, "title":"Ring Run ! Nyanll"}
|
||||
{"game":"SoundVoltexReader","difficulty":6, "maxcombo":87, "notes":[0, 3, 2, 160, 3, 0, 109], "other":{"ex":361,"chip_scritical":5,"chip_critical":5,"chip_near":3,"chip_error":26,"long_scritical":53,"long_error":79,"vol_scritical":102,"vol_error":4,"failed":true}, "pct":0.0, "rank":9, "score":2060643, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":0, "maxcombo":233, "notes":[13, 59, 31, 495, 34, 56, 582], "other":{"ex":1696,"chip_scritical":72,"chip_critical":65,"chip_near":115,"chip_error":240,"long_scritical":79,"long_error":93,"vol_scritical":344,"vol_error":262,"failed":true}, "pct":0.0, "rank":9, "score":3019559, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":8, "maxcombo":234, "notes":[7, 84, 94, 1474, 99, 86, 75], "other":{"ex":4882,"chip_scritical":274,"chip_critical":193,"chip_near":170,"chip_error":32,"long_scritical":308,"long_error":13,"vol_scritical":892,"vol_error":37,"failed":true}, "pct":69.8, "rank":5, "score":9129755, "title":"トマヨイ"}
|
||||
{"game":"SoundVoltexReader","difficulty":18, "maxcombo":257, "notes":[14, 88, 141, 1460, 155, 156, 130], "other":{"ex":5816,"chip_scritical":408,"chip_critical":296,"chip_near":244,"chip_error":67,"long_scritical":423,"long_error":11,"vol_scritical":629,"vol_error":66,"failed":true}, "pct":34.6, "rank":6, "score":8759328, "title":"Ring Run ! Nyanll"}
|
||||
{"game":"SoundVoltexReader","difficulty":6, "maxcombo":87, "notes":[0, 3, 2, 160, 3, 0, 109], "other":{"ex":361,"chip_scritical":5,"chip_critical":5,"chip_near":3,"chip_error":26,"long_scritical":53,"long_error":79,"vol_scritical":102,"vol_error":4,"failed":true}, "pct":0.0, "rank":9, "score":2060643, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":0, "maxcombo":233, "notes":[13, 59, 31, 495, 34, 56, 582], "other":{"ex":1696,"chip_scritical":72,"chip_critical":65,"chip_near":115,"chip_error":240,"long_scritical":79,"long_error":93,"vol_scritical":344,"vol_error":262,"failed":true}, "pct":0.0, "rank":9, "score":3019559, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":6, "maxcombo":87, "notes":[0, 3, 2, 160, 3, 0, 109], "other":{"ex":361,"chip_scritical":5,"chip_critical":5,"chip_near":3,"chip_error":26,"long_scritical":53,"long_error":79,"vol_scritical":102,"vol_error":4,"failed":true}, "pct":0.0, "rank":9, "score":2060643, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":0, "maxcombo":233, "notes":[13, 59, 31, 495, 34, 56, 582], "other":{"ex":1696,"chip_scritical":72,"chip_critical":65,"chip_near":115,"chip_error":240,"long_scritical":79,"long_error":93,"vol_scritical":344,"vol_error":262,"failed":true}, "pct":0.0, "rank":9, "score":3019559, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"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"}
|
||||
|
||||
@ -1,3 +1,12 @@
|
||||
{"game":"SoundVoltexReader","difficulty":8, "maxcombo":234, "notes":[7, 84, 94, 1474, 99, 86, 75], "other":{"ex":4882,"chip_scritical":274,"chip_critical":193,"chip_near":170,"chip_error":32,"long_scritical":308,"long_error":13,"vol_scritical":892,"vol_error":37,"failed":true}, "pct":69.8, "rank":5, "score":9129755, "title":"トマヨイ"}
|
||||
{"game":"SoundVoltexReader","difficulty":18, "maxcombo":257, "notes":[14, 88, 141, 1460, 155, 156, 130], "other":{"ex":5816,"chip_scritical":408,"chip_critical":296,"chip_near":244,"chip_error":67,"long_scritical":423,"long_error":11,"vol_scritical":629,"vol_error":66,"failed":true}, "pct":34.6, "rank":6, "score":8759328, "title":"Ring Run ! Nyanll"}
|
||||
{"game":"SoundVoltexReader","difficulty":6, "maxcombo":87, "notes":[0, 3, 2, 160, 3, 0, 109], "other":{"ex":361,"chip_scritical":5,"chip_critical":5,"chip_near":3,"chip_error":26,"long_scritical":53,"long_error":79,"vol_scritical":102,"vol_error":4,"failed":true}, "pct":0.0, "rank":9, "score":2060643, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":8, "maxcombo":234, "notes":[7, 84, 94, 1474, 99, 86, 75], "other":{"ex":4882,"chip_scritical":274,"chip_critical":193,"chip_near":170,"chip_error":32,"long_scritical":308,"long_error":13,"vol_scritical":892,"vol_error":37,"failed":true}, "pct":69.8, "rank":5, "score":9129755, "title":"トマヨイ"}
|
||||
{"game":"SoundVoltexReader","difficulty":18, "maxcombo":257, "notes":[14, 88, 141, 1460, 155, 156, 130], "other":{"ex":5816,"chip_scritical":408,"chip_critical":296,"chip_near":244,"chip_error":67,"long_scritical":423,"long_error":11,"vol_scritical":629,"vol_error":66,"failed":true}, "pct":34.6, "rank":6, "score":8759328, "title":"Ring Run ! Nyanll"}
|
||||
{"game":"SoundVoltexReader","difficulty":6, "maxcombo":87, "notes":[0, 3, 2, 160, 3, 0, 109], "other":{"ex":361,"chip_scritical":5,"chip_critical":5,"chip_near":3,"chip_error":26,"long_scritical":53,"long_error":79,"vol_scritical":102,"vol_error":4,"failed":true}, "pct":0.0, "rank":9, "score":2060643, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":0, "maxcombo":233, "notes":[13, 59, 31, 495, 34, 56, 582], "other":{"ex":1696,"chip_scritical":72,"chip_critical":65,"chip_near":115,"chip_error":240,"long_scritical":79,"long_error":93,"vol_scritical":344,"vol_error":262,"failed":true}, "pct":0.0, "rank":9, "score":3019559, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":6, "maxcombo":87, "notes":[0, 3, 2, 160, 3, 0, 109], "other":{"ex":361,"chip_scritical":5,"chip_critical":5,"chip_near":3,"chip_error":26,"long_scritical":53,"long_error":79,"vol_scritical":102,"vol_error":4,"failed":true}, "pct":0.0, "rank":9, "score":2060643, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"game":"SoundVoltexReader","difficulty":0, "maxcombo":233, "notes":[13, 59, 31, 495, 34, 56, 582], "other":{"ex":1696,"chip_scritical":72,"chip_critical":65,"chip_near":115,"chip_error":240,"long_scritical":79,"long_error":93,"vol_scritical":344,"vol_error":262,"failed":true}, "pct":0.0, "rank":9, "score":3019559, "title":"致達してしまった供らと夢と希望の最之果"}
|
||||
{"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"}
|
||||
|
||||
BIN
result.png
BIN
result.png
Binary file not shown.
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 14 KiB |
@ -36,9 +36,9 @@ public class sigPlace {
|
||||
static int PORT = 8080;
|
||||
static String SECRET = "";
|
||||
|
||||
final static HashMap<String,HashMap<String,List<String>>> SONG_DATABASE = new HashMap<>();
|
||||
final static List<String> RECENT_PLAYS = new ArrayList<>();
|
||||
final static List<String> RECENT_RECORDS = new ArrayList<>();
|
||||
static HashMap<String,HashMap<String,List<String>>> SONG_DATABASE = new HashMap<>();
|
||||
static List<String> RECENT_PLAYS = new ArrayList<>();
|
||||
static List<String> RECENT_RECORDS = new ArrayList<>();
|
||||
|
||||
static double COLOR_ROTATION = 0;
|
||||
|
||||
@ -86,6 +86,7 @@ public class sigPlace {
|
||||
final static int TRANSPARENT = new Color(0,0,0,0).getRGB();
|
||||
|
||||
public static void main(String[] args) {
|
||||
populateDatabase();
|
||||
/*String fontName = "sdvx_EXScore";
|
||||
String value = "00457";
|
||||
Path f = Paths.get("tests","sdvx8.png");
|
||||
@ -123,13 +124,13 @@ public class sigPlace {
|
||||
}*/
|
||||
//new PopnReader().interpretBoxes(Paths.get("tests","popn8.png"),true);
|
||||
//ArcadeReader.runTests();
|
||||
BufferedImage img;
|
||||
ArcadeReader.submitToDatabase(Paths.get("tests","popn8.png"));
|
||||
ArcadeReader.submitToDatabase(Paths.get("tests","popn7.png"));
|
||||
ArcadeReader.submitToDatabase(Paths.get("tests","popn6.png"));
|
||||
ArcadeReader.submitToDatabase(Paths.get("tests","popn5.png"));
|
||||
System.out.println(RECENT_PLAYS);
|
||||
System.out.println(RECENT_RECORDS);
|
||||
/*BufferedImage img;
|
||||
ArcadeReader.submitToDatabase(Paths.get("tests","sdvx1.png"));
|
||||
ArcadeReader.submitToDatabase(Paths.get("tests","sdvx2.png"));
|
||||
ArcadeReader.submitToDatabase(Paths.get("tests","sdvx3.png"));
|
||||
ArcadeReader.submitToDatabase(Paths.get("tests","sdvx4.png"));*/
|
||||
//System.out.println(RECENT_PLAYS);
|
||||
//System.out.println(RECENT_RECORDS);
|
||||
/* Path secretFile = Paths.get(".clientsecret");
|
||||
List<String> data;
|
||||
try {
|
||||
@ -438,6 +439,35 @@ public class sigPlace {
|
||||
}
|
||||
} */
|
||||
}
|
||||
private static void populateDatabase() {
|
||||
Iterator<Path> files;
|
||||
try {
|
||||
files = Files.walk(Paths.get("database")).iterator();
|
||||
while (files.hasNext()) {
|
||||
Path f = files.next();
|
||||
if (Files.isRegularFile(f)) {
|
||||
switch (f.getName(1).toString()) {
|
||||
case "recentplays":{
|
||||
RECENT_PLAYS=Files.readAllLines(f);
|
||||
}break;
|
||||
case "recentrecords":{
|
||||
RECENT_RECORDS=Files.readAllLines(f);
|
||||
}break;
|
||||
default:{
|
||||
HashMap<String,HashMap<String,List<String>>> DATA = SONG_DATABASE;
|
||||
HashMap<String,List<String>> data=DATA.getOrDefault(f.getName(1).toString(),new HashMap<>());
|
||||
List<String> records = Files.readAllLines(f);
|
||||
data.put(f.getFileName().toString(),records);
|
||||
DATA.put(f.getName(1).toString(),data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean validNumericalConstantCharacters(int lengthOfConstant, int j) {
|
||||
return storedCodeBlock.charAt(j)>='0'&&storedCodeBlock.charAt(j)<='9'||lengthOfConstant>0&&storedCodeBlock.charAt(j)=='.'||lengthOfConstant>0&&storedCodeBlock.charAt(j)>='A'&&lengthOfConstant>0&&storedCodeBlock.charAt(j)<='F'||lengthOfConstant>0&&storedCodeBlock.charAt(j)>='a'&&lengthOfConstant>0&&storedCodeBlock.charAt(j)<='f'||lengthOfConstant>0&&storedCodeBlock.charAt(j)=='x'||lengthOfConstant>0&&storedCodeBlock.charAt(j)=='X';
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user