From 123f304cf1b0e9ad1322eed614b798531db03dea Mon Sep 17 00:00:00 2001 From: jorolf Date: Thu, 2 Aug 2018 19:24:17 +0200 Subject: [PATCH 1/7] update storage usages --- osu.Game/Beatmaps/BeatmapManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 67f02c8ac4..0ff6c3d98c 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -329,7 +329,7 @@ namespace osu.Game.Beatmaps return; } - await Task.Factory.StartNew(() => Import(stable.GetDirectories("Songs")), TaskCreationOptions.LongRunning); + await Task.Factory.StartNew(() => Import(stable.GetDirectories("Songs").Select(stable.GetUsablePathFor).ToArray()), TaskCreationOptions.LongRunning); } /// From 8be5a606bf0c9a4ba5c21f0056b3e161e7efd269 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 14 Aug 2018 18:33:07 +0900 Subject: [PATCH 2/7] Fix swells possibly being strong hitobjects --- osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs index 41972b5d20..acd6d43284 100644 --- a/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs +++ b/osu.Game.Rulesets.Taiko/Beatmaps/TaikoBeatmapConverter.cs @@ -168,7 +168,6 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps { StartTime = obj.StartTime, Samples = obj.Samples, - IsStrong = strong, Duration = endTimeData.Duration, RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier) }; From 7c3556baf8312faee499f8a075dbedfd8095ed41 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 15 Aug 2018 09:12:29 +0900 Subject: [PATCH 3/7] Throw exception when Swell.IsStrong is set --- osu.Game.Rulesets.Taiko/Objects/Swell.cs | 3 +++ osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Taiko/Objects/Swell.cs b/osu.Game.Rulesets.Taiko/Objects/Swell.cs index c3ea71af3f..702bf63bf5 100644 --- a/osu.Game.Rulesets.Taiko/Objects/Swell.cs +++ b/osu.Game.Rulesets.Taiko/Objects/Swell.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System; using osu.Game.Rulesets.Objects.Types; namespace osu.Game.Rulesets.Taiko.Objects @@ -16,6 +17,8 @@ namespace osu.Game.Rulesets.Taiko.Objects /// public int RequiredHits = 10; + public override bool IsStrong { set => throw new NotSupportedException($"{nameof(Swell)} cannot be a strong hitobject."); } + protected override void CreateNestedHitObjects() { base.CreateNestedHitObjects(); diff --git a/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs index 6948c5bcde..9c86b60688 100644 --- a/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs +++ b/osu.Game.Rulesets.Taiko/Objects/TaikoHitObject.cs @@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Taiko.Objects /// Whether this HitObject is a "strong" type. /// Strong hit objects give more points for hitting the hit object with both keys. /// - public bool IsStrong; + public virtual bool IsStrong { get; set; } protected override void CreateNestedHitObjects() { From 4dfb63023fecb6ee694d4a0972acb1957c5d0809 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 15 Aug 2018 15:49:48 +0900 Subject: [PATCH 4/7] Update with recent changes --- osu.Game/Beatmaps/BeatmapManager.cs | 2 +- osu.Game/osu.Game.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osu.Game/Beatmaps/BeatmapManager.cs b/osu.Game/Beatmaps/BeatmapManager.cs index 0ff6c3d98c..1c28b533d2 100644 --- a/osu.Game/Beatmaps/BeatmapManager.cs +++ b/osu.Game/Beatmaps/BeatmapManager.cs @@ -329,7 +329,7 @@ namespace osu.Game.Beatmaps return; } - await Task.Factory.StartNew(() => Import(stable.GetDirectories("Songs").Select(stable.GetUsablePathFor).ToArray()), TaskCreationOptions.LongRunning); + await Task.Factory.StartNew(() => Import(stable.GetDirectories("Songs").Select(f => stable.GetFullPath(f)).ToArray()), TaskCreationOptions.LongRunning); } /// diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index e9fc51ee9b..804d6587e8 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From 767c284793884011e511266083660bdc588146b1 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 15 Aug 2018 15:49:55 +0900 Subject: [PATCH 5/7] Fix import not working --- osu.Game/Database/ArchiveModelManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index 0465c0ad73..c00df59e3e 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -412,7 +412,7 @@ namespace osu.Game.Database private ArchiveReader getReaderFrom(string path) { if (ZipUtils.IsZipArchive(path)) - return new ZipArchiveReader(Files.Storage.GetStream(path), Path.GetFileName(path)); + return new ZipArchiveReader(File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read), Path.GetFileName(path)); if (Directory.Exists(path)) return new LegacyFilesystemReader(path); throw new InvalidFormatException($"{path} is not a valid archive"); From add78508e09efc3a34224f26b68d84e75466269b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 15 Aug 2018 15:54:26 +0900 Subject: [PATCH 6/7] Update framework --- osu.Game/osu.Game.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 804d6587e8..eef586fd4c 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -18,7 +18,7 @@ - + From ed2a642666111e05f3af952198832cc64449d315 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 16 Aug 2018 09:59:03 +0900 Subject: [PATCH 7/7] Fix info wedge test case failing randomly --- .../Visual/TestCaseBeatmapInfoWedge.cs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs index b232180eba..175db7d246 100644 --- a/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs +++ b/osu.Game.Tests/Visual/TestCaseBeatmapInfoWedge.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; +using JetBrains.Annotations; using NUnit.Framework; using OpenTK; using osu.Framework.Allocation; @@ -116,7 +117,7 @@ namespace osu.Game.Tests.Visual private void testNullBeatmap() { - selectNullBeatmap(); + selectBeatmap(null); AddAssert("check empty version", () => string.IsNullOrEmpty(infoWedge.Info.VersionLabel.Text)); AddAssert("check default title", () => infoWedge.Info.TitleLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Title); AddAssert("check default artist", () => infoWedge.Info.ArtistLabel.Text == Beatmap.Default.BeatmapInfo.Metadata.Artist); @@ -124,28 +125,19 @@ namespace osu.Game.Tests.Visual AddAssert("check no info labels", () => !infoWedge.Info.InfoLabelContainer.Children.Any()); } - private void selectBeatmap(IBeatmap b) + private void selectBeatmap([CanBeNull] IBeatmap b) { BeatmapInfoWedge.BufferedWedgeInfo infoBefore = null; - AddStep($"select {b.Metadata.Title} beatmap", () => + AddStep($"select {b?.Metadata.Title ?? "null"} beatmap", () => { infoBefore = infoWedge.Info; - infoWedge.Beatmap = Beatmap.Value = new TestWorkingBeatmap(b); + infoWedge.Beatmap = Beatmap.Value = b == null ? Beatmap.Default : new TestWorkingBeatmap(b); }); AddUntilStep(() => infoWedge.Info != infoBefore, "wait for async load"); } - private void selectNullBeatmap() - { - AddStep("select null beatmap", () => - { - Beatmap.Value = Beatmap.Default; - infoWedge.Beatmap = Beatmap; - }); - } - private IBeatmap createTestBeatmap(RulesetInfo ruleset) { List objects = new List();