mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-28 07:22:21 -08:00
Make isSaveValid check backups
This commit is contained in:
parent
3e4b86d095
commit
a0f235b430
1 changed files with 6 additions and 1 deletions
|
|
@ -56,8 +56,13 @@ public class SaveIO{
|
|||
}
|
||||
|
||||
public static boolean isSaveValid(Fi file){
|
||||
return isSaveFileValid(file) || isSaveFileValid(backupFileFor(file));
|
||||
}
|
||||
|
||||
private static boolean isSaveFileValid(Fi file){
|
||||
try(DataInputStream stream = new DataInputStream(new InflaterInputStream(file.read(bufferSize)))){
|
||||
return isSaveValid(stream);
|
||||
getMeta(stream);
|
||||
return true;
|
||||
}catch(Throwable e){
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue