mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Force a checksum check before skipping FileStore copy op
This commit is contained in:
@ -50,7 +50,16 @@ namespace osu.Game.IO
|
|||||||
string path = info.StoragePath;
|
string path = info.StoragePath;
|
||||||
|
|
||||||
// we may be re-adding a file to fix missing store entries.
|
// we may be re-adding a file to fix missing store entries.
|
||||||
if (!Storage.Exists(path))
|
bool requiresCopy = !Storage.Exists(path);
|
||||||
|
|
||||||
|
if (!requiresCopy)
|
||||||
|
{
|
||||||
|
// even if the file already exists, check the existing checksum for safety.
|
||||||
|
using (var stream = Storage.GetStream(path))
|
||||||
|
requiresCopy |= stream.ComputeSHA2Hash() != hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (requiresCopy)
|
||||||
{
|
{
|
||||||
data.Seek(0, SeekOrigin.Begin);
|
data.Seek(0, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user