Merge remote-tracking branch 'org/master' into ReplayTest

Conflicts:
	src/itdelatrisu/opsu/GameData.java
	src/itdelatrisu/opsu/states/Game.java
This commit is contained in:
fd
2015-06-21 20:05:36 -04:00
7 changed files with 73 additions and 107 deletions

View File

@@ -10,6 +10,8 @@ import itdelatrisu.opsu.db.ScoreDB;
import java.io.File;
import java.io.IOException;
import org.newdawn.slick.util.Log;
public class ReplayImporter {
public static void importAllReplaysFromDir(File dir) {
for (File replayToImport : dir.listFiles()) {
@@ -28,21 +30,18 @@ public class ReplayImporter {
//ErrorHandler.error("Importing"+replayToImport+" forBeatmap:"+oFile, null, false);
ScoreData data = r.getScoreData(oFile);
File moveToFile = new File(replaydir, replayToImport.getName());
System.out.println("Moving "+replayToImport+" to "+moveToFile);
if(
!replayToImport.renameTo(moveToFile)
){
System.out.println("Rename Failed "+moveToFile);
Log.warn("Rename Failed "+moveToFile);
}
data.replayString = replayToImport.getName().substring(0, replayToImport.getName().length()-4);
ScoreDB.addScore(data);;
} else {
System.out.println("Could not find beatmap for replay "+replayToImport);
//ErrorHandler.error("Could not find beatmap for replay "+replayToImport, null, false);
Log.warn("Could not find beatmap for replay "+replayToImport);
}
} catch (IOException e) {
//e.printStackTrace();
System.out.println(e);
Log.warn("Failed to import replays ",e);
}
}