From 705ef5e3acc314d86cf5bfacd9237b65148654c3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 30 Nov 2018 15:09:15 +0900 Subject: [PATCH] Fix hash function --- osu.Game/Database/ArchiveModelManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index e2157f5fb3..203c157550 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -207,7 +207,7 @@ namespace osu.Game.Database if (model == null) return null; - model.Hash = computeBeatmapSetHash(archive); + model.Hash = computeHash(archive); return Import(model, archive); } @@ -226,13 +226,13 @@ namespace osu.Game.Database protected abstract string[] HashableFileTypes { get; } /// - /// Create a SHA-2 hash from the provided archive based on contained beatmap (.osu) file content. + /// Create a SHA-2 hash from the provided archive based on file content of all files matching . /// - private string computeBeatmapSetHash(ArchiveReader reader) + private string computeHash(ArchiveReader reader) { // for now, concatenate all .osu files in the set to create a unique hash. MemoryStream hashable = new MemoryStream(); - foreach (string file in reader.Filenames.Where(f => f.EndsWith(".osu"))) + foreach (string file in reader.Filenames.Where(f => HashableFileTypes.Any(f.EndsWith))) using (Stream s = reader.GetStream(file)) s.CopyTo(hashable);