Netplay: Check if save is readable before marking it for sync.

This commit is contained in:
Admiral H. Curtiss 2022-11-16 04:31:01 +01:00
parent 8fbfee03ab
commit 00e4fc4b70
No known key found for this signature in database
GPG Key ID: F051B4C4044F33FB
1 changed files with 9 additions and 1 deletions

View File

@ -1721,7 +1721,15 @@ std::optional<SaveSyncInfo> NetPlayServer::CollectSaveSyncInfo()
for (const u64 title : ios.GetES()->GetInstalledTitles())
{
auto save = WiiSave::MakeNandStorage(sync_info.configured_fs.get(), title);
sync_info.wii_saves.emplace_back(title, std::move(save));
if (save && save->ReadHeader().has_value() && save->ReadBkHeader().has_value() &&
save->ReadFiles().has_value())
{
sync_info.wii_saves.emplace_back(title, std::move(save));
}
else
{
INFO_LOG_FMT(NETPLAY, "Skipping Wii save of title {:016x}.", title);
}
}
}
else if (sync_info.game->GetPlatform() == DiscIO::Platform::WiiDisc ||