diff --git a/ArcadeReader.java b/ArcadeReader.java index 0db2849..557c09d 100644 --- a/ArcadeReader.java +++ b/ArcadeReader.java @@ -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 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(); } diff --git a/database/popn/CYBER BeRMEA5 IC b/database/PopnReader/CYBER BeRMEA5 IC similarity index 100% rename from database/popn/CYBER BeRMEA5 IC rename to database/PopnReader/CYBER BeRMEA5 IC diff --git a/database/popn/HYPER DRAMATIC Brit7aizel b/database/PopnReader/HYPER DRAMATIC Brit7aizel similarity index 100% rename from database/popn/HYPER DRAMATIC Brit7aizel rename to database/PopnReader/HYPER DRAMATIC Brit7aizel diff --git a/database/popn/HYPER JAPANESQUE 32 Ro ~Rr0AEe ~ b/database/PopnReader/HYPER JAPANESQUE 32 Ro ~Rr0AEe ~ similarity index 100% rename from database/popn/HYPER JAPANESQUE 32 Ro ~Rr0AEe ~ rename to database/PopnReader/HYPER JAPANESQUE 32 Ro ~Rr0AEe ~ diff --git a/database/popn/MUpBR R K Treasure Hoard b/database/PopnReader/MUpBR R K Treasure Hoard similarity index 100% rename from database/popn/MUpBR R K Treasure Hoard rename to database/PopnReader/MUpBR R K Treasure Hoard diff --git a/database/SoundVoltexReader/Ring Run Nyanll b/database/SoundVoltexReader/Ring Run Nyanll new file mode 100644 index 0000000..6a998ff --- /dev/null +++ b/database/SoundVoltexReader/Ring Run Nyanll @@ -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"} diff --git a/database/SoundVoltexReader/トマヨイ b/database/SoundVoltexReader/トマヨイ new file mode 100644 index 0000000..f0ea2e9 --- /dev/null +++ b/database/SoundVoltexReader/トマヨイ @@ -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":"トマヨイ"} diff --git a/database/SoundVoltexReader/致達してしまった供らと夢と希望の最之果 b/database/SoundVoltexReader/致達してしまった供らと夢と希望の最之果 new file mode 100644 index 0000000..21550cf --- /dev/null +++ b/database/SoundVoltexReader/致達してしまった供らと夢と希望の最之果 @@ -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":"致達してしまった供らと夢と希望の最之果"} diff --git a/database/recentplays b/database/recentplays index 9230277..c533ffd 100644 --- a/database/recentplays +++ b/database/recentplays @@ -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"} diff --git a/database/recentrecords b/database/recentrecords index 9230277..6ed5e17 100644 --- a/database/recentrecords +++ b/database/recentrecords @@ -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"} diff --git a/result.png b/result.png index 87be958..073fd41 100644 Binary files a/result.png and b/result.png differ diff --git a/sigPlace.java b/sigPlace.java index 88831fb..afb78f0 100644 --- a/sigPlace.java +++ b/sigPlace.java @@ -36,9 +36,9 @@ public class sigPlace { static int PORT = 8080; static String SECRET = ""; - final static HashMap>> SONG_DATABASE = new HashMap<>(); - final static List RECENT_PLAYS = new ArrayList<>(); - final static List RECENT_RECORDS = new ArrayList<>(); + static HashMap>> SONG_DATABASE = new HashMap<>(); + static List RECENT_PLAYS = new ArrayList<>(); + static List 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 data; try { @@ -438,6 +439,35 @@ public class sigPlace { } } */ } + private static void populateDatabase() { + Iterator 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>> DATA = SONG_DATABASE; + HashMap> data=DATA.getOrDefault(f.getName(1).toString(),new HashMap<>()); + List 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'; } diff --git a/sub.png b/sub.png index 5ec5e12..d664f7c 100644 Binary files a/sub.png and b/sub.png differ