Reworked Camera Movement in Replay Viewer

Finally made Replay Trimming work
Fixed and dried ReplayProcess pathTick() method
This commit is contained in:
Marius Metzger
2015-03-31 01:10:01 +02:00
parent 11e26e0129
commit becbf47088
19 changed files with 237 additions and 247 deletions

View File

@@ -45,10 +45,15 @@ import eu.crushedpixel.replaymod.replay.PacketDeserializer;
@SuppressWarnings("resource") //Gets handled by finalizer
public class ReplayFileIO {
public static List<File> getAllReplayFiles() {
public static File getReplayFolder() {
File folder = new File("./replay_recordings/");
folder.mkdirs();
return folder;
}
public static List<File> getAllReplayFiles() {
List<File> files = new ArrayList<File>();
File folder = getReplayFolder();
for(File file : folder.listFiles()) {
if(("."+FilenameUtils.getExtension(file.getAbsolutePath())).equals(
ConnectionEventHandler.ZIP_FILE_EXTENSION)) {
@@ -58,7 +63,7 @@ public class ReplayFileIO {
return files;
}
private static DataInputStream getMetaDataInputStream(File replayFile) throws Exception {
private static DataInputStream getMetaDataInputStream(File replayFile) throws IOException {
ZipFile archive = null;
try {
@@ -67,7 +72,7 @@ public class ReplayFileIO {
ConnectionEventHandler.JSON_FILE_EXTENSION);
return new DataInputStream(archive.getInputStream(tmcpr));
} catch(Exception e) {
} catch(IOException e) {
throw e;
}
}
@@ -118,7 +123,7 @@ public class ReplayFileIO {
}
}
public static ReplayMetaData getMetaData(File replayFile) throws Exception {
public static ReplayMetaData getMetaData(File replayFile) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(getMetaDataInputStream(replayFile)));
String json = br.readLine();