Merge pull request #11284 from AdmiralCurtiss/netplay-save-sync-check-corrupted

Netplay: Check if save is readable before marking it for sync.
This commit is contained in:
Admiral H. Curtiss 2023-04-23 16:01:00 +02:00 committed by GitHub
commit 319adaa831
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 ||