Do not bother recovering useless replays (fixes #444)

Useless replays being those for which auto-recording was disabled and Start
never pressed.
This commit is contained in:
Jonas Herzig
2021-02-16 22:38:39 +01:00
parent dabb64340e
commit 19ff1ef38b
2 changed files with 12 additions and 0 deletions

View File

@@ -272,6 +272,10 @@ public class PacketListener extends ChannelInboundHandlerAdapter {
// Immediately close the saving popup, the user doesn't care about it
core.runLater(guiSavingReplay::close);
// If we crash right here, on the next start we'll prompt the user for recovery
// but we don't really want that, so drop a marker file to skip recovery for this replay.
Files.createFile(outputPath.resolveSibling(outputPath.getFileName() + ".no_recover"));
// We still have the replay, so we just save it (at least for a few weeks) in case they change their mind
String replayName = FilenameUtils.getBaseName(outputPath.getFileName().toString());
Path rawFolder = ReplayMod.instance.getRawReplayFolder();