Pass RuleSet to ScoreStore, compute and store MD5 for legacy replays compatibility

This commit is contained in:
tgi74000 2017-08-08 17:17:53 +02:00
parent d5c6693990
commit 3d4db427ff
4 changed files with 5 additions and 2 deletions

View File

@ -52,6 +52,8 @@ namespace osu.Game.Beatmaps
[JsonProperty("file_md5")]
public string Hash { get; set; }
public string MD5Hash { get; set; }
// General
public int AudioLeadIn { get; set; }
public bool Countdown { get; set; }

View File

@ -367,6 +367,7 @@ namespace osu.Game.Beatmaps
beatmap.BeatmapInfo.Path = name;
beatmap.BeatmapInfo.Hash = ms.ComputeSHA2Hash();
beatmap.BeatmapInfo.MD5Hash = ms.ComputeMD5Hash();
// TODO: Diff beatmap metadata with set metadata and leave it here if necessary
beatmap.BeatmapInfo.Metadata = null;

View File

@ -103,7 +103,7 @@ namespace osu.Game
dependencies.Cache(RulesetStore = new RulesetStore(connection));
dependencies.Cache(FileStore = new FileStore(connection, Host.Storage));
dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, FileStore, connection, RulesetStore, Host));
dependencies.Cache(ScoreStore = new ScoreStore(Host.Storage, connection, Host, BeatmapManager));
dependencies.Cache(ScoreStore = new ScoreStore(Host.Storage, connection, Host, BeatmapManager, RulesetStore));
dependencies.Cache(new OsuColour());
//this completely overrides the framework default. will need to change once we make a proper FontStore.

View File

@ -53,7 +53,7 @@ namespace osu.Game.Rulesets.Scoring
var version = sr.ReadInt32();
/* score.FileChecksum = */
var beatmapHash = sr.ReadString();
score.Beatmap = beatmaps.QueryBeatmap(b => b.Hash == beatmapHash);
score.Beatmap = beatmaps.QueryBeatmap(b => b.MD5Hash == beatmapHash);
/* score.PlayerName = */
sr.ReadString();
/* var localScoreChecksum = */