From 2c4f1817d3af1b20fe4e9002add599375c49bd95 Mon Sep 17 00:00:00 2001 From: Darius Wattimena Date: Sun, 14 Nov 2021 20:43:31 +0100 Subject: [PATCH 1/8] Fixed an issue where banana showers don't clear the plate when missing the last banana --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 604e878782..0cbabac911 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -10,7 +10,6 @@ using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects.Drawables; using osu.Game.Rulesets.Catch.Replays; using osu.Game.Rulesets.Judgements; -using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osuTK; @@ -73,8 +72,8 @@ namespace osu.Game.Rulesets.Catch.UI { Catcher.OnNewResult(hitObject, result); - if (!result.Type.IsScorable()) - return; + // Ignore JuiceStreams and BananaShowers + if (!(hitObject is DrawablePalpableCatchHitObject)) return; if (hitObject.HitObject.LastInCombo) { From 95891bc6550180c5a3959ebcb3122a8712e8da2d Mon Sep 17 00:00:00 2001 From: Darius Wattimena Date: Thu, 18 Nov 2021 20:03:41 +0100 Subject: [PATCH 2/8] Moved clear plate logic to Catcher class --- osu.Game.Rulesets.Catch/UI/Catcher.cs | 9 +++++++++ osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 13 ------------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/Catcher.cs b/osu.Game.Rulesets.Catch/UI/Catcher.cs index 2a13190cc5..0b041da076 100644 --- a/osu.Game.Rulesets.Catch/UI/Catcher.cs +++ b/osu.Game.Rulesets.Catch/UI/Catcher.cs @@ -210,8 +210,17 @@ namespace osu.Game.Rulesets.Catch.UI catchResult.CatcherAnimationState = CurrentState; catchResult.CatcherHyperDash = HyperDashing; + // Ignore JuiceStreams and BananaShowers if (!(drawableObject is DrawablePalpableCatchHitObject palpableObject)) return; + if (palpableObject.HitObject.LastInCombo) + { + if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result)) + Explode(); + else + Drop(); + } + var hitObject = palpableObject.HitObject; if (result.IsHit) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 0cbabac911..37002d1051 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -6,7 +6,6 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Input.Bindings; using osu.Framework.Input.Events; -using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects.Drawables; using osu.Game.Rulesets.Catch.Replays; using osu.Game.Rulesets.Judgements; @@ -71,18 +70,6 @@ namespace osu.Game.Rulesets.Catch.UI public void OnNewResult(DrawableCatchHitObject hitObject, JudgementResult result) { Catcher.OnNewResult(hitObject, result); - - // Ignore JuiceStreams and BananaShowers - if (!(hitObject is DrawablePalpableCatchHitObject)) return; - - if (hitObject.HitObject.LastInCombo) - { - if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result)) - Catcher.Explode(); - else - Catcher.Drop(); - } - comboDisplay.OnNewResult(hitObject, result); } From cfedbb92c1ad6bb4ee58cf54fd7654d827da5be2 Mon Sep 17 00:00:00 2001 From: Darius Wattimena Date: Thu, 18 Nov 2021 20:07:03 +0100 Subject: [PATCH 3/8] Added a unit test to cover clearing of the plate when missing the last banana --- osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs index 29a7b03ad3..bc94b50301 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs @@ -168,6 +168,17 @@ namespace osu.Game.Rulesets.Catch.Tests checkHyperDash(false); } + [Test] + public void TestLastBananaShouldClearPlate() + { + AddStep("catch fruit", () => attemptCatch(new Fruit())); + checkPlate(1); + AddStep("miss banana", () => attemptCatch(new Banana { X = 100 })); + checkPlate(1); + AddStep("miss last banana", () => attemptCatch(new Banana { LastInCombo = true, X = 100 })); + checkPlate(0); + } + [Test] public void TestCatcherRandomStacking() { From 9685892b946c36f3f2ba4eadd0ed49b0834c4444 Mon Sep 17 00:00:00 2001 From: Darius Wattimena Date: Thu, 18 Nov 2021 20:23:42 +0100 Subject: [PATCH 4/8] Added an extra unit test when actually catching the last banana to also clear the plate --- osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs index bc94b50301..4f527e9a0f 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestSceneCatcher.cs @@ -169,7 +169,7 @@ namespace osu.Game.Rulesets.Catch.Tests } [Test] - public void TestLastBananaShouldClearPlate() + public void TestLastBananaShouldClearPlateOnMiss() { AddStep("catch fruit", () => attemptCatch(new Fruit())); checkPlate(1); @@ -179,6 +179,17 @@ namespace osu.Game.Rulesets.Catch.Tests checkPlate(0); } + [Test] + public void TestLastBananaShouldClearPlateOnCatch() + { + AddStep("catch fruit", () => attemptCatch(new Fruit())); + checkPlate(1); + AddStep("catch banana", () => attemptCatch(new Banana())); + checkPlate(2); + AddStep("catch last banana", () => attemptCatch(new Banana { LastInCombo = true })); + checkPlate(0); + } + [Test] public void TestCatcherRandomStacking() { From 38edeac71031aff9aaf6f1559d8407a6a396c1d3 Mon Sep 17 00:00:00 2001 From: Darius Wattimena Date: Thu, 18 Nov 2021 20:24:40 +0100 Subject: [PATCH 5/8] Moved the logic to the bottom as placeCaughtObject is otherwise not called yet --- osu.Game.Rulesets.Catch/UI/Catcher.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/Catcher.cs b/osu.Game.Rulesets.Catch/UI/Catcher.cs index 0b041da076..04708c8796 100644 --- a/osu.Game.Rulesets.Catch/UI/Catcher.cs +++ b/osu.Game.Rulesets.Catch/UI/Catcher.cs @@ -213,14 +213,6 @@ namespace osu.Game.Rulesets.Catch.UI // Ignore JuiceStreams and BananaShowers if (!(drawableObject is DrawablePalpableCatchHitObject palpableObject)) return; - if (palpableObject.HitObject.LastInCombo) - { - if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result)) - Explode(); - else - Drop(); - } - var hitObject = palpableObject.HitObject; if (result.IsHit) @@ -253,6 +245,14 @@ namespace osu.Game.Rulesets.Catch.UI CurrentState = hitObject.Kiai ? CatcherAnimationState.Kiai : CatcherAnimationState.Idle; else if (!(hitObject is Banana)) CurrentState = CatcherAnimationState.Fail; + + if (palpableObject.HitObject.LastInCombo) + { + if (result.Judgement is CatchJudgement catchJudgement && catchJudgement.ShouldExplodeFor(result)) + Explode(); + else + Drop(); + } } public void OnRevertResult(DrawableCatchHitObject drawableObject, JudgementResult result) From 284e554cbffdb25c967957a096cb8259bc364747 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 19 Nov 2021 13:58:03 +0900 Subject: [PATCH 6/8] Only show user displayable portion of server errors when seleting a song in multiplayer --- .../Multiplayer/MultiplayerMatchSongSelect.cs | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSongSelect.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSongSelect.cs index ad4bb90551..9ae352b3e7 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSongSelect.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerMatchSongSelect.cs @@ -1,6 +1,9 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; +using System.Diagnostics; +using Microsoft.AspNetCore.SignalR; using osu.Framework.Allocation; using osu.Framework.Logging; using osu.Framework.Screens; @@ -60,13 +63,28 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer { loadingLayer.Hide(); - if (t.IsCompletedSuccessfully) - this.Exit(); - else + if (t.IsFaulted) { - Logger.Log($"Could not use current beatmap ({t.Exception?.Message})", level: LogLevel.Important); + Exception exception = t.Exception; + + if (exception is AggregateException ae) + exception = ae.InnerException; + + Debug.Assert(exception != null); + + string message = exception is HubException + // HubExceptions arrive with additional message context added, but we want to display the human readable message: + // "An unexpected error occurred invoking 'AddPlaylistItem' on the server.InvalidStateException: Can't enqueue more than 3 items at once." + // We generally use the message field for a user-parseable error (eventually to be replaced), so drop the first part for now. + ? exception.Message.Substring(exception.Message.IndexOf(':') + 1).Trim() + : exception.Message; + + Logger.Log(message, level: LogLevel.Important); Carousel.AllowSelection = true; + return; } + + this.Exit(); }); }); } From 6dc6ca1bbb67296931c47a32255aad866f22f192 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 19 Nov 2021 14:03:07 +0900 Subject: [PATCH 7/8] Fix potential null reference in `FadeAccessibleBackground` test class --- osu.Game.Tests/Visual/Background/TestSceneUserDimBackgrounds.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/Background/TestSceneUserDimBackgrounds.cs b/osu.Game.Tests/Visual/Background/TestSceneUserDimBackgrounds.cs index 69ea1dc520..194341d1ab 100644 --- a/osu.Game.Tests/Visual/Background/TestSceneUserDimBackgrounds.cs +++ b/osu.Game.Tests/Visual/Background/TestSceneUserDimBackgrounds.cs @@ -428,7 +428,7 @@ namespace osu.Game.Tests.Visual.Background public float CurrentDim => dimmable.DimLevel; - public Vector2 CurrentBlur => Background.BlurSigma; + public Vector2 CurrentBlur => Background?.BlurSigma ?? Vector2.Zero; private TestDimmableBackground dimmable; From 215c179b929a29e0c083422f29a6031f9450ffe3 Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Fri, 19 Nov 2021 16:16:20 +0900 Subject: [PATCH 8/8] Run nunit in blame mode --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68f8ef51ef..2139572601 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: run: dotnet build -c Debug -warnaserror osu.Desktop.slnf - name: Test - run: dotnet test $pwd/*.Tests/bin/Debug/*/*.Tests.dll --logger "trx;LogFileName=TestResults-${{matrix.os.prettyname}}-${{matrix.threadingMode}}.trx" + run: dotnet test $pwd/*.Tests/bin/Debug/*/*.Tests.dll --blame-crash --blame-hang --blame-hang-timeout 5m --logger "trx;LogFileName=TestResults-${{matrix.os.prettyname}}-${{matrix.threadingMode}}.trx" shell: pwsh # Attempt to upload results even if test fails. @@ -48,7 +48,7 @@ jobs: if: ${{ always() }} with: name: osu-test-results-${{matrix.os.prettyname}}-${{matrix.threadingMode}} - path: ${{github.workspace}}/TestResults/TestResults-${{matrix.os.prettyname}}-${{matrix.threadingMode}}.trx + path: ${{github.workspace}}/TestResults/**/* build-only-android: name: Build only (Android)