• R/O
  • SSH
  • HTTPS

bms-dtimporter: Commit


Commit MetaInfo

Revision234 (tree)
Time2016-09-09 01:19:12
Authorbms_normal2

Log Message

難易度表パーサをjbmstable-parserに移行、それに伴う修正

Change Summary

Incremental Difference

--- trunk/bms_dtimporter/src/bms/angolmois/AngolmoisAccessor.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/angolmois/AngolmoisAccessor.java (revision 234)
@@ -17,7 +17,6 @@
1717 import bms.player.lunaticrave2.RivalData;
1818 import bms.player.lunaticrave2.SongData;
1919 import bms.table.*;
20-import bms.table.DifficultyTable.Grade;
2120 import bms.tool.glassist.MainController;
2221 import bms.tool.glassist.external.BMSPlayerAccessor;
2322
@@ -254,10 +253,10 @@
254253 for(BMSTableElement te : tes) {
255254 IRScoreData ir = null;
256255 for(IRScoreData sc : score) {
257- if(sc.getHash().equals(te.getHash())) {
256+ if(sc.getHash().equals(te.getMD5())) {
258257 if(ir == null) {
259258 ir = new IRScoreData();
260- ir.setHash(te.getHash());
259+ ir.setHash(te.getMD5());
261260 }
262261 if(ir.getExscore() < sc.getExscore()) {
263262 ir.setPg(sc.getPg());
@@ -283,7 +282,7 @@
283282 }
284283
285284 @Override
286- public IRScoreData getGradeData(String value, Grade grade) {
285+ public IRScoreData getGradeData(String value, Course grade) {
287286 return null;
288287 }
289288
@@ -365,7 +364,7 @@
365364 Map<BMSTableElement, SongData> result = new HashMap<BMSTableElement, SongData>();
366365 try {
367366 for (BMSTableElement te : datas) {
368- SongData[] m =songdb.getSongDatas("hash", te.getHash(), config.getPath());
367+ SongData[] m =songdb.getSongDatas("hash", te.getMD5(), config.getPath());
369368
370369 if (m.length > 0) {
371370 SongData song = m[0];
--- trunk/bms_dtimporter/src/bms/bmiidxview/BMIIDXViewAccessor.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/bmiidxview/BMIIDXViewAccessor.java (revision 234)
@@ -18,7 +18,6 @@
1818 import bms.player.lunaticrave2.SongData;
1919 import bms.table.BMSTable;
2020 import bms.table.BMSTableElement;
21-import bms.table.DifficultyTable.Grade;
2221 import bms.table.DifficultyTableElement;
2322 import bms.tool.glassist.MainController;
2423 import bms.tool.glassist.external.BMSPlayerAccessor;
@@ -100,7 +99,7 @@
10099 Map<BMSTableElement, SongData> result = new HashMap<BMSTableElement, SongData>();
101100 try {
102101 for (BMSTableElement te : datas) {
103- SongData[] m =songdb.getSongDatas("hash", te.getHash(), config.getPath());
102+ SongData[] m =songdb.getSongDatas("hash", te.getMD5(), config.getPath());
104103
105104 if (m.length > 0) {
106105 SongData song = m[0];
--- trunk/bms_dtimporter/src/bms/lr2/CustomFolderGenerator.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/lr2/CustomFolderGenerator.java (revision 234)
@@ -167,7 +167,7 @@
167167 List<File> files = new ArrayList(Arrays.asList(miss.listFiles()));
168168 for (int i = 0; i < this.length(); i++) {
169169 File ff = new File(miss.getPath() + "/" + header + "_"
170- + String.format("%03d", i) + "_"
170+ + String.format("%03d", i) + "__"
171171 + this.convertSafeChar(this.getFileID(i))
172172 + ".lr2folder");
173173 if (!ff.exists()) {
@@ -302,9 +302,9 @@
302302
303303 @Override
304304 protected String getCommand(int index) {
305- return "tag GLOB '*t"
305+ return "tag GLOB '*("
306306 + dt.getTag()
307- + "[0-9][0-9][0-9]*' AND "
307+ + "[0-9][0-9][0-9])*' AND "
308308 + (index != 5 ? ("clear = " + (5 - index))
309309 : "(clear = 0 Or (clear ISNULL))");
310310 }
@@ -358,7 +358,7 @@
358358
359359 @Override
360360 protected String getCommand(int index) {
361- return "tag GLOB '*t" + dt.getTag() + "[0-9][0-9][0-9]*' AND "
361+ return "tag GLOB '*(" + dt.getTag() + "[0-9][0-9][0-9])*' AND "
362362
363363 // BPMによる条件
364364 + limit[index];
@@ -420,7 +420,7 @@
420420
421421 @Override
422422 protected String getCommand(int index) {
423- return "tag GLOB '*t" + dt.getTag() + "[0-9][0-9][0-9]*' AND "
423+ return "tag GLOB '*(" + dt.getTag() + "[0-9][0-9][0-9])*' AND "
424424 + limit[index];
425425 }
426426
@@ -461,8 +461,8 @@
461461
462462 @Override
463463 protected String getCommand(int index) {
464- return "tag LIKE '%t" + dt.getTag() + String.format("%03d", index + 1)
465- + "%'";
464+ return "tag LIKE '%(" + dt.getTag() + String.format("%03d", index + 1)
465+ + ")%'";
466466 }
467467
468468 @Override
@@ -505,8 +505,8 @@
505505
506506 @Override
507507 protected String getCommand(int index) {
508- return "tag LIKE '%t" + dt.getTag() + String.format("%03d", index + 1)
509- + "%'";
508+ return "tag LIKE '%(" + dt.getTag() + String.format("%03d", index + 1)
509+ + ")%'";
510510 }
511511
512512 @Override
@@ -548,8 +548,8 @@
548548
549549 @Override
550550 protected String getCommand(int index) {
551- return "tag LIKE '%t" + dt.getTag() + String.format("%03d", index + 1)
552- + "%' AND maxbpm != minbpm";
551+ return "tag LIKE '%(" + dt.getTag() + String.format("%03d", index + 1)
552+ + ")%' AND maxbpm != minbpm";
553553 }
554554
555555 @Override
@@ -602,7 +602,7 @@
602602
603603 @Override
604604 protected String getCommand(int index) {
605- return "tag GLOB '*t" + dt.getTag() + "[0-9][0-9][0-9]*' AND rank = "
605+ return "tag GLOB '*(" + dt.getTag() + "[0-9][0-9][0-9])*' AND rank = "
606606 + (8 - index);
607607 }
608608
@@ -642,8 +642,8 @@
642642
643643 @Override
644644 protected String getCommand(int index) {
645- return "tag GLOB '*t" + dt.getTag()
646- + "[0-9][0-9][0-9]*' AND (totalnotes * " + missrange[index]
645+ return "tag GLOB '*(" + dt.getTag()
646+ + "[0-9][0-9][0-9])*' AND (totalnotes * " + missrange[index]
647647 + " / 100) <= minbp AND minbp < (totalnotes * "
648648 + missrange[index + 1] + " / 100)";
649649 }
@@ -687,11 +687,11 @@
687687 @Override
688688 protected String getCommand(int index) {
689689 if (index < 4) {
690- return "tag LIKE '%t" + dt.getTag() + String.format("S%02d", index)
691- + "%'" + " AND " + "clear < " + (5 - index);
690+ return "tag LIKE '%(" + dt.getTag() + String.format("S%02d", index)
691+ + ")%'" + " AND " + "clear < " + (5 - index);
692692 }
693- return "tag LIKE '%t" + dt.getTag() + String.format("S%02d", index)
694- + "%'" + " AND " + "clear < " + (13 - index);
693+ return "tag LIKE '%(" + dt.getTag() + String.format("S%02d", index)
694+ + ")%'" + " AND " + "rank < " + (13 - index);
695695 }
696696
697697 @Override
--- trunk/bms_dtimporter/src/bms/lr2/LR2ConfigurationPresenter.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/lr2/LR2ConfigurationPresenter.java (revision 234)
@@ -507,6 +507,10 @@
507507 Logger.getGlobal().severe("IRmemoデータインポート中の例外:" + e1.getMessage());
508508 }
509509 }
510+
511+ public void cleanAllTags() {
512+
513+ }
510514
511515 class HSFIXListCell extends ListCell<Integer> {
512516 @Override
--- trunk/bms_dtimporter/src/bms/lr2/LunaticRave2Accessor.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/lr2/LunaticRave2Accessor.java (revision 234)
@@ -10,30 +10,16 @@
1010 import javax.xml.bind.JAXBException;
1111 import javax.xml.bind.Marshaller;
1212 import javax.xml.bind.Unmarshaller;
13-import javax.xml.parsers.*;
14-import javax.xml.transform.*;
15-import javax.xml.transform.dom.DOMSource;
16-import javax.xml.transform.stream.StreamResult;
1713
1814 import org.apache.commons.io.FileUtils;
19-import org.w3c.dom.*;
20-import org.xml.sax.SAXException;
2115
2216 import utils.sql.SqliteDBManager;
23-import javafx.concurrent.Task;
2417 import javafx.fxml.FXMLLoader;
2518 import javafx.scene.control.TabPane;
2619 import bms.*;
27-import bms.player.lunaticrave2.IRScoreData;
28-import bms.player.lunaticrave2.IRScoreListReader;
29-import bms.player.lunaticrave2.LunaticRave2ScoreDatabaseManager;
30-import bms.player.lunaticrave2.LunaticRave2SongDatabaseManager;
31-import bms.player.lunaticrave2.PlayerData;
32-import bms.player.lunaticrave2.RivalData;
33-import bms.player.lunaticrave2.SongData;
20+import bms.player.lunaticrave2.*;
3421 import bms.player.lunaticrave2.config.Config;
3522 import bms.table.*;
36-import bms.table.DifficultyTable.Grade;
3723 import bms.tool.glassist.MainController;
3824 import bms.tool.glassist.external.BMSPlayerAccessor;
3925
@@ -135,14 +121,10 @@
135121
136122 public String getSongURL(BMSTableElement dte) {
137123 return "http://www.dream-pro.info/~lavalse/LR2IR/search.cgi?mode=ranking&bmsmd5="
138- + dte.getHash();
124+ + dte.getMD5();
139125 }
140126
141127 public void playBMS(String songpath) {
142- if (config.getUnofficialPatch() > 0) {
143- controller.showErrorMessage("本機能は非正規版Lunatic Rave 2には対応していません");
144- return;
145- }
146128 try {
147129 if (songpath != null) {
148130 ProcessBuilder pb = new ProcessBuilder(config.getPath()
@@ -173,17 +155,14 @@
173155 @Override
174156 public Map<BMSTableElement, IRScoreData> getScoreDatas(String playername,
175157 BMSTableElement[] tes) {
176- if (config.getUnofficialPatch() > 0) {
177- return new HashMap();
178- }
179158 String[] hash = new String[tes.length];
180159 for(int i = 0;i < hash.length;i++) {
181- hash[i] = tes[i].getHash();
160+ hash[i] = tes[i].getMD5();
182161 }
183162 Map<String, IRScoreData> m = lr2db.getScoreDatas(playername, hash, false);
184- Map<BMSTableElement, IRScoreData> result = new HashMap();
163+ Map<BMSTableElement, IRScoreData> result = new HashMap<BMSTableElement, IRScoreData>();
185164 for(BMSTableElement te : tes) {
186- IRScoreData score = m.get(te.getHash());
165+ IRScoreData score = m.get(te.getMD5());
187166 if(score != null) {
188167 score.setClear(clear[score.getClear()]);
189168 }
@@ -197,12 +176,12 @@
197176 BMSTableElement[] tes) {
198177 String[] hash = new String[tes.length];
199178 for(int i = 0;i < hash.length;i++) {
200- hash[i] = tes[i].getHash();
179+ hash[i] = tes[i].getMD5();
201180 }
202181 Map<String, IRScoreData> m =lr2db.getRivalScoreDatas(irid, hash);
203- Map<BMSTableElement, IRScoreData> result = new HashMap();
182+ Map<BMSTableElement, IRScoreData> result = new HashMap<BMSTableElement, IRScoreData>();
204183 for(BMSTableElement te : tes) {
205- IRScoreData score = m.get(te.getHash());
184+ IRScoreData score = m.get(te.getMD5());
206185 if(score != null) {
207186 score.setClear(clear[score.getClear()]);
208187 }
@@ -244,7 +223,7 @@
244223 }
245224 dt.setTag(dt.getTag() + str);
246225 // ハッシュ-レベルのマップ作成
247- Map<String, List<String>> tagmap = new HashMap<String, List<String>>();
226+ Map<String, String[]> tagmap = new HashMap<String, String[]>();
248227 Map<String, Integer> map2 = new HashMap<String, Integer>();
249228 List<DifficultyTableElement> dtes = new ArrayList<DifficultyTableElement>(
250229 Arrays.asList(dt.getElements()));
@@ -264,9 +243,10 @@
264243 }
265244 rivalScores.add(getRivalScoreDatas(rival, dte));
266245 }
246+ List<String> tag = new ArrayList<String>();
267247 for (int i = 0; i < dte.length; i++) {
268- if (dte[i].getHash() != null) {
269- List<String> tag = new ArrayList<String>();
248+ if (dte[i].getMD5() != null) {
249+ tag.clear();
270250 String[] levels = dt.getLevelDescription();
271251 for (int j = 0; j < levels.length; j++) {
272252 if (levels[j].equals(dte[i].getDifficultyID())) {
@@ -273,7 +253,7 @@
273253 tag.add(dt.getTag() + String.format("%03d", j + 1));
274254 String s = levels[j].replaceAll("\\D", "");
275255 if (s.length() > 0) {
276- map2.put(dte[i].getHash(), Integer.parseInt(s)
256+ map2.put(dte[i].getMD5(), Integer.parseInt(s)
277257 + level);
278258 }
279259 break;
@@ -280,7 +260,7 @@
280260 }
281261 }
282262 // ライバルデータとの比較、負けているデータ取得
283- int maxclear = 15;
263+ int maxclear = 0;
284264 int maxscore = -1;
285265 for (Map<BMSTableElement, IRScoreData> rivalScore : rivalScores) {
286266 if (playerScore.get(dte[i]) != null
@@ -288,8 +268,8 @@
288268 int rclear = rivalScore.get(dte[i]).getClear();
289269 if (rclear > 1
290270 && playerScore.get(dte[i]).getClear() < rclear) {
291- maxclear = (maxclear < 10 - rclear) ? maxclear
292- : 10- rclear;
271+ maxclear = (maxclear > rclear) ? maxclear
272+ : rclear;
293273 }
294274 if (playerScore.get(dte[i]).getExscore() < rivalScore
295275 .get(dte[i]).getExscore()) {
@@ -298,13 +278,18 @@
298278 }
299279 }
300280 }
301- if (maxclear != 10) {
302- tag.add(dt.getTag() + "S0" + maxclear);
281+ if (maxclear != 0) {
282+ for(int index = 5;index >= 2;index--) {
283+ if(clear[index] == maxclear) {
284+ tag.add(dt.getTag() + "S0" + (5 - index));
285+ break;
286+ }
287+ }
303288 }
304289 if (maxscore != -1) {
305290 tag.add(dt.getTag() + "S0" + (maxscore + 4));
306291 }
307- tagmap.put(dte[i].getHash(), tag);
292+ tagmap.put(dte[i].getMD5(), tag.toArray(new String[tag.size()]));
308293 } else if (dte[i].getBMSID() != 0) {
309294 // TODO bmsidのみの譜面についてhash補完
310295 }
@@ -432,7 +417,7 @@
432417 Map<BMSTableElement, SongData> result = new HashMap<BMSTableElement, SongData>();
433418 try {
434419 for (BMSTableElement te : datas) {
435- SongData[] m =songdb.getSongDatas("hash", te.getHash(), config.getPath());
420+ SongData[] m =songdb.getSongDatas("hash", te.getMD5(), config.getPath());
436421
437422 if (m.length > 0) {
438423 SongData song = m[0];
@@ -541,9 +526,6 @@
541526
542527 @Override
543528 public final String updatePlaylog(String playerName) {
544- if (config.getUnofficialPatch() > 0) {
545- return null;
546- }
547529 try {
548530 playlogDao.updateMusicInformation();
549531 String[] players = getPlayerList();
@@ -656,12 +638,9 @@
656638 }
657639
658640 @Override
659- public IRScoreData getGradeData(String value, Grade grade) {
660- if (config.getUnofficialPatch() > 0) {
661- return null;
662- }
641+ public IRScoreData getGradeData(String value, Course grade) {
663642 String hash = "000000000020000000000000________";
664- for (String s : grade.getHashes()) {
643+ for (String s : grade.getHash()) {
665644 hash += s;
666645 }
667646 Map<String, IRScoreData> m = lr2db.getScoreDatas(value,
@@ -703,10 +682,6 @@
703682
704683 @Override
705684 public void showPlayConfiguration() {
706- if (((LunaticRave2Configuration) config).getUnofficialPatch() > 0) {
707- controller.showErrorMessage("本機能は非正規版Lunatic Rave 2には対応していません");
708- return;
709- }
710685 try {
711686 FXMLLoader loader = new FXMLLoader(
712687 MainFrame.class
--- trunk/bms_dtimporter/src/bms/lr2/LunaticRave2Configuration.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/lr2/LunaticRave2Configuration.java (revision 234)
@@ -40,8 +40,6 @@
4040 */
4141 private String custompath = new File("CustomFolder").getAbsolutePath();
4242
43- private int hd = 0;
44-
4543 public LunaticRave2Configuration() {
4644 this.setBMSPlayerName("Lunatic Rave 2");
4745 this.setName("LR2");
@@ -73,14 +71,6 @@
7371 this.playlog = playlog;
7472 }
7573
76- public int getUnofficialPatch() {
77- return hd;
78- }
79-
80- public void setUnofficialPatch(int hd) {
81- this.hd = hd;
82- }
83-
8474 @Override
8575 public BMSPlayerConfigurationEditor createEditor() throws IOException{
8676 FXMLLoader loader = new FXMLLoader(
@@ -108,29 +98,7 @@
10898 return false;
10999 }
110100
111- final String[] lmd5 = { "b667521902991e7a967918a872817149",
112- "e9654f4d42db17ec0e0a774b0555dcda" , "18fc9a2445106dd4194e71be98075fbe"};
113- File f = new File(path);
114- for (File file : f.listFiles()) {
115- if (FilenameUtils.isExtension(file.getName(), "exe")) {
116- MessageDigest digest;
117- try {
118- digest = MessageDigest.getInstance("MD5");
119- DigestInputStream is = new DigestInputStream(new FileInputStream(file), digest);
120- IOUtils.toByteArray(is);
121-
122- if(Arrays.asList(lmd5).contains(Resource.convertHexString(digest.digest()))) {
123- hd++;
124- this.setBMSPlayerName("Lunatic Rave 2 Unofficial");
125- return true;
126- }
127- } catch (NoSuchAlgorithmException | IOException e) {
128- e.printStackTrace();
129- }
130- }
131- }
132101 this.setBMSPlayerName("Lunatic Rave 2");
133- hd = 0;
134102 return true;
135103 }
136104 }
--- trunk/bms_dtimporter/src/bms/player/lunaticrave2/LunaticRave2SongDatabaseManager.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/player/lunaticrave2/LunaticRave2SongDatabaseManager.java (revision 234)
@@ -338,7 +338,7 @@
338338 return result.toArray(new SongData[0]);
339339 }
340340
341- public void appendDifficultyTableTag(String mark, Map<String, List<String>> hashtag) {
341+ public void appendDifficultyTableTag(String mark, Map<String, String[]> hashtag) {
342342 this.appendDifficultyTableTag(mark, hashtag, new HashMap<String, Integer>());
343343 }
344344
@@ -352,43 +352,36 @@
352352 * @param hashlevel
353353 * <ハッシュ値, レベル>のマップ
354354 */
355- public Map<String, Integer> appendDifficultyTableTag(String mark, Map<String, List<String>> hashtag,
355+ public Map<String, Integer> appendDifficultyTableTag(String mark, Map<String, String[]> hashtag,
356356 Map<String, Integer> hashlevel) {
357357 Map<String, Integer> backup = new HashMap<String, Integer>();
358358 DataSource ds = songdb.getDataSource();
359- Connection con = null;
359+ QueryRunner qr = new QueryRunner();
360360
361- try {
362- con = ds.getConnection();
361+ try (Connection con = ds.getConnection()) {
363362 con.setAutoCommit(false);
364363 Statement stmt = con.createStatement();
365364 // タグ全消去
366365 long time = System.currentTimeMillis();
367366 for (int id = 0; id < hashtag.keySet().size() + 5; id++) {
368- String did = String.format("t" + mark + "%03d", id);
369- stmt.executeUpdate("UPDATE song SET tag = replace(replace(tag, '" + did
370- + "', ''), ',,', ',') WHERE tag like '%" + did + "%'");
367+ String did = String.format("(" + mark + "%03d)", id);
368+ qr.update(con, "UPDATE song SET tag = replace(tag, ? , '') WHERE tag LIKE ?", did,
369+ "%" + did + "%");
371370 // System.out.println("タグ消去:" + did);
372371 }
373- for (int id = 0; id < hashtag.keySet().size() + 5; id++) {
374- String did = String.format("t" + mark + "%02d", id);
375- stmt.executeUpdate("UPDATE song SET tag = replace(replace(tag, '" + did
376- + "', ''), ',,', ',') WHERE tag like '%" + did + "%'");
377- }
378372 for (int id = 0; id < 10; id++) {
379- String did = String.format("t" + mark + "S%02d", id);
380- stmt.executeUpdate("UPDATE song SET tag = replace(replace(tag, '" + did
381- + "', ''), ',,', ',') WHERE tag like '%" + did + "%'");
373+ String did = String.format("(" + mark + "S%02d)", id);
374+ qr.update(con, "UPDATE song SET tag = replace(tag, ? , '') WHERE tag LIKE ?", did,
375+ "%" + did + "%");
382376 }
383377
384378 for (String hash : hashtag.keySet()) {
385- List<String> tags = hashtag.get(hash);
386- String tag = "";
387- for (String s : tags) {
388- tag += ",t" + s;
379+ StringBuilder tag = new StringBuilder();
380+ for (String s : hashtag.get(hash)) {
381+ tag.append('(').append(s).append(')');
389382 }
390- stmt.executeUpdate("UPDATE song SET tag = CASE WHEN tag IS NULL THEN '" + tag + "' ELSE tag||'" + tag
391- + "' end WHERE hash = '" + hash + "'");
383+ qr.update(con, "UPDATE song SET tag = CASE WHEN tag IS NULL THEN ? ELSE tag || ? end WHERE hash = ?",
384+ tag.toString(), tag.toString(), hash);
392385 // レベル表記があればレベルも変更
393386 if (hashlevel.get(hash) != null) {
394387 // 変更前レベルのバックアップ
@@ -399,8 +392,7 @@
399392 backup.put(hash, level);
400393 }
401394 }
402- stmt.executeUpdate("UPDATE song SET level = " + hashlevel.get(hash) + " WHERE hash = '" + hash
403- + "'");
395+ qr.update(con, "UPDATE song SET level = ? WHERE hash = ?'", hashlevel.get(hash), hash);
404396 // System.out.println("レベル更新:" + hash + " -> " +
405397 // hashlevel.get(hash));
406398 }
@@ -412,13 +404,6 @@
412404 Logger.getGlobal().info("タグ更新 所要時間(ms):" + (System.currentTimeMillis() - time));
413405 } catch (Exception e) {
414406 Logger.getGlobal().severe("song.dbタグ付加時の例外:" + e.getMessage());
415- } finally {
416- if (con != null) {
417- try {
418- con.close();
419- } catch (SQLException e) {
420- }
421- }
422407 }
423408
424409 return backup;
@@ -472,7 +457,6 @@
472457 updater.updateSongDatas(paths);
473458 }
474459
475-
476460 static int Polynomial = 0xEDB88320;
477461
478462 public String crc32(String path, String[] rootdirs, String bmspath) {
@@ -498,7 +482,7 @@
498482 }
499483 return Integer.toHexString(~crc); // same as crc ^ 0xFFFFFFFF
500484 }
501-
485+
502486 /**
503487 * song database更新用クラス
504488 *
@@ -648,20 +632,20 @@
648632 addsongpaths.add(f);
649633 if (sd.getDifficulty() == 0) {
650634 final String fulltitle = (sd.getTitle() + sd.getSubtitle()).toLowerCase();
651- if(fulltitle.contains("beginner")) {
635+ if (fulltitle.contains("beginner")) {
652636 sd.setDifficulty(1);
653- } else if(fulltitle.contains("normal")) {
654- sd.setDifficulty(2);
655- } else if(fulltitle.contains("hyper")) {
656- sd.setDifficulty(3);
657- } else if(fulltitle.contains("another")) {
658- sd.setDifficulty(4);
659- } else if(fulltitle.contains("insane")) {
660- sd.setDifficulty(5);
637+ } else if (fulltitle.contains("normal")) {
638+ sd.setDifficulty(2);
639+ } else if (fulltitle.contains("hyper")) {
640+ sd.setDifficulty(3);
641+ } else if (fulltitle.contains("another")) {
642+ sd.setDifficulty(4);
643+ } else if (fulltitle.contains("insane")) {
644+ sd.setDifficulty(5);
661645 } else {
662- final List<SongData> nodifsongs = nodifsonglists[sd.getMode() == 5 ? 0
663- : (sd.getMode() == 7 ? 1 : (sd.getMode() == 9 ? 2
664- : (sd.getMode() == 10 ? 3 : 4)))];
646+ final List<SongData> nodifsongs = nodifsonglists[sd.getMode() == 5 ? 0 : (sd
647+ .getMode() == 7 ? 1
648+ : (sd.getMode() == 9 ? 2 : (sd.getMode() == 10 ? 3 : 4)))];
665649 if (nodifsongs.size() == 0
666650 || nodifsongs.get(nodifsongs.size() - 1).getLevel() <= sd.getLevel()) {
667651 nodifsongs.add(sd);
@@ -672,7 +656,7 @@
672656 break;
673657 }
674658 }
675- }
659+ }
676660 }
677661 }
678662 } else {
@@ -683,14 +667,14 @@
683667 }
684668 }
685669 // difficulty未定義のsongdataのdifiicultyを定義
686- for(List<SongData> nodifsongs : nodifsonglists) {
687- if(nodifsongs.size() == 0) {
670+ for (List<SongData> nodifsongs : nodifsonglists) {
671+ if (nodifsongs.size() == 0) {
688672 continue;
689673 }
690674 int difficulty = (nodifsongs.get(0).getLevel() >= 13) ? 5 : (nodifsongs.get(0).getLevel() + 2) / 3;
691675 int prevlevel = Integer.MIN_VALUE;
692676 for (SongData sd : nodifsongs) {
693- if(prevlevel == sd.getLevel()) {
677+ if (prevlevel == sd.getLevel()) {
694678 difficulty--;
695679 }
696680 prevlevel = sd.getLevel();
@@ -698,28 +682,26 @@
698682 if (difficulty < 5) {
699683 difficulty++;
700684 }
701- }
685+ }
702686 }
703687
704688 for (int i = 0; i < addsongs.size(); i++) {
705689 final SongData sd = addsongs.get(i);
706690 final Path f = addsongpaths.get(i);
707- String sql = "INSERT OR REPLACE INTO song " + "(hash, title, subtitle, genre, artist, subartist, tag, path, type, "
691+ String sql = "INSERT OR REPLACE INTO song "
692+ + "(hash, title, subtitle, genre, artist, subartist, tag, path, type, "
708693 + "folder, stagefile, banner, backbmp, parent, level, difficulty, "
709694 + "maxbpm, minbpm, mode, judge, longnote, bga, random, "
710695 + "date, favorite, txt, karinotes, adddate, exlevel)"
711696 + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);";
712- qr.update(conn, sql, sd.getHash(), sd.getTitle(), sd.getSubtitle(), sd.getGenre(),
713- sd.getArtist(), sd.getSubartist(),
714- tags.get(sd.getHash()) != null ? tags.get(sd.getHash()) : "", f.startsWith(path) ? path
715- .relativize(f).toString() : f.toString(), 0,
716- crc32(f.getParent().toString(), rootdirs, path.toString()), sd.getStagefile(),
717- sd.getBanner(), sd.getBackbmp(),
718- crc32(f.getParent().getParent().toString(), rootdirs, path.toString()),
719- sd.getLevel(), sd.getDifficulty(), sd.getMaxbpm(), sd.getMinbpm(),
720- sd.getMode(), sd.getJudge(), sd.getLongnote(), sd.getBga(),
721- sd.getRandom(), Files.getLastModifiedTime(f).toMillis() / 1000, 0, sd.getTxt(),
722- sd.getKarinotes(), Calendar.getInstance().getTimeInMillis() / 1000, 0);
697+ qr.update(conn, sql, sd.getHash(), sd.getTitle(), sd.getSubtitle(), sd.getGenre(), sd.getArtist(),
698+ sd.getSubartist(), tags.get(sd.getHash()) != null ? tags.get(sd.getHash()) : "",
699+ f.startsWith(path) ? path.relativize(f).toString() : f.toString(), 0,
700+ crc32(f.getParent().toString(), rootdirs, path.toString()), sd.getStagefile(), sd.getBanner(),
701+ sd.getBackbmp(), crc32(f.getParent().getParent().toString(), rootdirs, path.toString()),
702+ sd.getLevel(), sd.getDifficulty(), sd.getMaxbpm(), sd.getMinbpm(), sd.getMode(), sd.getJudge(),
703+ sd.getLongnote(), sd.getBga(), sd.getRandom(), Files.getLastModifiedTime(f).toMillis() / 1000,
704+ 0, sd.getTxt(), sd.getKarinotes(), Calendar.getInstance().getTimeInMillis() / 1000, 0);
723705 count++;
724706 }
725707 // ディレクトリ内のファイルに存在しないレコードを削除
--- trunk/bms_dtimporter/src/bms/table/EventTableElement.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/table/EventTableElement.java (nonexistent)
@@ -1,25 +0,0 @@
1-package bms.table;
2-
3-public class EventTableElement extends BMSTableElement {
4- // TODO 楽曲入手状況のみが重要。スコアは不要かも
5- // TODO 投票状況とか
6-
7- private String team;
8- private String artist;
9-
10- public String getArtist() {
11- return artist;
12- }
13-
14- public void setArtist(String artist) {
15- this.artist = artist;
16- }
17-
18- public String getTeam() {
19- return team;
20- }
21-
22- public void setTeam(String team) {
23- this.team = team;
24- }
25-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- trunk/bms_dtimporter/src/bms/table/BMSTable.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/table/BMSTable.java (nonexistent)
@@ -1,178 +0,0 @@
1-package bms.table;
2-
3-import java.util.*;
4-
5-/**
6- * 表
7- *
8- * @author exch
9- */
10-public abstract class BMSTable<T> {
11-
12- /**
13- * 票の名称
14- */
15- private String name = "";
16- /**
17- * 難易度表のマーク
18- */
19- private String id = "";
20- /**
21- * 難易度表のタグ付加時のマーク
22- */
23- private String tag = "";
24- /**
25- * 難易度表のソースURL
26- */
27- private String sourceURL = "";
28- /**
29- * 難易度表のヘッダURL
30- */
31- private String headURL = "";
32- /**
33- * 難易度表のデータURL
34- */
35- private String[] dataURL = new String[0];
36-
37- private boolean autoUpdate = true;
38- /**
39- * 統合時のレベルマッピング.。key:元のレベル表記-value:統合時のレベル表記に変換する。
40- * value=""の場合、そのレベルは統合時に除外する。nullの場合は元のレベル表記=統合時のレベル表記とする。
41- */
42- Map<String, Map<String, String>> mergeConfigurations = new HashMap<String, Map<String, String>>();
43-
44- /**
45- * 最終更新時間(ms)。終了時に保存しない
46- */
47- private long lastupdate = 0;
48- /**
49- * 表固有の属性値-名称のマップ
50- */
51- private Map<String, String> attrmap = new HashMap<String, String>();
52- /**
53- * 表の要素
54- */
55- private List<T> models = new ArrayList<T>();
56-
57- private boolean editable = false;
58- /**
59- * アクセス回数
60- */
61- private int accessCount = 0;
62-
63- public String getName() {
64- return name;
65- }
66-
67- public void setName(String name) {
68- this.name = name;
69- }
70-
71- public String getID() {
72- return id;
73- }
74-
75- public void setID(String id) {
76- this.id = id;
77- }
78-
79- public String[] getDataURL() {
80- return dataURL;
81- }
82-
83- public void setDataURL(String[] datas) {
84- this.dataURL = datas;
85- }
86-
87- public Map<String, Map<String, String>> getMergeConfigurations() {
88- return mergeConfigurations;
89- }
90-
91- public void setMergeConfigurations(
92- Map<String, Map<String, String>> mergeConfigurations) {
93- this.mergeConfigurations = mergeConfigurations;
94- }
95-
96-
97- public String getTag() {
98- return tag;
99- }
100-
101- public void setTag(String tag) {
102- this.tag = tag;
103- }
104-
105- public String getSourceURL() {
106- return sourceURL;
107- }
108-
109- public void setSourceURL(String sourceURL) {
110- this.sourceURL = sourceURL;
111- }
112-
113- public List<T> getModels() {
114- return models;
115- }
116-
117- public void setModels(List<T> models) {
118- this.models.clear();
119- this.models.addAll(models);
120- }
121-
122- public void addElement(T dte) {
123- models.add(dte);
124- lastupdate = System.currentTimeMillis();
125- }
126-
127- public void removeElement(T dte) {
128- models.remove(dte);
129- }
130-
131- public void removeAllElements() {
132- models.clear();
133- }
134-
135- public boolean isEditable() {
136- return editable;
137- }
138-
139- public void setEditable(boolean editable) {
140- this.editable = editable;
141- }
142-
143- public Map<String, String> getAttrmap() {
144- return attrmap;
145- }
146-
147- public void setAttrmap(Map<String, String> attrmap) {
148- this.attrmap = attrmap;
149- }
150-
151- public String getHeadURL() {
152- return headURL;
153- }
154-
155- public void setHeadURL(String headURL) {
156- this.headURL = headURL;
157- }
158-
159- public long getLastupdate() {
160- return lastupdate;
161- }
162-
163- public int getAccessCount() {
164- return accessCount;
165- }
166-
167- public void setAccessCount(int accessCount) {
168- this.accessCount = accessCount;
169- }
170-
171- public boolean isAutoUpdate() {
172- return autoUpdate;
173- }
174-
175- public void setAutoUpdate(boolean autoupdate) {
176- this.autoUpdate = autoupdate;
177- }
178-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- trunk/bms_dtimporter/src/bms/table/DifficultyTable.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/table/DifficultyTable.java (nonexistent)
@@ -1,134 +0,0 @@
1-package bms.table;
2-
3-import java.io.Serializable;
4-import java.util.*;
5-
6-import javafx.beans.property.SimpleStringProperty;
7-import javafx.beans.property.StringProperty;
8-
9-/**
10- * 難易度表
11- *
12- * @author exch
13- */
14-public class DifficultyTable extends BMSTable<DifficultyTableElement> implements
15- Serializable {
16-
17- /**
18- *
19- */
20- private static final long serialVersionUID = 2757817491532398378L;
21- /**
22- * レベル表記
23- */
24- private String[] levelDescription = new String[0];
25- /**
26- * 段位
27- */
28- private Grade[] grade = new Grade[0];
29-
30- public DifficultyTable() {
31- super();
32- }
33-
34- public DifficultyTable(String sourceURL) {
35- super();
36- this.setSourceURL(sourceURL);
37- }
38-
39- public DifficultyTableElement[] getElements() {
40- DifficultyTableElement[] dte = this.getModels().toArray(
41- new DifficultyTableElement[0]);
42- Comparator asc = new Comparator() {
43- public int compare(Object o1, Object o2) {
44- DifficultyTableElement dte1 = (DifficultyTableElement) o1;
45- DifficultyTableElement dte2 = (DifficultyTableElement) o2;
46- int c = indexOf(dte1.getDifficultyID())
47- - indexOf(dte2.getDifficultyID());
48- if (c == 0) {
49- return dte1.getTitle().compareToIgnoreCase(dte2.getTitle());
50- }
51- return c;
52- }
53- };
54- Arrays.sort(dte, asc);
55- return dte;
56- }
57-
58- private int indexOf(String level) {
59- for (int i = 0; i < levelDescription.length; i++) {
60- if (levelDescription[i].equals(level)) {
61- return i;
62- }
63- }
64- return -1;
65- }
66-
67- public String[] getLevelDescription() {
68- return levelDescription;
69- }
70-
71- public void setLevelDescription(String[] levelDescription) {
72- this.levelDescription = levelDescription;
73- }
74-
75- public Grade[] getGrade() {
76- return grade;
77- }
78-
79- public void setGrade(Grade[] grade) {
80- this.grade = grade;
81- }
82-
83- /**
84- * 段位
85- *
86- * @author exch
87- */
88- public static class Grade {
89- /**
90- * 段位名
91- */
92- private StringProperty name = new SimpleStringProperty("新規段位");
93- /**
94- * 段位を構成する譜面のMD5
95- */
96- private String[] hashes = new String[0];
97- /**
98- * 段位名のスタイル
99- */
100- private StringProperty style = new SimpleStringProperty("");
101-
102- public String getName() {
103- return name.get();
104- }
105-
106- public void setName(String name) {
107- this.name.set(name);
108- }
109-
110- public StringProperty nameProperty() {
111- return name;
112- }
113-
114- public String[] getHashes() {
115- return hashes;
116- }
117-
118- public void setHashes(String[] hashes) {
119- this.hashes = hashes;
120- }
121-
122- public String getStyle() {
123- return style.get();
124- }
125-
126- public void setStyle(String style) {
127- this.style.set(style);
128- }
129-
130- public StringProperty styleProperty() {
131- return style;
132- }
133- }
134-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- trunk/bms_dtimporter/src/bms/table/DifficultyTableParser.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/table/DifficultyTableParser.java (nonexistent)
@@ -1,584 +0,0 @@
1-package bms.table;
2-
3-import java.io.*;
4-import java.net.*;
5-import java.util.*;
6-import java.util.logging.Logger;
7-import java.util.regex.Pattern;
8-
9-import org.apache.commons.io.IOUtils;
10-import org.apache.commons.io.LineIterator;
11-
12-import bms.table.DifficultyTable.Grade;
13-
14-import com.fasterxml.jackson.core.JsonParseException;
15-import com.fasterxml.jackson.databind.JsonMappingException;
16-import com.fasterxml.jackson.databind.ObjectMapper;
17-
18-/**
19- * 難易度表パーサ
20- *
21- * @author exch
22- */
23-public class DifficultyTableParser {
24-
25- // TODO bug:HTTP RequestPropertyを指定しないと403を返すサイトへの対応(JSONは一度byteデータで読む必要あり)
26-
27- /**
28- * 難易度表データ
29- */
30- private Map<String, byte[]> data = new HashMap<String, byte[]>();
31-
32- public DifficultyTableParser() {
33- }
34-
35- /**
36- * 難易度表ヘッダを含んでいるかどうかを判定する
37- *
38- * @return 難易度表ヘッダを含んでいればtrue
39- */
40- public boolean containsHeader(String urlname) {
41- return getMetaTag(urlname, "bmstable") != null;
42- }
43-
44- /**
45- * 難易度表ヘッダを含んでいるかどうかを判定する
46- *
47- * @return 難易度表ヘッダを含んでいればtrue
48- */
49- public String getAlternateBMSTableURL(String urlname) {
50- return getMetaTag(urlname, "bmstable-alt");
51- }
52-
53- private String getMetaTag(String urlname, String name) {
54- try {
55- if (data.get(urlname) == null) {
56- data.put(urlname, IOUtils.toByteArray(new URL(urlname)));
57- }
58- LineIterator li = IOUtils.lineIterator(new InputStreamReader(
59- new ByteArrayInputStream(data.get(urlname))));
60- while (li.hasNext()) {
61- // 難易度表ヘッダ
62- String line = li.nextLine();
63- if (line.toLowerCase().contains("<meta name=\"" + name + "\"")) {
64- Pattern p = Pattern.compile("\"");
65- return p.split(line)[3];
66- }
67- }
68- li.close();
69- } catch (IOException e) {
70- Logger.getGlobal().severe("難易度表サイト解析中の例外:" + e.getMessage());
71- }
72- return null;
73- }
74-
75- /**
76- * 難易度表ページをデコードし、反映する
77- *
78- * @param b
79- * 譜面データも取り込むかどうか。設定項目のみを取り出したい場合はfalseとする
80- * @param diff
81- * 難易度表の情報(名称、記号、タグ)
82- * @throws IOException
83- */
84- public void decode(boolean b, DifficultyTable diff) throws IOException {
85- String urlname = diff.getSourceURL();
86- String tableurl = null;
87- String enc = null;
88- if (urlname == null || urlname.length() == 0) {
89- tableurl = diff.getHeadURL();
90- } else {
91- if (data.get(urlname) == null) {
92- data.put(urlname, IOUtils.toByteArray(new URL(urlname)));
93- }
94- LineIterator li = IOUtils.lineIterator(new InputStreamReader(
95- new ByteArrayInputStream(data.get(urlname))));
96- Pattern p = Pattern.compile("\"");
97- while (li.hasNext()) {
98- String line = li.nextLine();
99- // 文字エンコード
100- if (line.toLowerCase().contains(
101- "<meta http-equiv=\"content-type\"")) {
102- String str = p.split(line)[3];
103- enc = str.substring(str.indexOf("charset=") + 8);
104- }
105- // 難易度表ヘッダ
106- if (line.toLowerCase().contains("<meta name=\"bmstable\"")) {
107- tableurl = p.split(line)[3];
108- }
109- }
110- li.close();
111- }
112- // 難易度表ヘッダ(JSON)がある場合
113- if (tableurl != null) {
114- this.decodeJSONTable(diff,
115- new URL(this.getAbsoluteURL(urlname, tableurl)), b);
116- diff.setSourceURL(urlname);
117- } else {
118- // 難易度表ヘッダ(JSON)がない場合は、IRmemo用難易度表パーサに移行
119- // ただしcontainsHeaderでヘッダの存在を確認してからdecodeを実行するため、ここには到達しない
120- // エンコード不明の場合はreturn
121- if (enc != null) {
122- // エンコード表記の統一
123- if (enc.toUpperCase().equals("UTF-8")) {
124- enc = enc.toUpperCase();
125- }
126- if (enc.toUpperCase().equals("SHIFT_JIS")) {
127- enc = "Shift_JIS";
128- }
129- this.parseDifficultyTable(
130- diff,
131- diff.getID(),
132- new InputStreamReader(new ByteArrayInputStream(data
133- .get(urlname)), enc), b);
134- }
135- }
136- }
137-
138- private String getAbsoluteURL(String source, String path) {
139- // DataURL相対パス対応
140- String urldir = source.substring(0, source.lastIndexOf('/') + 1);
141- if (!path.startsWith("http") && !path.startsWith(urldir)) {
142- if (path.startsWith("./")) {
143- path = path.substring(2);
144- }
145- return urldir + path;
146- }
147- return path;
148- }
149-
150- /**
151- * 難易度表JSONページをデコードし、反映する
152- *
153- * @param jsonheader
154- * 難易度表JSONヘッダURL
155- * @param saveElements
156- * 譜面データも取り込むかどうか。設定項目のみを取り出したい場合はfalseとする
157- */
158- public void decodeJSONTable(DifficultyTable dt, URL jsonheader,
159- boolean saveElements) throws JsonParseException,
160- JsonMappingException, IOException {
161- // 難易度表ヘッダ(JSON)読み込み
162- this.decodeJSONTableHeader(dt, jsonheader);
163- String[] urls = dt.getDataURL();
164- if (saveElements) {
165- dt.removeAllElements();
166- List<DifficultyTableElement> elements = new ArrayList();
167- List<String> levels = new ArrayList();
168- for (String url : urls) {
169- Map<String, String> conf = dt.getMergeConfigurations().get(url);
170- if (conf == null) {
171- conf = new HashMap();
172- }
173- DifficultyTable table = new DifficultyTable();
174-
175- this.decodeJSONTableData(
176- table,
177- new URL(this.getAbsoluteURL(
178- (dt.getSourceURL() == null || dt.getSourceURL()
179- .length() == 0) ? dt.getHeadURL() : this.getAbsoluteURL(dt
180- .getSourceURL(), dt.getHeadURL()), url)));
181- levels.addAll(Arrays.asList(table.getLevelDescription()));
182- // 重複BMSの処理
183- for (DifficultyTableElement dte : table.getElements()) {
184- if (conf.get(dte.getDifficultyID()) == null
185- || conf.get(dte.getDifficultyID()).length() > 0) {
186- boolean contains = false;
187- for (DifficultyTableElement dte2 : elements) {
188- if (dte.getHash().equals(dte2.getHash())) {
189- contains = true;
190- break;
191- }
192- }
193- if (!contains) {
194- if (conf.get(dte.getDifficultyID()) != null) {
195- dte.setDifficultyID(conf.get(dte
196- .getDifficultyID()));
197- }
198- elements.add(dte);
199- }
200- }
201- }
202- }
203- if (dt.getLevelDescription().length == 0) {
204- dt.setLevelDescription(levels.toArray(new String[0]));
205- }
206- dt.setModels(elements);
207- }
208- }
209-
210- /**
211- * JSONヘッダ部をデコードして指定のDifficultyTableオブジェクトに反映する
212- * @param dt 反映するDifficultyTableオブジェクト
213- * @param jsonheader JSONヘッダ部ファイル
214- * @throws JsonParseException
215- * @throws JsonMappingException
216- * @throws IOException
217- */
218- public void decodeJSONTableHeader(DifficultyTable dt, File jsonheader)
219- throws JsonParseException, JsonMappingException, IOException {
220- ObjectMapper mapper = new ObjectMapper();
221- this.decodeJSONTableHeader(dt, mapper.readValue(jsonheader, Map.class));
222- }
223-
224- /**
225- * JSONヘッダ部をデコードして指定のDifficultyTableオブジェクトに反映する
226- * @param dt 反映するDifficultyTableオブジェクト
227- * @param jsonheader JSONヘッダ部URL
228- * @throws JsonParseException
229- * @throws JsonMappingException
230- * @throws IOException
231- */
232- public void decodeJSONTableHeader(DifficultyTable dt, URL jsonheader)
233- throws JsonParseException, JsonMappingException, IOException {
234- ObjectMapper mapper = new ObjectMapper();
235- this.decodeJSONTableHeader(dt, mapper.readValue(jsonheader, Map.class));
236- dt.setHeadURL(jsonheader.toExternalForm());
237- }
238-
239- private DifficultyTable decodeJSONTableHeader(DifficultyTable dt,
240- Map<String, Object> result) throws JsonParseException {
241- // level_order処理
242- List l = (List) result.get("level_order");
243- if (l != null) {
244- String[] levels = new String[l.size()];
245- for (int i = 0; i < levels.length; i++) {
246- levels[i] = l.get(i).toString();
247- }
248- dt.setLevelDescription(levels);
249- } else {
250- dt.setLevelDescription(new String[] {});
251- }
252-
253- dt.setName((String) result.get("name"));
254- dt.setID((String) result.get("symbol"));
255- if (result.get("tag") != null) {
256- dt.setTag((String) result.get("tag"));
257- } else {
258- dt.setTag((String) result.get("symbol"));
259- }
260- Object dataurl = result.get("data_url");
261- if (dataurl instanceof String) {
262- dt.setDataURL(new String[] { (String) dataurl });
263- }
264- if (dataurl instanceof List) {
265- dt.setDataURL((String[]) ((List) dataurl).toArray(new String[0]));
266- }
267- Map<String, Map<String, String>> mergerule = new HashMap();
268- List<Map<String, String>> merge = (List<Map<String, String>>) result
269- .get("data_rule");
270- if (merge == null) {
271- merge = new ArrayList();
272- }
273- for (int i = 0; i < dt.getDataURL().length; i++) {
274- if (i == merge.size()) {
275- break;
276- }
277- mergerule.put(dt.getDataURL()[i], merge.get(i));
278- }
279- dt.setMergeConfigurations(mergerule);
280- if (result.get("attr") != null) {
281- dt.setAttrmap((Map<String, String>) result.get("attr"));
282- }
283- List<Grade> grades = new ArrayList();
284- if (result.get("grade") != null) {
285- for (Map<String, Object> grade : (List<Map<String, Object>>) result
286- .get("grade")) {
287- Grade gr = new Grade();
288- gr.setName((String) grade.get("name"));
289- gr.setHashes(((List<String>) grade.get("md5"))
290- .toArray(new String[0]));
291- gr.setStyle((String) grade.get("style"));
292- grades.add(gr);
293- }
294- }
295- dt.setGrade(grades.toArray(new Grade[0]));
296- // 必須項目が定義されていない場合は例外をスロー
297- if (result.get("name") == null || result.get("symbol") == null) {
298- throw new JsonParseException("ヘッダ部の情報が不足しています", null);
299- }
300- return dt;
301- }
302-
303- /**
304- * 難易度表JSONデータをデコードし、指定の難易度表に反映する
305- *
306- * @param dt
307- * 難易度表
308- * @param jsondata
309- * 難易度表JSONデータファイル
310- */
311- public void decodeJSONTableData(DifficultyTable dt, File jsondata)
312- throws JsonParseException, JsonMappingException, IOException {
313- // JSON読み込み
314- ObjectMapper mapper = new ObjectMapper();
315- this.decodeJSONTableData(dt, mapper.readValue(jsondata, List.class),
316- true);
317- }
318-
319- /**
320- * 難易度表JSONデータをデコードし、指定の難易度表に反映する
321- *
322- * @param dt
323- * 難易度表
324- * @param jsondata
325- * 難易度表JSONデータURL
326- */
327- public void decodeJSONTableData(DifficultyTable dt, URL jsondata)
328- throws JsonParseException, JsonMappingException, IOException {
329- Logger.getGlobal().info("難易度表データ読み込み - " + jsondata.toExternalForm());
330- // JSON読み込み
331- ObjectMapper mapper = new ObjectMapper();
332- // 難易度表に変換
333- this.decodeJSONTableData(dt, mapper.readValue(jsondata, List.class),
334- false);
335- }
336-
337- private void decodeJSONTableData(DifficultyTable dt,
338- List<Map<String, Object>> result, boolean accept) {
339- dt.removeAllElements();
340- List<String> levelorder = new ArrayList<String>();
341- for (int i = 0; i < result.size(); i++) {
342- Map<String, Object> m = result.get(i);
343- // levelとmd5が定義されていない要素は弾く
344- if (accept
345- || (m.get("level") != null && m.get("md5") != null && m
346- .get("md5").toString().length() > 24)) {
347- DifficultyTableElement dte = new DifficultyTableElement();
348- dte.setValues(m);
349-
350- String level = String.valueOf(m.get("level"));
351- boolean b = true;
352- for (int j = 0; j < levelorder.size(); j++) {
353- if (levelorder.get(j).equals(level)) {
354- b = false;
355- }
356- }
357- if (b) {
358- levelorder.add(level);
359- }
360- dt.addElement(dte);
361- } else {
362- Logger.getGlobal().info(
363- m.get("title") + "の譜面定義に不備があります - level:"
364- + m.get("level") + " md5:" + m.get("md5"));
365- }
366- }
367-
368- if (dt.getLevelDescription().length == 0) {
369- dt.setLevelDescription(levelorder.toArray(new String[0]));
370- }
371- }
372-
373- /**
374- * 難易度表モデルをJSONヘッダ部にエンコードし、指定のファイルに保存する
375- *
376- * @param dt
377- * エンコードする難易度表モデル
378- * @param jsonheader
379- * JSONヘッダ部ファイル
380- */
381- public void encodeJSONTableHeader(DifficultyTable dt, File jsonheader) {
382- try {
383- // ヘッダ部のエクスポート
384- Map<String, Object> header = new HashMap<String, Object>();
385- header.put("name", dt.getName());
386- header.put("symbol", dt.getID());
387- header.put("tag", dt.getTag());
388- header.put("level_order", dt.getLevelDescription());
389- if (dt.getDataURL().length > 1) {
390- header.put("data_url", dt.getDataURL());
391- } else if (dt.getDataURL().length == 1) {
392- header.put("data_url", dt.getDataURL()[0]);
393- }
394- if(dt.getAttrmap().keySet().size() > 0) {
395- header.put("attr", dt.getAttrmap());
396- }
397-
398- List<Map<String, Object>> grade = new ArrayList<Map<String, Object>>();
399- for (Grade g : dt.getGrade()) {
400- Map<String, Object> m = new HashMap<String, Object>();
401- m.put("name", g.getName());
402- m.put("md5", g.getHashes());
403- m.put("style", g.getStyle());
404- grade.add(m);
405- }
406- header.put("grade", grade);
407-
408- ObjectMapper objectMapper = new ObjectMapper();
409- String json = objectMapper.writeValueAsString(header);
410- OutputStreamWriter osw = new OutputStreamWriter(
411- new FileOutputStream(jsonheader), "UTF-8");
412- osw.write(json);
413- osw.flush();
414- osw.close();
415- } catch (Exception e) {
416- // controller.showErrorMessage("難易度表の保存に失敗しました");
417- Logger.getGlobal().severe("難易度表の保存中の例外:" + e.getMessage());
418- }
419- }
420-
421- /**
422- * 難易度表モデルをJSONヘッダ部/データ部にエンコードし、指定のファイルに保存する
423- *
424- * @param dt
425- * エンコードする難易度表モデル
426- * @param jsonheader
427- * JSONヘッダ部ファイル
428- * @param jsondata
429- * JSONデータ部ファイル
430- */
431- public void encodeJSONTableData(DifficultyTable dt, File jsonheader,
432- File jsondata) {
433- try {
434- dt.setDataURL(new String[] { jsondata.getName() });
435- // ヘッダ部のエクスポート
436- this.encodeJSONTableHeader(dt, jsonheader);
437- // データ部のエクスポート
438- List<Map<String, Object>> datas = new ArrayList<Map<String, Object>>();
439- for (DifficultyTableElement te : dt.getElements()) {
440- datas.add(te.getValues());
441- }
442- ObjectMapper objectMapper = new ObjectMapper();
443- String json = objectMapper.writeValueAsString(datas);
444- OutputStreamWriter osw = new OutputStreamWriter(
445- new FileOutputStream(jsondata), "UTF-8");
446- osw.write(json);
447- osw.flush();
448- osw.close();
449- } catch (Exception e) {
450- // controller.showErrorMessage("難易度表の保存に失敗しました");
451- Logger.getGlobal().severe("難易度表の保存中の例外:" + e.getMessage());
452- }
453- }
454-
455- /**
456- * 旧難易度表フォーマットを解析する。現在は使用していない
457- *
458- * @param dt
459- * @param mark
460- * 難易度表マーク
461- * @param isr
462- * 難易度表ストリームリーダー
463- * @param saveElement
464- * 要素を保存するかどうか
465- * @return 難易度表データ
466- * @throws NumberFormatException
467- * @throws IOException
468- */
469- private DifficultyTable parseDifficultyTable(DifficultyTable dt,
470- String mark, InputStreamReader isr, boolean saveElement)
471- throws NumberFormatException, IOException {
472- // System.out.println("難易度表チェック...");
473- String line = null;
474- BufferedReader br = new BufferedReader(isr);
475-
476- boolean diff = false;
477- int state = -1;
478- List<DifficultyTableElement> result = new ArrayList<DifficultyTableElement>();
479- DifficultyTableElement dte = null;
480- Pattern p = Pattern.compile("\"");
481- dt.removeAllElements();
482- Pattern first = Pattern.compile("\\s*\\[\\s*\\d+,\\s*\"" + mark
483- + ".+\"\\s*,.*");
484- while ((line = br.readLine()) != null) {
485- if (line.contains("var mname = [")) {
486- // System.out.println("難易度表を検出しました");
487- diff = true;
488- }
489- if (line.contains("</script>")) {
490- diff = false;
491- }
492- if (diff && state == -1 && first.matcher(line).matches()) {
493- dte = new DifficultyTableElement();
494- String did = p.split(line)[1].substring(mark.length());
495- // dte.setID(p.split(line)[0].replaceAll("[\\[\\s,]", ""));
496- dte.setDifficultyID(did);
497- state = 0;
498- }
499-
500- if (state >= 0) {
501- switch (state) {
502- case 0:
503- state++;
504- break;
505- case 1:
506- // 曲名
507- dte.setTitle(p.split(line)[1]);
508- state++;
509- break;
510- case 2:
511- // bmsid
512- dte.setBMSID(Integer.parseInt(p.split(line)[1].replaceAll(
513- "[\\s]", "")));
514- state++;
515- break;
516- case 3:
517- // URL1
518- String[] split = p.split(line)[1].split("'");
519- if (split.length > 2) {
520- dte.setURL1(split[1]);
521- }
522- split = p.split(line)[1].split("<[bB][rR]\\s*/*>");
523- dte.setURL1name(split[0].replaceFirst(
524- "<[aA]\\s[hH][rR][eE][fF]=.+'>|</[aA]>", "")
525- .replaceFirst("</[aA]>", ""));
526- // URL1サブ
527- if (split.length > 1) {
528- String[] split2 = split[1].split("'");
529- if (split2.length > 2) {
530- dte.setURL1sub(split2[1]);
531- }
532- dte.setURL1subname(split[1].replaceFirst(
533- "<[aA]\\s[hH][rR][eE][fF]=.+'>|</[aA]>", "")
534- .replaceFirst("</[aA]>", ""));
535- }
536- state++;
537- break;
538- case 4:
539- // URL2
540- String[] split3 = p.split(line)[1].split("'");
541- if (split3.length > 2) {
542- dte.setURL2(split3[1]);
543- }
544- dte.setURL2name(p.split(line)[1].replaceFirst(
545- "<[aA]\\s[hH][rR][eE][fF]=.+'>|</[aA]>", "")
546- .replaceFirst("</[aA]>", ""));
547- state++;
548- break;
549- case 5:
550- // コメント
551- dte.setComment1(p.split(line)[1].replaceFirst(
552- "Avg:.*JUDGE:[A-Z]+\\s*", ""));
553- result.add(dte);
554- dte = null;
555- state = -1;
556- break;
557- }
558- }
559- }
560- if (saveElement) {
561- for (int i = 0; i < result.size(); i++) {
562- dt.addElement(result.get(i));
563- }
564- }
565- if (dt.getLevelDescription().length == 0) {
566- List<String> l = new ArrayList<String>();
567- for (int i = 0; i < result.size(); i++) {
568- boolean b = true;
569- for (int j = 0; j < l.size(); j++) {
570- if (l.get(j).equals(result.get(i).getDifficultyID())) {
571- b = false;
572- }
573- }
574- if (b) {
575- l.add(result.get(i).getDifficultyID());
576- }
577- }
578- dt.setLevelDescription(l.toArray(new String[0]));
579- }
580-
581- // System.out.println("難易度表リスト抽出完了 リスト数:" + dt.getElements().length);
582- return dt;
583- }
584-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- trunk/bms_dtimporter/src/bms/table/BMSTableManagerListener.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/table/BMSTableManagerListener.java (nonexistent)
@@ -1,11 +0,0 @@
1-package bms.table;
2-
3-/**
4- * BMSTableManagerの変更通知を受けるためのリスナーインターフェイス
5- *
6- * @author exch
7- */
8-public interface BMSTableManagerListener {
9-
10- public abstract void modelChanged();
11-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- trunk/bms_dtimporter/src/bms/table/EventTable.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/table/EventTable.java (nonexistent)
@@ -1,5 +0,0 @@
1-package bms.table;
2-
3-public class EventTable extends BMSTable<EventTableElement> {
4-
5-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- trunk/bms_dtimporter/src/bms/table/BMSTableManager.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/table/BMSTableManager.java (nonexistent)
@@ -1,103 +0,0 @@
1-package bms.table;
2-
3-import java.util.*;
4-
5-/**
6- * 表管理用クラス
7- *
8- * @author exch
9- */
10-public class BMSTableManager {
11- /**
12- * 表リスト
13- */
14- private List<BMSTable> tableList = new ArrayList<BMSTable>();
15-
16- private List<BMSTableManagerListener> listener = new ArrayList<BMSTableManagerListener>();
17-
18- private Map<String, List<DifficultyTableElement>> userList = new HashMap<String, List<DifficultyTableElement>>();
19-
20- private Map<String, String> memoMap = new HashMap<String, String>();
21-
22- public BMSTableManager() {
23- }
24-
25- public void addListener(
26- BMSTableManagerListener l) {
27- listener.add(l);
28- }
29-
30- public void fireModelChanged() {
31- for (int i = 0; i < listener.size(); i++) {
32- listener.get(i).modelChanged();
33- }
34- }
35-
36- /**
37- * 難易度表を追加する
38- *
39- * @param dt
40- * 追加する難易度表
41- */
42- public void addBMSTable(BMSTable dt) {
43- tableList.add(dt);
44- this.fireModelChanged();
45- }
46-
47- /**
48- * 難易度表を削除する
49- *
50- * @param dt
51- * 削除する難易度表
52- */
53- public void removeBMSTable(BMSTable dt) {
54- tableList.remove(dt);
55- this.fireModelChanged();
56- }
57-
58- /**
59- * 難易度表リストを取得する
60- *
61- * @return 難易度表リスト
62- */
63- public BMSTable[] getBMSTables() {
64- return tableList.toArray(new BMSTable[0]);
65- }
66-
67- public List<BMSTable> getTableList() {
68- return tableList;
69- }
70-
71- public Map<String, List<DifficultyTableElement>> getUserList() {
72- return userList;
73- }
74-
75- public void setUserList(Map<String, List<DifficultyTableElement>> userList) {
76- this.userList = userList;
77- }
78-
79- public Map<String, String> getMemoMap() {
80- return memoMap;
81- }
82-
83- public void setMemoMap(Map<String, String> memoMap) {
84- this.memoMap = memoMap;
85- }
86-
87- public List<DifficultyTableElement> getUserDifficultyTableElements(String name) {
88- if(userList.get(name) == null) {
89- userList.put(name, new ArrayList<DifficultyTableElement>());
90- }
91- return userList.get(name);
92- }
93-
94- public void setTableList(List<BMSTable> tableList) {
95- this.tableList = tableList;
96- }
97-
98- public void clearAllTableElements() {
99- for (int i = 0; i < tableList.size(); i++) {
100- tableList.get(i).removeAllElements();
101- }
102- }
103-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- trunk/bms_dtimporter/src/bms/table/DifficultyTableElement.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/table/DifficultyTableElement.java (nonexistent)
@@ -1,253 +0,0 @@
1-package bms.table;
2-
3-import java.io.Serializable;
4-import java.util.Map;
5-
6-import bms.player.lunaticrave2.SongData;
7-
8-/**
9- * 難易度表の要素
10- *
11- * @author exch
12- */
13-public class DifficultyTableElement extends BMSTableElement implements
14- Serializable {
15-
16- /**
17- * 譜面の状態
18- */
19- private int state = 0;
20- /**
21- * 譜面の状態:新規追加
22- */
23- public static final int STATE_NEW = 1;
24- /**
25- * 譜面の状態:難易度更新
26- */
27- public static final int STATE_UPDATE = 2;
28- /**
29- * 譜面の状態:投票中
30- */
31- public static final int STATE_VOTE = 3;
32- /**
33- * 譜面の状態:おすすめ
34- */
35- public static final int STATE_RECOMMEND = 4;
36- /**
37- * 譜面の状態:削除
38- */
39- public static final int STATE_DELETE = 5;
40- /**
41- * 譜面の状態:復活
42- */
43- public static final int STATE_REVIVE = 6;
44-
45- /**
46- * 譜面評価
47- */
48- private int eval = 0;
49- /**
50- * レベル表記
51- */
52- private String level = "";
53- /**
54- * 差分作者名
55- */
56- private String diffname = "";
57- /**
58- * コメント
59- */
60- private String comment = "";
61- /**
62- * 譜面情報
63- */
64- private String info = "";
65-
66- private String proposer = "";
67-
68- public DifficultyTableElement() {
69- }
70-
71- public DifficultyTableElement(String did, String title, int bmsid,
72- String url1, String url2, String comment, String hash) {
73- this.setDifficultyID(did);
74- this.setTitle(title);
75- this.setBMSID(bmsid);
76- this.setURL1(url1);
77- this.setURL2(url2);
78- this.setComment1(comment);
79- this.setHash(hash);
80- }
81-
82- public DifficultyTableElement(SongData song) {
83- this.setDifficultyID(String.valueOf(song.getLevel()));
84- this.setTitle(song.getTitle());;
85- this.setHash(song.getHash());
86- }
87-
88- public int getState() {
89- return state;
90- }
91-
92- public void setState(int id) {
93- state = id;
94- }
95-
96- public String getDifficultyID() {
97- return level;
98- }
99-
100- public void setDifficultyID(String did) {
101- level = did;
102- }
103-
104- public int getEvaluation() {
105- return eval;
106- }
107-
108- public void setEvaluation(int eval) {
109- this.eval = eval;
110- }
111-
112- public String getURL1sub() {
113- return (String) getValues().get("url_pack");
114- }
115-
116- public void setURL1sub(String url1sub) {
117- getValues().put("url_pack", url1sub);
118- }
119-
120- public String getURL1subname() {
121- return (String) getValues().get("name_pack");
122- }
123-
124- public void setURL1subname(String url1subname) {
125- getValues().put("name_pack", url1subname);
126- }
127-
128- public String getURL2() {
129- return (String) getValues().get("url_diff");
130- }
131-
132- public void setURL2(String url2) {
133- getValues().put("url_diff", url2);
134- }
135-
136- public String getURL2name() {
137- return diffname;
138- }
139-
140- public void setURL2name(String url2name) {
141- diffname = url2name;
142- }
143-
144- public String getComment1() {
145- return comment;
146- }
147-
148- public void setComment1(String comment1) {
149- comment = comment1;
150- }
151-
152- public String getComment2() {
153- return info;
154- }
155-
156- public void setComment2(String comment2) {
157- info = comment2;
158- }
159-
160- public String getProposer() {
161- return proposer;
162- }
163-
164- public void setProposer(String proposer) {
165- this.proposer = proposer;
166- }
167-
168- public int getBMSID() {
169- int result = 0;
170- try {
171- result = Integer.parseInt(String.valueOf(getValues().get(
172- "lr2_bmsid")));
173- } catch (NumberFormatException e) {
174-
175- }
176- return result;
177- }
178-
179- public void setBMSID(int bmsid) {
180- getValues().put("lr2_bmsid", bmsid);
181- }
182-
183- @Override
184- public void setValues(Map<String, Object> values) {
185- super.setValues(values);
186- int statevalue = 0;
187- try {
188- statevalue = Integer.parseInt(String.valueOf(values.get("state")));
189- } catch (NumberFormatException e) {
190-
191- }
192- state = statevalue;
193-
194- int evalvalue = 0;
195- try {
196- evalvalue = Integer.parseInt(String.valueOf(values.get("eval")));
197- } catch (NumberFormatException e) {
198-
199- }
200- eval = evalvalue;
201- level= (String) values.get("level");
202- diffname = (String) values.get("name_diff");
203- comment = (String) values.get("comment");
204- info = (String) values.get("tag");
205- proposer = (String) values.get("proposer");
206- }
207-
208- @Override
209- public Map<String, Object> getValues() {
210- Map<String, Object> result = super.getValues();
211- result.put("level", getDifficultyID());
212- result.put("eval", getEvaluation());
213- result.put("state", getState());
214- result.put("name_diff", getURL2name());
215- result.put("comment", getComment1());
216- result.put("tag", getComment2());
217- if(getProposer() != null && getProposer().length() > 0) {
218- result.put("proposer", getProposer());
219- } else {
220- result.remove("proposer");
221- }
222- return result;
223- }
224-
225- // public String makeTable(String d) {
226- // String s = "[" + id + ",\"" + d + did + "\",\n";
227- // s += "\"" + this.getTitle() + "\",\n";
228- // s += "\"" + bmsid + "\",\n";
229- // if (this.getURL1() != null && this.getURL1().length() > 0) {
230- // s += "\"<a href='" + this.getURL1() + "'>" + this.getURL1name()
231- // + "</a>";
232- // } else {
233- // s += "\"" + this.getURL1name();
234- // }
235- // if (url1sub != null && url1sub.length() > 0) {
236- // s += "<br />(<a href='" + url1sub + "'>" + url1subname
237- // + "</a>)\",\n";
238- // } else {
239- // s += "\",\n";
240- // }
241- //
242- // if (url2 != null && url2.length() > 0) {
243- // s += "\"<a href='" + url2 + "'>" + url2name + "</a>\",\n";
244- // } else {
245- // s += "\"" + url2name + "\",\n";
246- // }
247- // s += "\"" + comment1 + "\",\n";
248- // s += "],\n";
249- //
250- // return s;
251- // }
252-
253-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- trunk/bms_dtimporter/src/bms/table/BMSTableElement.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/table/BMSTableElement.java (nonexistent)
@@ -1,96 +0,0 @@
1-package bms.table;
2-
3-import java.util.*;
4-
5-/**
6- * 表の要素
7- *
8- * @author exch
9- */
10-public abstract class BMSTableElement {
11-
12- private Map<String, Object> values = new HashMap<String, Object>();
13-
14- /**
15- * タイトル
16- */
17- private String title = "";
18- /**
19- * MD5
20- */
21- private String md5 = "";
22- /**
23- * アーティスト
24- */
25- private String artist = "";
26-
27- public BMSTableElement() {
28- }
29-
30- public String getTitle() {
31- return title;
32- }
33-
34- public void setTitle(String title) {
35- this.title = title;
36- }
37-
38- public String getURL1() {
39- return (String)values.get("url");
40- }
41-
42- public void setURL1(String url1) {
43- values.put("url", url1);
44- }
45-
46- public String getURL1name() {
47- return artist;
48- }
49-
50- public void setURL1name(String url1name) {
51- this.artist = url1name;
52- }
53-
54- public String getHash() {
55- return md5;
56- }
57-
58- public void setHash(String hash) {
59- this.md5 = hash;
60- }
61-
62- public List<String> getParentHash() {
63- Object o = values.get("org_md5");
64- if(o instanceof String) {
65- List<String> result = new ArrayList<String>();
66- result.add((String) o);
67- return result;
68- }
69- if(o instanceof List) {
70- return (List<String>) o;
71- }
72- return null;
73- }
74-
75- public void setParentHash(List<String> hashes) {
76- if(hashes == null || hashes.size() == 0) {
77- values.remove("org_md5");
78- } else {
79- values.put("org_md5", hashes);
80- }
81- }
82-
83- public Map<String, Object> getValues() {
84- values.put("title", getTitle());
85- values.put("md5", getHash());
86- values.put("artist", getURL1name());
87- return values;
88- }
89-
90- public void setValues(Map<String, Object> values) {
91- this.values = values;
92- title = (String) values.get("title");
93- md5 = (String) values.get("md5");
94- artist= (String) values.get("artist");
95- }
96-}
Deleted: svn:mime-type
## -1 +0,0 ##
-text/plain
\ No newline at end of property
--- trunk/bms_dtimporter/src/bms/table/FavoriteTable.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/table/FavoriteTable.java (revision 234)
@@ -50,7 +50,7 @@
5050 Map<String, Map<String, String>> datas = new HashMap<String, Map<String, String>>();
5151 Map<String, String> data = new HashMap<String, String>();
5252 data.put(BMSPlayerAccessor.FAVORITE, String.valueOf(num));
53- datas.put(dte.getHash(), data);
53+ datas.put(dte.getMD5(), data);
5454 controller.getBMSPlayerAccessor().setSongDatas(datas);
5555 } catch (Exception ex) {
5656 Logger.getGlobal().severe("お気に入り(favorite)処理例外:" + ex.getMessage());
--- trunk/bms_dtimporter/src/bms/tool/glassist/BMSGradeTableView.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/BMSGradeTableView.java (revision 234)
@@ -25,7 +25,6 @@
2525 import bms.diff.ParentBMSDetector;
2626 import bms.player.lunaticrave2.IRScoreData;
2727 import bms.table.*;
28-import bms.table.DifficultyTable.Grade;
2928
3029 /**
3130 * 難易度表の段位のクリア状況をテーブル形式で表示するクラス。
@@ -104,12 +103,12 @@
104103 @Override
105104 public void changed(ObservableValue<? extends BMSGradeRecord> arg0,
106105 BMSGradeRecord arg1, BMSGradeRecord arg2) {
107- String[] hashes = arg2.getGrade().getHashes();
106+ String[] hashes = arg2.getGrade().getHash();
108107 final Hyperlink[] musics = {music1, music2, music3, music4, music5};
109108 for(int i = 0;i < musics.length; i++) {
110109 if(i < hashes.length) {
111110 for (DifficultyTableElement te : dt.getElements()) {
112- if (hashes[i].equals(te.getHash())) {
111+ if (hashes[i].equals(te.getMD5())) {
113112 musics[i].setText(dt.getID() + te.getDifficultyID() + " " +te.getTitle());
114113 }
115114 }
@@ -283,7 +282,7 @@
283282 * @param rscore
284283 * bmsハッシュ値-ステータスのマップ
285284 */
286- public void update(DifficultyTable dt, Map<Grade, IRScoreData> status,
285+ public void update(DifficultyTable dt, Map<Course, IRScoreData> status,
287286 Map<BMSTableElement, IRScoreData> score) {
288287 bmstable.getItems().clear();
289288 this.dt = dt;
@@ -290,18 +289,20 @@
290289 if (dt == null) {
291290 return;
292291 }
293- for (Grade g : dt.getGrade()) {
294- Map<String, IRScoreData> m = new HashMap();
295- for (String hash : g.getHashes()) {
296- for (BMSTableElement te : score.keySet()) {
297- if (hash.equals(te.getHash())) {
298- m.put(hash, score.get(te));
299- break;
292+ if(dt.getCourse().length > 0) {
293+ for (Course g : dt.getCourse()[0]) {
294+ Map<String, IRScoreData> m = new HashMap();
295+ for (String hash : g.getHash()) {
296+ for (BMSTableElement te : score.keySet()) {
297+ if (hash.equals(te.getMD5())) {
298+ m.put(hash, score.get(te));
299+ break;
300+ }
300301 }
301302 }
302- }
303- BMSGradeRecord record = new BMSGradeRecord(g, status.get(g), m);
304- bmstable.getItems().add(record);
303+ BMSGradeRecord record = new BMSGradeRecord(g, status.get(g), m);
304+ bmstable.getItems().add(record);
305+ }
305306 }
306307 }
307308
@@ -476,12 +477,12 @@
476477 */
477478 public class BMSGradeRecord {
478479
479- private Grade grade;
480+ private Course grade;
480481 private IRScoreData status;
481482 private StringProperty level = new SimpleStringProperty();
482483 private Map<String, IRScoreData> score;
483484
484- public BMSGradeRecord(final Grade dte, IRScoreData status,
485+ public BMSGradeRecord(final Course dte, IRScoreData status,
485486 Map<String, IRScoreData> score) {
486487 this.grade = dte;
487488 if (status != null) {
@@ -493,7 +494,7 @@
493494 this.score = score;
494495 }
495496
496- public Grade getGrade() {
497+ public Course getGrade() {
497498 return grade;
498499 }
499500
@@ -550,10 +551,10 @@
550551 }
551552
552553 private int getSubState(int i) {
553- if (i - 1 >= grade.getHashes().length) {
554+ if (i - 1 >= grade.getHash().length) {
554555 return Integer.MIN_VALUE;
555556 }
556- IRScoreData sc = score.get(grade.getHashes()[i - 1]);
557+ IRScoreData sc = score.get(grade.getHash()[i - 1]);
557558 if (sc == null) {
558559 return Integer.MIN_VALUE;
559560 }
--- trunk/bms_dtimporter/src/bms/tool/glassist/BMSSearchView.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/BMSSearchView.java (revision 234)
@@ -297,12 +297,12 @@
297297 BMSTableManager dtm = (BMSTableManager) controller
298298 .getConfigurationMap().get(ConfigurationMap.BMS_TABLE_LIST);
299299 String hash = table.getSelectionModel().getSelectedItem()
300- .getDifficultyTableElement().getHash();
300+ .getDifficultyTableElement().getMD5();
301301 List<DifficultyTableElement> l = new ArrayList<DifficultyTableElement>(
302302 Arrays.asList(dt.getElements()));
303303 l.addAll(dtm.getUserDifficultyTableElements(dt.getName()));
304304 for (int i = 0; i < l.size(); i++) {
305- if (hash.equals(l.get(i).getHash())) {
305+ if (hash.equals(l.get(i).getMD5())) {
306306 controller.showErrorMessage("既に同じ譜面が難易度表に存在しています");
307307 return;
308308 }
--- trunk/bms_dtimporter/src/bms/tool/glassist/BMSTableEditorView.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/BMSTableEditorView.java (revision 234)
@@ -15,9 +15,6 @@
1515 import bms.model.*;
1616 import bms.player.lunaticrave2.SongData;
1717 import bms.table.*;
18-import javafx.beans.InvalidationListener;
19-import javafx.beans.property.IntegerProperty;
20-import javafx.beans.property.SimpleIntegerProperty;
2118 import javafx.beans.property.SimpleStringProperty;
2219 import javafx.beans.property.StringProperty;
2320 import javafx.beans.value.ChangeListener;
@@ -32,7 +29,6 @@
3229 import javafx.scene.layout.GridPane;
3330 import javafx.scene.layout.VBox;
3431 import javafx.util.Callback;
35-import javafx.util.converter.IntegerStringConverter;
3632
3733 public class BMSTableEditorView implements Initializable {
3834
@@ -367,7 +363,7 @@
367363 datas.add(te.getValues());
368364 }
369365 ObjectMapper objectMapper = new ObjectMapper();
370- String json = objectMapper.writeValueAsString(datas);
366+ String json = objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(datas);
371367 OutputStreamWriter osw = new OutputStreamWriter(
372368 new FileOutputStream(f), "UTF-8");
373369 osw.write(json);
@@ -439,9 +435,9 @@
439435 }
440436
441437 public void addDifficultyTableElement(DifficultyTableElement dte) {
442- if (dte.getHash() != null) {
438+ if (dte.getMD5() != null) {
443439 DifficultyTableElement dte2 = this
444- .getDifficultyTableElementFromLR2IR(dte.getHash());
440+ .getDifficultyTableElementFromLR2IR(dte.getMD5());
445441 if (dte2 != null) {
446442 if (dte2.getDifficultyID() == null) {
447443 dte2.setDifficultyID(dte.getDifficultyID());
@@ -518,8 +514,12 @@
518514 controller.showErrorMessage("譜面を選択して下さい");
519515 return;
520516 }
521- addDifficultyTableElement(new DifficultyTableElement(
522- searchController.getSelectedSongData()));
517+ DifficultyTableElement dte = new DifficultyTableElement();
518+ SongData sd = searchController.getSelectedSongData();
519+ dte.setTitle(sd.getTitle());
520+ dte.setDifficultyID(String.valueOf(sd.getLevel()));
521+ dte.setMD5(sd.getHash());
522+ addDifficultyTableElement(dte);
523523 }
524524
525525 DifficultyTableElement getDifficultyTableElementFromLR2IR(String hash) {
@@ -546,7 +546,7 @@
546546 urlconn.getInputStream(), "Shift_JIS"));
547547
548548 DifficultyTableElement dte = new DifficultyTableElement();
549- dte.setHash(hash);
549+ dte.setMD5(hash);
550550 while (true) {
551551 String line = reader.readLine();
552552 if (line != null) {
@@ -664,13 +664,13 @@
664664 dte.setURL2name(newValue);
665665 }
666666 });
667- md5 = new SimpleStringProperty(dte.getHash());
667+ md5 = new SimpleStringProperty(dte.getMD5());
668668 md5.addListener(new ChangeListener<String>() {
669669 @Override
670670 public void changed(
671671 ObservableValue<? extends String> observable,
672672 String oldValue, String newValue) {
673- dte.setHash(newValue);
673+ dte.setMD5(newValue);
674674 }
675675 });
676676 comment = new SimpleStringProperty(dte.getComment1());
--- trunk/bms_dtimporter/src/bms/tool/glassist/BMSTableHeaderEditorView.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/BMSTableHeaderEditorView.java (revision 234)
@@ -8,7 +8,6 @@
88 import com.fasterxml.jackson.databind.ObjectMapper;
99
1010 import bms.table.*;
11-import bms.table.DifficultyTable.Grade;
1211 import javafx.beans.value.ChangeListener;
1312 import javafx.beans.value.ObservableValue;
1413 import javafx.event.EventHandler;
@@ -28,11 +27,11 @@
2827 // TODO LR2固有実装の廃止
2928
3029 @FXML
31- private TableColumn<Grade, String> gradenamecol;
30+ private TableColumn<Course, String> gradenamecol;
3231 @FXML
33- private TableColumn<Grade, String[]> grademd5col;
32+ private TableColumn<Course, String[]> grademd5col;
3433 @FXML
35- private TableView<Grade> grade;
34+ private TableView<Course> grade;
3635
3736 @FXML
3837 private TextField name;
@@ -66,29 +65,29 @@
6665
6766 @Override
6867 public void initialize(URL arg0, ResourceBundle arg1) {
69- Callback<TableColumn<Grade, String>, TableCell<Grade, String>> levelcall = TextFieldTableCell
68+ Callback<TableColumn<Course, String>, TableCell<Course, String>> levelcall = TextFieldTableCell
7069 .forTableColumn();
7170 // 名前
72- gradenamecol.setCellValueFactory(new PropertyValueFactory<Grade, String>(
71+ gradenamecol.setCellValueFactory(new PropertyValueFactory<Course, String>(
7372 "name"));
7473 gradenamecol.setCellFactory(levelcall);
75- gradenamecol.setOnEditCommit(new EventHandler<CellEditEvent<Grade, String>>() {
74+ gradenamecol.setOnEditCommit(new EventHandler<CellEditEvent<Course, String>>() {
7675 @Override
77- public void handle(CellEditEvent<Grade, String> t) {
78- ((Grade) t.getTableView().getItems()
76+ public void handle(CellEditEvent<Course, String> t) {
77+ ((Course) t.getTableView().getItems()
7978 .get(t.getTablePosition().getRow())).setName(t
8079 .getNewValue());
8180 }
8281 });
8382 // コース
84- grademd5col.setCellValueFactory(new PropertyValueFactory<Grade, String[]>(
83+ grademd5col.setCellValueFactory(new PropertyValueFactory<Course, String[]>(
8584 "hashes"));
86- grademd5col.setCellFactory(new Callback<TableColumn<Grade, String[]>, TableCell<Grade, String[]>>() {
85+ grademd5col.setCellFactory(new Callback<TableColumn<Course, String[]>, TableCell<Course, String[]>>() {
8786
8887 @Override
89- public TableCell<Grade, String[]> call(
90- TableColumn<Grade, String[]> arg0) {
91- return new TableCell<Grade, String[]>() {
88+ public TableCell<Course, String[]> call(
89+ TableColumn<Course, String[]> arg0) {
90+ return new TableCell<Course, String[]>() {
9291
9392 @Override
9493 protected void updateItem(String[] arg0, boolean arg1) {
@@ -108,15 +107,15 @@
108107 }
109108 });
110109 grade.getSelectionModel().selectedItemProperty()
111- .addListener(new ChangeListener<Grade>() {
110+ .addListener(new ChangeListener<Course>() {
112111 @Override
113112 public void changed(
114- ObservableValue<? extends Grade> arg0,
115- Grade arg1,
116- Grade arg2) {
113+ ObservableValue<? extends Course> arg0,
114+ Course arg1,
115+ Course arg2) {
117116 if(arg1 != null) {
118- gradename.textProperty().unbindBidirectional(arg1.nameProperty());
119- gradestyle.textProperty().unbindBidirectional(arg1.styleProperty());
117+// gradename.textProperty().unbindBidirectional(arg1.nameProperty());
118+// gradestyle.textProperty().unbindBidirectional(arg1.styleProperty());
120119 List<String> hashes = new ArrayList<String>();
121120 if(grademd5_1.getText().length() > 2) {
122121 hashes.add(grademd5_1.getText());
@@ -133,12 +132,12 @@
133132 if(grademd5_5.getText().length() > 2) {
134133 hashes.add(grademd5_5.getText());
135134 }
136- arg1.setHashes(hashes.toArray(new String[0]));
135+ arg1.setHash(hashes.toArray(new String[0]));
137136 }
138137 if(arg2 != null) {
139- gradename.textProperty().bindBidirectional(arg2.nameProperty());
140- gradestyle.textProperty().bindBidirectional(arg2.styleProperty());
141- String[] hashes = arg2.getHashes();
138+// gradename.textProperty().bindBidirectional(arg2.nameProperty());
139+// gradestyle.textProperty().bindBidirectional(arg2.styleProperty());
140+ String[] hashes = arg2.getHash();
142141 grademd5_1.setText(hashes.length > 0 ? hashes[0] : "");
143142 grademd5_2.setText(hashes.length > 1 ? hashes[1] : "");
144143 grademd5_3.setText(hashes.length > 2 ? hashes[2] : "");
@@ -179,7 +178,7 @@
179178 level += (level.length() > 0 ? " " : "") + s;
180179 }
181180 level_order.setText(level);
182- grade.getItems().setAll(dt.getGrade());
181+ grade.getItems().setAll(dt.getCourse()[0]);
183182 } catch (Exception e) {
184183 // controller.showErrorMessage("難易度表の読み込みに失敗しました");
185184 Logger.getGlobal().severe("難易度表の読み込み中の例外:" + e.getMessage());
@@ -196,7 +195,7 @@
196195 dt.setTag(tag.getText());
197196 dt.setDataURL(new String[]{data_url.getText()});
198197 dt.setLevelDescription(level_order.getText().split(" "));
199- dt.setGrade(grade.getItems().toArray(new Grade[0]));
198+ dt.setCourse(new Course[][]{grade.getItems().toArray(new Course[0])});
200199
201200 DifficultyTableParser dtp = new DifficultyTableParser();
202201 dtp.encodeJSONTableHeader(dt, f);
@@ -210,7 +209,7 @@
210209 }
211210
212211 public void moveUpSelectedGrade() {
213- Grade g = grade.getSelectionModel().getSelectedItem();
212+ Course g = grade.getSelectionModel().getSelectedItem();
214213 int index = grade.getItems().indexOf(g);
215214 if(index > 0) {
216215 grade.getItems().remove(g);
@@ -220,7 +219,7 @@
220219 }
221220
222221 public void moveDownSelectedGrade() {
223- Grade g = grade.getSelectionModel().getSelectedItem();
222+ Course g = grade.getSelectionModel().getSelectedItem();
224223 int index = grade.getItems().indexOf(g);
225224 if(index < grade.getItems().size() - 1) {
226225 grade.getItems().remove(g);
@@ -232,14 +231,14 @@
232231 public void addGrade() {
233232 int index = grade.getSelectionModel().getSelectedIndex();
234233 if(index >= 0) {
235- grade.getItems().add(index, new Grade());
234+ grade.getItems().add(index, new Course());
236235 } else {
237- grade.getItems().add(new Grade());
236+ grade.getItems().add(new Course());
238237 }
239238 }
240239
241240 public void removeGrade() {
242- Grade g = grade.getSelectionModel().getSelectedItem();
241+ Course g = grade.getSelectionModel().getSelectedItem();
243242 if(g != null) {
244243 grade.getItems().remove(g);
245244 }
--- trunk/bms_dtimporter/src/bms/tool/glassist/BMSTableRecord.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/BMSTableRecord.java (revision 234)
@@ -37,7 +37,7 @@
3737 this.status = status;
3838 level.set(dte.getDifficultyID());
3939 this.memoMap = memo;
40- this.memo.set(memo.get(dte.getHash()) != null ? memo.get(dte.getHash())
40+ this.memo.set(memo.get(dte.getMD5()) != null ? memo.get(dte.getMD5())
4141 : "");
4242 this.rival = rival;
4343 this.song = song;
@@ -53,9 +53,9 @@
5353 public void changed(ObservableValue<? extends String> arg0,
5454 String arg1, String arg2) {
5555 if (arg2 != null && arg2.length() > 0) {
56- memoMap.put(dte.getHash(), arg2);
56+ memoMap.put(dte.getMD5(), arg2);
5757 } else {
58- memoMap.remove(dte.getHash());
58+ memoMap.remove(dte.getMD5());
5959 }
6060 }
6161 });
--- trunk/bms_dtimporter/src/bms/tool/glassist/BMSTableView.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/BMSTableView.java (revision 234)
@@ -13,7 +13,6 @@
1313 import bms.player.lunaticrave2.IRScoreData;
1414 import bms.player.lunaticrave2.SongData;
1515 import bms.table.*;
16-import bms.table.DifficultyTable.Grade;
1716 import javafx.beans.value.ChangeListener;
1817 import javafx.beans.value.ObservableValue;
1918 import javafx.concurrent.Task;
@@ -263,7 +262,7 @@
263262 public void update(DifficultyTable dt, Map<BMSTableElement, SongData> path,
264263 Map<BMSTableElement, IRScoreData> status,
265264 Map<BMSTableElement, IRScoreData> rivalmap,
266- Map<Grade, IRScoreData> grades, int djp, int rdjp) {
265+ Map<Course, IRScoreData> grades, int djp, int rdjp) {
267266 this.dt = dt;
268267 boolean isNull = (dt == null || dt instanceof FavoriteTable);
269268 songpath = path;
@@ -285,12 +284,14 @@
285284 tableController.update(dt, path, status, rivalmap);
286285
287286 if (dt != null) {
288- Grade gr = null;
289- for (Grade g : dt.getGrade()) {
290- IRScoreData score = grades.get(g);
291- if (score != null && score.getClear() > 2) {
292- gr = g;
293- }
287+ Course gr = null;
288+ if(dt.getCourse().length > 0) {
289+ for (Course g : dt.getCourse()[0]) {
290+ IRScoreData score = grades.get(g);
291+ if (score != null && score.getClear() > 2) {
292+ gr = g;
293+ }
294+ }
294295 }
295296
296297 if (gr != null) {
@@ -750,14 +751,17 @@
750751 Arrays.asList(dt.getElements()));
751752 l.addAll(dtm.getUserDifficultyTableElements(dt.getName()));
752753 for (int i = 0; i < l.size(); i++) {
753- if (hash.equals(l.get(i).getHash())) {
754+ if (hash.equals(l.get(i).getMD5())) {
754755 controller.showErrorMessage("既に同じ譜面が難易度表に存在しています");
755756 return;
756757 }
757758 }
758759
759- DifficultyTableElement dte = new DifficultyTableElement(
760- searchController.getSelectedSongData());
760+ DifficultyTableElement dte = new DifficultyTableElement();
761+ SongData sd = searchController.getSelectedSongData();
762+ dte.setTitle(sd.getTitle());
763+ dte.setDifficultyID(String.valueOf(sd.getLevel()));
764+ dte.setMD5(sd.getHash());
761765 boolean b = true;
762766 for (String s : dt.getLevelDescription()) {
763767 if (s.equals(dte.getDifficultyID())) {
--- trunk/bms_dtimporter/src/bms/tool/glassist/MainController.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/MainController.java (revision 234)
@@ -30,7 +30,6 @@
3030 import bms.player.lunaticrave2.RivalData;
3131 import bms.player.lunaticrave2.SongData;
3232 import bms.table.*;
33-import bms.table.DifficultyTable.Grade;
3433 import bms.tool.glassist.bmsimport.ExtraBMSFileImportView;
3534 import bms.tool.glassist.external.BMSPlayerAccessor;
3635 import bms.tool.glassist.external.BMSPlayerConfiguration;
@@ -356,10 +355,6 @@
356355 if (!local.isDeveloperMode()) {
357356 BMSPlayerConfiguration config = (BMSPlayerConfiguration) getConfigurationMap()
358357 .get(ConfigurationMap.BMSPLAYER_CONFIGURATION_SELECTED);
359- if (config instanceof LunaticRave2Configuration) {
360- ((LunaticRave2Configuration) config)
361- .setUnofficialPatch(0);
362- }
363358 local.setDeveloperMode(true);
364359 mediaController.enableDebugMode();
365360 // 統合難易度表テスト用
@@ -446,7 +441,7 @@
446441 .getUserDifficultyTableElements(dt.getName());
447442 for (DifficultyTableElement te : dt.getElements()) {
448443 for (DifficultyTableElement te2 : l) {
449- if (te2.getHash().equals(te.getHash())) {
444+ if (te.getMD5().equals(te2.getMD5())) {
450445 l.remove(te2);
451446 break;
452447 }
@@ -584,13 +579,15 @@
584579 }
585580
586581 if (type != UPDATE_SEARCH_VIEW) {
587- Map<Grade, IRScoreData> grade = new HashMap();
582+ Map<Course, IRScoreData> grade = new HashMap();
588583 double djp = 0;
589584 double rdjp = 0;
590585 if (dt != null) {
591- for (Grade g : dt.getGrade()) {
592- grade.put(g, bmsplayer.getGradeData(
593- playerName.getValue(), g));
586+ if(dt.getCourse().length > 0) {
587+ for (Course g : dt.getCourse()[0]) {
588+ grade.put(g, bmsplayer.getGradeData(
589+ playerName.getValue(), g));
590+ }
594591 }
595592
596593 for (DifficultyTableElement te : dt.getElements()) {
@@ -679,7 +676,7 @@
679676 if (clear >= 2 && clear < 12) {
680677 boolean isSync = false;
681678 for (IRScoreData ir : update) {
682- if (te.getHash().equals(ir.getHash())
679+ if (te.getMD5().equals(ir.getHash())
683680 && clear - 1 <= ir.getClear()) {
684681 isSync = true;
685682 break;
@@ -689,7 +686,7 @@
689686 scoremap.get(te).setSync(1);
690687 }
691688 for (IRScoreData ir : update2) {
692- if (te.getHash().equals(ir.getHash())) {
689+ if (te.getMD5().equals(ir.getHash())) {
693690 if (ir.getCleardetail() > 1) {
694691 scoremap.get(te).setClear(-clear);
695692 }
@@ -722,7 +719,7 @@
722719 for (BMSTableElement te : hashes) {
723720 IRScoreData data = null;
724721 for (IRScoreData ir : update) {
725- if (te.getHash().equals(ir.getHash())
722+ if (te.getMD5().equals(ir.getHash())
726723 && (data == null || data.getLastupdate() < ir
727724 .getLastupdate())) {
728725 data = ir;
@@ -986,7 +983,7 @@
986983 .getElements()));
987984 l.addAll(dtm.getUserDifficultyTableElements(dt.getName()));
988985 for (int i = 0; i < l.size(); i++) {
989- if (hash.equals(l.get(i).getHash())) {
986+ if (hash.equals(l.get(i).getMD5())) {
990987 showErrorMessage("既に同じ譜面が難易度表に存在しています");
991988 return;
992989 }
--- trunk/bms_dtimporter/src/bms/tool/glassist/external/BMSPlayerAccessor.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/external/BMSPlayerAccessor.java (revision 234)
@@ -8,7 +8,6 @@
88 import bms.player.lunaticrave2.RivalData;
99 import bms.player.lunaticrave2.SongData;
1010 import bms.table.*;
11-import bms.table.DifficultyTable.Grade;
1211
1312 /**
1413 * BMSプレイヤーをGLAssistに対応させるためのインターフェイス 現段階では仮策定状態で、今後変更の可能性大
@@ -71,7 +70,7 @@
7170 public Map<BMSTableElement, IRScoreData> getScoreDatas(String value,
7271 BMSTableElement[] tes);
7372
74- public IRScoreData getGradeData(String value, Grade grade);
73+ public IRScoreData getGradeData(String value, Course grade);
7574
7675 public Map<BMSTableElement, IRScoreData> getRivalScoreDatas(String irid,
7776 BMSTableElement[] hashes);
--- trunk/bms_dtimporter/src/bms/tool/glassist/external/BMSViewerAccessor.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/external/BMSViewerAccessor.java (revision 234)
@@ -6,7 +6,6 @@
66 import bms.player.lunaticrave2.PlayerData;
77 import bms.player.lunaticrave2.RivalData;
88 import bms.table.*;
9-import bms.table.DifficultyTable.Grade;
109
1110 /**
1211 * BMSビューア用アクセスクラス
@@ -46,7 +45,7 @@
4645 }
4746
4847 @Override
49- public IRScoreData getGradeData(String value, Grade grade) {
48+ public IRScoreData getGradeData(String value, Course grade) {
5049 return null;
5150 }
5251
--- trunk/bms_dtimporter/src/bms/tool/glassist/external/DefaultBMSPlayerAccessor.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/external/DefaultBMSPlayerAccessor.java (revision 234)
@@ -12,8 +12,8 @@
1212 import bms.player.lunaticrave2.SongData;
1313 import bms.table.BMSTable;
1414 import bms.table.BMSTableElement;
15+import bms.table.Course;
1516 import bms.table.DifficultyTable;
16-import bms.table.DifficultyTable.Grade;
1717 import bms.table.DifficultyTableElement;
1818
1919 public class DefaultBMSPlayerAccessor implements BMSPlayerAccessor {
@@ -57,7 +57,7 @@
5757 }
5858
5959 @Override
60- public IRScoreData getGradeData(String value, Grade grade) {
60+ public IRScoreData getGradeData(String value, Course grade) {
6161 return null;
6262 }
6363
--- trunk/bms_dtimporter/src/bms/tool/glassist/external/beatoraja/BeatorajaAccessor.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/tool/glassist/external/beatoraja/BeatorajaAccessor.java (revision 234)
@@ -20,7 +20,6 @@
2020 import bms.player.lunaticrave2.RivalData;
2121 import bms.player.lunaticrave2.SongData;
2222 import bms.table.*;
23-import bms.table.DifficultyTable.Grade;
2423 import bms.tool.glassist.MainController;
2524 import bms.tool.glassist.external.BMSPlayerAccessor;
2625
@@ -124,12 +123,12 @@
124123 public Map<BMSTableElement, IRScoreData> getScoreDatas(String value, BMSTableElement[] tes) {
125124 String[] hash = new String[tes.length];
126125 for(int i = 0;i < hash.length;i++) {
127- hash[i] = tes[i].getHash();
126+ hash[i] = tes[i].getMD5();
128127 }
129128 Map<String, IRScoreData> m = scoredb.getScoreDatas(value, hash, false);
130129 Map<BMSTableElement, IRScoreData> result = new HashMap();
131130 for(BMSTableElement te : tes) {
132- IRScoreData score = m.get(te.getHash());
131+ IRScoreData score = m.get(te.getMD5());
133132 result.put(te, score);
134133 }
135134 return result;
@@ -136,7 +135,7 @@
136135 }
137136
138137 @Override
139- public IRScoreData getGradeData(String value, Grade grade) {
138+ public IRScoreData getGradeData(String value, Course grade) {
140139 return null;
141140 }
142141
@@ -218,7 +217,7 @@
218217 Map<BMSTableElement, SongData> result = new HashMap<BMSTableElement, SongData>();
219218 try {
220219 for (BMSTableElement te : datas) {
221- SongData[] m =songdb.getSongDatas("hash", te.getHash(), config.getPath());
220+ SongData[] m =songdb.getSongDatas("hash", te.getMD5(), config.getPath());
222221
223222 if (m.length > 0) {
224223 SongData song = m[0];
--- trunk/bms_dtimporter/src/bms/ubmplay/UBMPlayAccessor.java (revision 233)
+++ trunk/bms_dtimporter/src/bms/ubmplay/UBMPlayAccessor.java (revision 234)
@@ -91,7 +91,7 @@
9191 Map<BMSTableElement, SongData> result = new HashMap<BMSTableElement, SongData>();
9292 try {
9393 for (BMSTableElement te : datas) {
94- SongData[] m =songdb.getSongDatas("hash", te.getHash(), config.getPath());
94+ SongData[] m =songdb.getSongDatas("hash", te.getMD5(), config.getPath());
9595
9696 if (m.length > 0) {
9797 SongData song = m[0];
Show on old repository browser